From 032c080b99641936003331a3c4bf956c45ebaa4a Mon Sep 17 00:00:00 2001 From: Dan Anglin Date: Tue, 1 Aug 2023 01:15:48 +0100 Subject: [PATCH] fix(traefik): update Traefik deployment - Upgrade Traefik to version 2.10.4. - Remove the unused dashboard router and disable the dashboard. - Remove the now unsupported pilot token. --- config | 2 +- magefiles/config.go | 1 - templates/traefik/Dockerfile.gotmpl | 2 -- templates/traefik/dynamic_dashboard.yaml.gotmpl | 8 -------- templates/traefik/entrypoint.sh.gotmpl | 8 ++++---- templates/traefik/traefik.yaml.gotmpl | 4 +--- 6 files changed, 6 insertions(+), 19 deletions(-) delete mode 100644 templates/traefik/dynamic_dashboard.yaml.gotmpl diff --git a/config b/config index 8f42ea7..276d777 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit 8f42ea727399d0fb3087eebfb4cb8c14ee73bb3f +Subproject commit 276d7777d1de147baf5c37c3578ef8384a68c63d diff --git a/magefiles/config.go b/magefiles/config.go index 2e898a1..739c18f 100644 --- a/magefiles/config.go +++ b/magefiles/config.go @@ -30,7 +30,6 @@ type traefikConfig struct { SharedMountPoint string `json:"sharedMountPoint"` TlsHostDirectory string `json:"tlsHostDirectory"` TlsContainerDirectory string `json:"tlsContainerDirectory"` - PilotToken string `json:"pilotToken"` } type forgejoConfig struct { diff --git a/templates/traefik/Dockerfile.gotmpl b/templates/traefik/Dockerfile.gotmpl index 9a1b238..90d509a 100644 --- a/templates/traefik/Dockerfile.gotmpl +++ b/templates/traefik/Dockerfile.gotmpl @@ -4,8 +4,6 @@ ADD traefik.yaml /flow/traefik/ ADD entrypoint.sh / -ADD dynamic_dashboard.yaml /tmp/ - RUN chmod +x /entrypoint.sh CMD ["--configfile=/flow/traefik/traefik.yaml"] diff --git a/templates/traefik/dynamic_dashboard.yaml.gotmpl b/templates/traefik/dynamic_dashboard.yaml.gotmpl deleted file mode 100644 index 243e93c..0000000 --- a/templates/traefik/dynamic_dashboard.yaml.gotmpl +++ /dev/null @@ -1,8 +0,0 @@ ---- -http: - routers: - dashboard: - entryPoints: - - "https" - rule: "Host(`{{ .RootDomain }}`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))" - service: "api@internal" diff --git a/templates/traefik/entrypoint.sh.gotmpl b/templates/traefik/entrypoint.sh.gotmpl index b25c5ff..25bd345 100644 --- a/templates/traefik/entrypoint.sh.gotmpl +++ b/templates/traefik/entrypoint.sh.gotmpl @@ -7,10 +7,10 @@ mkdir -p {{ .Traefik.SharedMountPoint }}/dynamic chgrp {{ .FlowGID }} {{ .Traefik.SharedMountPoint }}/dynamic chmod a-rwx,u+rwx,g+rwx {{ .Traefik.SharedMountPoint }}/dynamic -# Move the dashboard config to the new directory. -if [ -f /tmp/dynamic_dashboard.yaml ]; then - mv /tmp/dynamic_dashboard.yaml {{ .Traefik.SharedMountPoint }}/dynamic/dynamic_dashboard.yaml -fi +# Move any dynamic config to the new directory. +for f in $( find /tmp -mindepth 1 -maxdepth 1 -type f -iname '*dynamic*.yaml' -exec basename {} \; ); do + mv -f /tmp/${f} {{ .Traefik.SharedMountPoint }}/dynamic/${f} +done # first arg is `-f` or `--some-option` if [ "${1#-}" != "$1" ]; then diff --git a/templates/traefik/traefik.yaml.gotmpl b/templates/traefik/traefik.yaml.gotmpl index f4f6a37..ec3fc04 100644 --- a/templates/traefik/traefik.yaml.gotmpl +++ b/templates/traefik/traefik.yaml.gotmpl @@ -4,7 +4,7 @@ global: sendAnonymousUsage: {{ .Traefik.SendAnonymousUsage }} api: insecure: false - dashboard: true + dashboard: false debug: false entryPoints: http: @@ -32,5 +32,3 @@ certificatesResolvers: tlsChallenge: {} log: level: "{{ .Traefik.LogLevel }}" -pilot: - token: "{{ .Traefik.PilotToken }}"