restore theme flag: only apply rewrite-body to HTML services

Expand theme: true to all web-UI services (dashboard, gitea,
woodpecker, notebooks, zotero) so they get favicon+CSS injection.
API-only services (nessie, polaris, loki, rustfs-api) keep
theme: false to avoid corrupting non-HTML responses.
This commit is contained in:
kert
2026-02-28 18:59:08 -05:00
parent 4c4d975575
commit caccae3e64

View File

@@ -14,24 +14,24 @@
{{/* ── The Reef: one router + one backend per service ───────────── */}} {{/* ── The Reef: one router + one backend per service ───────────── */}}
{{- $reef := dict {{- $reef := dict
"dashboard" (dict "port" "80" "extra_hosts" (list $domain) "mw" "secure-headers") "dashboard" (dict "port" "80" "theme" true "extra_hosts" (list $domain) "mw" "secure-headers")
"gitea" (dict "port" "3000" "mw" "secure-headers,rate-limit") "gitea" (dict "port" "3000" "theme" true "mw" "secure-headers,rate-limit")
"woodpecker-server" (dict "port" "8000" "subdomain" "ci" "mw" "local-only,secure-headers,rate-limit") "woodpecker-server" (dict "port" "8000" "theme" true "subdomain" "ci" "mw" "local-only,secure-headers,rate-limit")
"notebooks" (dict "port" "2718" "mw" "local-only,secure-headers") "notebooks" (dict "port" "2718" "theme" true "mw" "local-only,secure-headers")
"zotero" (dict "port" "8080" "mw" "secure-headers") "zotero" (dict "port" "8080" "theme" true "mw" "secure-headers")
"nessie" (dict "port" "19120" "mw" "local-only,infra-headers") "nessie" (dict "port" "19120" "theme" false "mw" "local-only,infra-headers")
"trino" (dict "port" "8080" "mw" "local-only,infra-headers") "trino" (dict "port" "8080" "theme" true "mw" "local-only,infra-headers")
"polaris" (dict "port" "8181" "mw" "local-only,infra-headers") "polaris" (dict "port" "8181" "theme" false "mw" "local-only,infra-headers")
"grafana" (dict "port" "3000" "mw" "local-only,secure-headers") "grafana" (dict "port" "3000" "theme" true "mw" "local-only,secure-headers")
"prometheus" (dict "port" "9090" "mw" "local-only,infra-headers") "prometheus" (dict "port" "9090" "theme" true "mw" "local-only,infra-headers")
"jaeger" (dict "port" "16686" "mw" "local-only,infra-headers") "jaeger" (dict "port" "16686" "theme" true "mw" "local-only,infra-headers")
"loki" (dict "port" "3100" "mw" "local-only,infra-headers") "loki" (dict "port" "3100" "theme" false "mw" "local-only,infra-headers")
-}} -}}
{{/* ── Multi-endpoint services ─────────────────────────────────── */}} {{/* ── Multi-endpoint services ─────────────────────────────────── */}}
{{- $multi := dict {{- $multi := dict
"rustfs-api" (dict "container" "rustfs" "port" "9000" "subdomain" "s3" "mw" "local-only,infra-headers") "rustfs-api" (dict "container" "rustfs" "port" "9000" "subdomain" "s3" "theme" false "mw" "local-only,infra-headers")
"rustfs-console" (dict "container" "rustfs" "port" "9001" "subdomain" "s3console" "mw" "local-only,infra-headers") "rustfs-console" (dict "container" "rustfs" "port" "9001" "subdomain" "s3console" "theme" true "mw" "local-only,infra-headers")
-}} -}}
http: http:
@@ -77,13 +77,16 @@ http:
service: {{ $name }} service: {{ $name }}
entryPoints: entryPoints:
- web - web
{{- $mwList := list "inject-throwback" -}} {{- $mwList := list -}}
{{- if get $svc "theme" }}{{ $mwList = append $mwList "inject-throwback" }}{{ end -}}
{{- $extra := get $svc "mw" | default "" -}} {{- $extra := get $svc "mw" | default "" -}}
{{- if ne $extra "" }}{{ range split "," $extra }}{{ $mwList = append $mwList (trim .) }}{{ end }}{{ end -}} {{- if ne $extra "" }}{{ range split "," $extra }}{{ $mwList = append $mwList (trim .) }}{{ end }}{{ end -}}
{{- if $mwList }}
middlewares: middlewares:
{{- range $mwList }} {{- range $mwList }}
- {{ . }} - {{ . }}
{{- end }} {{- end }}
{{- end }}
{{- end }} {{- end }}
{{- range $name, $svc := $multi }} {{- range $name, $svc := $multi }}
{{ $name }}: {{ $name }}:
@@ -91,13 +94,16 @@ http:
service: {{ $name }} service: {{ $name }}
entryPoints: entryPoints:
- web - web
{{- $mwList := list "inject-throwback" -}} {{- $mwList := list -}}
{{- if get $svc "theme" }}{{ $mwList = append $mwList "inject-throwback" }}{{ end -}}
{{- $extra := get $svc "mw" | default "" -}} {{- $extra := get $svc "mw" | default "" -}}
{{- if ne $extra "" }}{{ range split "," $extra }}{{ $mwList = append $mwList (trim .) }}{{ end }}{{ end -}} {{- if ne $extra "" }}{{ range split "," $extra }}{{ $mwList = append $mwList (trim .) }}{{ end }}{{ end -}}
{{- if $mwList }}
middlewares: middlewares:
{{- range $mwList }} {{- range $mwList }}
- {{ . }} - {{ . }}
{{- end }} {{- end }}
{{- end }}
{{- end }} {{- end }}
traefik-dashboard: traefik-dashboard:
rule: "Host(`traefik.{{ $domain }}`)" rule: "Host(`traefik.{{ $domain }}`)"