docker run -v $PWD/certs:/certs \
-e SSL_SUBJECT=test.example.com \
-e SSL_DNS=test.example.com,test2.example.com \
-e SSL_IP=10.0.0.1 \
-e K8S_SAVE_CA_CRT=true \
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Bootstrapper | |
{ | |
public Bootstrapper() | |
{ } | |
private ContainerBuilder builder; | |
private IContainer container; | |
public IContainer Container | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ErrorHandlerModule : Autofac.Module | |
{ | |
protected override void Load(ContainerBuilder builder) | |
{ | |
base.Load(builder); | |
builder.RegisterType<MvcErrorAttribute>() | |
.As<HandleErrorAttribute>() | |
.PropertiesAutowiredWithParameters(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MvcErrorAttribute : HandleErrorAttribute | |
{ | |
public ILogger Logger { get; set; } | |
public ErrorController ErrorController { get; set; } | |
public MvcErrorAttribute() | |
{ } | |
public override void OnException(ExceptionContext filterContext) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ErrorController : Controller | |
{ | |
public ILogger Logger { get; set; } | |
public ActionResult Error(int code = 404, string redirectedUrl = "") | |
{ | |
ViewBag.StateCode = code; | |
if (code == 401) | |
if (!string.IsNullOrEmpty(redirectedUrl)) | |
return Redirect(redirectedUrl); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
/// <summary> | |
/// Copied from http://stackoverflow.com/questions/6002046/binding-visualstatemanager-view-state-to-a-mvvm-viewmodel | |
/// </summary> | |
public class StateHelper : DependencyObject | |
{ | |
public static readonly DependencyProperty StateProperty = DependencyProperty.RegisterAttached( | |
"State", typeof(String), typeof(StateHelper), new PropertyMetadata("Normal", StateChanged)); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com; | |
import org.apache.http.HttpEntity; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.NameValuePair; | |
import org.apache.http.client.entity.UrlEncodedFormEntity; | |
import org.apache.http.client.methods.CloseableHttpResponse; | |
import org.apache.http.client.methods.HttpGet; | |
import org.apache.http.client.methods.HttpPost; | |
import org.apache.http.conn.ssl.SSLConnectionSocketFactory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# These setting need you to set. | |
LOCATION=/usr/local/src/ngrok/bin | |
TLSKEY=/usr/local/src/ngrok/bin/device.key | |
TLSCRT=/usr/local/src/ngrok/bin/device.crt | |
DOMAIN=ngrok.domain.com | |
PORT=8000 | |
HTTPSPORT=4443 | |
LOGFILE=/usr/local/src/ngrok/bin/logs/ngrokd.log | |
PIDFILE=/usr/local/src/ngrok/bin/run/ngrokd.pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ClassFinder { | |
private static final char PKG_SEPARATOR = '.'; | |
private static final char DIR_SEPARATOR = '/'; | |
private static final String CLASS_FILE_SUFFIX = ".class"; | |
private static final String BAD_PACKAGE_ERROR = "Unable to get resources from path '%s'. Are you sure the package '%s' exists?"; | |
private static Logger logger = Logger.getLogger(ClassFinder.class); | |
/** | |
* scannedPackage: com.foo.bar | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1beta2 | |
kind: Deployment | |
metadata: | |
annotations: | |
deployment.kubernetes.io/revision: "6" | |
field.cattle.io/creatorId: user-2xdrm | |
field.cattle.io/publicEndpoints: '[{"nodeName":"c-zd4f7:m-948a94211766","addresses":["10.40.20.216"],"port":8080,"protocol":"TCP","podName":"base:jenkins-84d69d7-fvfk2","allNodes":false}]' | |
creationTimestamp: null | |
generation: 1 | |
labels: |