unify favicon+CSS injection: one middleware for all services

Remove inject-favicon middleware and theme flag. Every router now
gets inject-throwback (rewrite-body injects both favicon and CSS).
The CSS is harmless on services with their own themes since selectors
don't match. Remove notebook favicon volume mounts (Traefik handles
it) and fix :ro on marimo config parent mount.
This commit is contained in:
kert
2026-02-28 18:56:39 -05:00
parent 12d57abb02
commit 4c4d975575
2 changed files with 17 additions and 35 deletions

View File

@@ -184,14 +184,9 @@ services:
- PYTHONPATH=/home/kert/src
volumes:
- ./notebooks:/home/kert/notebooks
- ./notebooks/.marimo-config:/home/kert/.config/marimo:ro
- ./notebooks/.marimo-config:/home/kert/.config/marimo
- ./css/marimo.css:/home/kert/.config/marimo/retro-arcade.css:ro
- ./notebooks/home-page-DUMF8ZY4.js:/home/kert/workspace/.venv/lib/python3.13/site-packages/marimo/_static/assets/home-page-DUMF8ZY4.js:ro
- ./css/favicon.svg:/home/kert/workspace/.venv/lib/python3.13/site-packages/marimo/_static/favicon.ico:ro
- ./css/fav32.png:/home/kert/workspace/.venv/lib/python3.13/site-packages/marimo/_static/favicon-32x32.png:ro
- ./css/fav16.png:/home/kert/workspace/.venv/lib/python3.13/site-packages/marimo/_static/favicon-16x16.png:ro
- ./css/logo.png:/home/kert/workspace/.venv/lib/python3.13/site-packages/marimo/_static/logo.png:ro
- ./css/apple-touch-icon.png:/home/kert/workspace/.venv/lib/python3.13/site-packages/marimo/_static/apple-touch-icon.png:ro
- ./data:/home/kert/data
- ./zotero/data:/home/kert/zotero:ro
- ./src:/home/kert/src:ro

View File

@@ -14,24 +14,24 @@
{{/* ── The Reef: one router + one backend per service ───────────── */}}
{{- $reef := dict
"dashboard" (dict "port" "80" "theme" false "extra_hosts" (list $domain) "mw" "secure-headers")
"gitea" (dict "port" "3000" "theme" false "mw" "inject-favicon,secure-headers,rate-limit")
"woodpecker-server" (dict "port" "8000" "theme" false "subdomain" "ci" "mw" "inject-favicon,local-only,secure-headers,rate-limit")
"notebooks" (dict "port" "2718" "theme" false "mw" "inject-favicon,local-only,secure-headers")
"zotero" (dict "port" "8080" "theme" false "mw" "inject-favicon,secure-headers")
"nessie" (dict "port" "19120" "theme" false "mw" "local-only,infra-headers")
"trino" (dict "port" "8080" "theme" true "mw" "local-only,infra-headers")
"polaris" (dict "port" "8181" "theme" false "mw" "local-only,infra-headers")
"grafana" (dict "port" "3000" "theme" true "mw" "local-only,secure-headers")
"prometheus" (dict "port" "9090" "theme" true "mw" "local-only,infra-headers")
"jaeger" (dict "port" "16686" "theme" true "mw" "local-only,infra-headers")
"loki" (dict "port" "3100" "theme" false "mw" "local-only,infra-headers")
"dashboard" (dict "port" "80" "extra_hosts" (list $domain) "mw" "secure-headers")
"gitea" (dict "port" "3000" "mw" "secure-headers,rate-limit")
"woodpecker-server" (dict "port" "8000" "subdomain" "ci" "mw" "local-only,secure-headers,rate-limit")
"notebooks" (dict "port" "2718" "mw" "local-only,secure-headers")
"zotero" (dict "port" "8080" "mw" "secure-headers")
"nessie" (dict "port" "19120" "mw" "local-only,infra-headers")
"trino" (dict "port" "8080" "mw" "local-only,infra-headers")
"polaris" (dict "port" "8181" "mw" "local-only,infra-headers")
"grafana" (dict "port" "3000" "mw" "local-only,secure-headers")
"prometheus" (dict "port" "9090" "mw" "local-only,infra-headers")
"jaeger" (dict "port" "16686" "mw" "local-only,infra-headers")
"loki" (dict "port" "3100" "mw" "local-only,infra-headers")
-}}
{{/* ── Multi-endpoint services ─────────────────────────────────── */}}
{{- $multi := dict
"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" "theme" true "mw" "local-only,infra-headers")
"rustfs-api" (dict "container" "rustfs" "port" "9000" "subdomain" "s3" "mw" "local-only,infra-headers")
"rustfs-console" (dict "container" "rustfs" "port" "9001" "subdomain" "s3console" "mw" "local-only,infra-headers")
-}}
http:
@@ -68,13 +68,6 @@ http:
rewrites:
- regex: "</head>"
replacement: '<link rel="icon" type="image/svg+xml" href="http://{{ $domain }}/favicon.svg"><link rel="stylesheet" type="text/css" href="http://{{ $domain }}/throwback.css"></head>'
inject-favicon:
plugin:
rewrite-body:
lastModified: true
rewrites:
- regex: "</head>"
replacement: '<link rel="icon" type="image/svg+xml" href="http://{{ $domain }}/favicon.svg"></head>'
{{/* ── Generated routers ─────────────────────────────────────── */}}
routers:
@@ -84,16 +77,13 @@ http:
service: {{ $name }}
entryPoints:
- web
{{- $mwList := list -}}
{{- if get $svc "theme" }}{{ $mwList = append $mwList "inject-throwback" }}{{ end -}}
{{- $mwList := list "inject-throwback" -}}
{{- $extra := get $svc "mw" | default "" -}}
{{- if ne $extra "" }}{{ range split "," $extra }}{{ $mwList = append $mwList (trim .) }}{{ end }}{{ end -}}
{{- if $mwList }}
middlewares:
{{- range $mwList }}
- {{ . }}
{{- end }}
{{- end }}
{{- end }}
{{- range $name, $svc := $multi }}
{{ $name }}:
@@ -101,16 +91,13 @@ http:
service: {{ $name }}
entryPoints:
- web
{{- $mwList := list -}}
{{- if get $svc "theme" }}{{ $mwList = append $mwList "inject-throwback" }}{{ end -}}
{{- $mwList := list "inject-throwback" -}}
{{- $extra := get $svc "mw" | default "" -}}
{{- if ne $extra "" }}{{ range split "," $extra }}{{ $mwList = append $mwList (trim .) }}{{ end }}{{ end -}}
{{- if $mwList }}
middlewares:
{{- range $mwList }}
- {{ . }}
{{- end }}
{{- end }}
{{- end }}
traefik-dashboard:
rule: "Host(`traefik.{{ $domain }}`)"