about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/docker.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/docker.go b/src/docker.go
index b5398d8..e3ff19c 100644
--- a/src/docker.go
+++ b/src/docker.go
@@ -64,9 +64,16 @@ func spawnCompanion(username string, accesscode string) {
 		// Container labels used by traefik
 		Labels: map[string]string{
 			"traefik.enable": "true",
-			fmt.Sprintf("traefik.http.routers.%s.entrypoints", username):               "web",
-			fmt.Sprintf("traefik.http.routers.%s.rule", username):                      fmt.Sprintf("Host(`%s.%s`)", username, os.Getenv("HOSTNAME")),
-			fmt.Sprintf("traefik.http.services.%s.loadbalancer.server.port", username): "8080",
+			fmt.Sprintf("traefik.http.routers.%s.entrypoints", username):                              "web",
+			fmt.Sprintf("traefik.http.routers.%s.rule", username):                                     fmt.Sprintf("Host(`%s.%s`)", username, os.Getenv("HOSTNAME")),
+			fmt.Sprintf("traefik.http.middlewares.%s-https-redirect.redirectscheme.scheme", username): "https",
+			fmt.Sprintf("traefik.http.routers.%s.middlewares", username):                              fmt.Sprintf("%s-https-redirect", username),
+			fmt.Sprintf("traefik.http.routers.%s-secure.entrypoints", username):                       "websecure",
+			fmt.Sprintf("traefik.http.routers.%s-secure.rule", username):                              fmt.Sprintf("Host(`%s.%s`)", username, os.Getenv("HOSTNAME")),
+			fmt.Sprintf("traefik.http.routers.%s-secure.tls", username):                               "true",
+			fmt.Sprintf("traefik.http.routers.%s-secure.tls.certresolver", username):                  "mytlschallenge",
+			fmt.Sprintf("traefik.http.routers.%s-secure.service", username):                           fmt.Sprintf("%s", username),
+			fmt.Sprintf("traefik.http.services.%s.loadbalancer.server.port", username):                "8080",
 			"traefik.docker.network": "circus",
 		},
 	}