From 392f2b771dcec723bd70f01e624653150f85931b Mon Sep 17 00:00:00 2001 From: Emile Date: Wed, 9 Oct 2019 13:46:34 +0200 Subject: https, each user with a custom service --- src/docker.go | 13 ++++++++++--- 1 file 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", }, } -- cgit 1.4.1