From a60ba4e2d4a1f73ae3128e72f02046ea9b6894e0 Mon Sep 17 00:00:00 2001 From: Adam Cooper Date: Fri, 11 Nov 2022 21:58:16 +0000 Subject: [PATCH] Wrap dashboard routing definition in conditional This ensures that we don't define the routes for the api unless we've enabled it. --- plugins/traefik-vhosts/templates/compose.yml.sigil | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/traefik-vhosts/templates/compose.yml.sigil b/plugins/traefik-vhosts/templates/compose.yml.sigil index f8b9c0f54..8398a9114 100644 --- a/plugins/traefik-vhosts/templates/compose.yml.sigil +++ b/plugins/traefik-vhosts/templates/compose.yml.sigil @@ -24,10 +24,13 @@ services: {{ end }} labels: + {{ if $.TRAEFIK_API_ENABLED }} # Dashboard - "traefik.http.routers.api.rule=Host(`{{ $.TRAEFIK_API_VHOST }}`)" - "traefik.http.routers.api.service=api@internal" - "traefik.http.routers.api.entrypoints={{ if $.TRAEFIK_LETSENCRYPT_EMAIL }}https{{ else }}http{{ end }}" + {{ end }} + - "traefik.http.routers.middlewares=auth" {{ if $.TRAEFIK_BASIC_AUTH }} - "traefik.http.middlewares.auth.basicauth.users={{ $.TRAEFIK_BASIC_AUTH }}"