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:
@@ -184,14 +184,9 @@ services:
|
|||||||
- PYTHONPATH=/home/kert/src
|
- PYTHONPATH=/home/kert/src
|
||||||
volumes:
|
volumes:
|
||||||
- ./notebooks:/home/kert/notebooks
|
- ./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
|
- ./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
|
- ./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
|
- ./data:/home/kert/data
|
||||||
- ./zotero/data:/home/kert/zotero:ro
|
- ./zotero/data:/home/kert/zotero:ro
|
||||||
- ./src:/home/kert/src:ro
|
- ./src:/home/kert/src:ro
|
||||||
|
|||||||
@@ -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" "theme" false "extra_hosts" (list $domain) "mw" "secure-headers")
|
"dashboard" (dict "port" "80" "extra_hosts" (list $domain) "mw" "secure-headers")
|
||||||
"gitea" (dict "port" "3000" "theme" false "mw" "inject-favicon,secure-headers,rate-limit")
|
"gitea" (dict "port" "3000" "mw" "secure-headers,rate-limit")
|
||||||
"woodpecker-server" (dict "port" "8000" "theme" false "subdomain" "ci" "mw" "inject-favicon,local-only,secure-headers,rate-limit")
|
"woodpecker-server" (dict "port" "8000" "subdomain" "ci" "mw" "local-only,secure-headers,rate-limit")
|
||||||
"notebooks" (dict "port" "2718" "theme" false "mw" "inject-favicon,local-only,secure-headers")
|
"notebooks" (dict "port" "2718" "mw" "local-only,secure-headers")
|
||||||
"zotero" (dict "port" "8080" "theme" false "mw" "inject-favicon,secure-headers")
|
"zotero" (dict "port" "8080" "mw" "secure-headers")
|
||||||
"nessie" (dict "port" "19120" "theme" false "mw" "local-only,infra-headers")
|
"nessie" (dict "port" "19120" "mw" "local-only,infra-headers")
|
||||||
"trino" (dict "port" "8080" "theme" true "mw" "local-only,infra-headers")
|
"trino" (dict "port" "8080" "mw" "local-only,infra-headers")
|
||||||
"polaris" (dict "port" "8181" "theme" false "mw" "local-only,infra-headers")
|
"polaris" (dict "port" "8181" "mw" "local-only,infra-headers")
|
||||||
"grafana" (dict "port" "3000" "theme" true "mw" "local-only,secure-headers")
|
"grafana" (dict "port" "3000" "mw" "local-only,secure-headers")
|
||||||
"prometheus" (dict "port" "9090" "theme" true "mw" "local-only,infra-headers")
|
"prometheus" (dict "port" "9090" "mw" "local-only,infra-headers")
|
||||||
"jaeger" (dict "port" "16686" "theme" true "mw" "local-only,infra-headers")
|
"jaeger" (dict "port" "16686" "mw" "local-only,infra-headers")
|
||||||
"loki" (dict "port" "3100" "theme" false "mw" "local-only,infra-headers")
|
"loki" (dict "port" "3100" "mw" "local-only,infra-headers")
|
||||||
-}}
|
-}}
|
||||||
|
|
||||||
{{/* ── Multi-endpoint services ─────────────────────────────────── */}}
|
{{/* ── Multi-endpoint services ─────────────────────────────────── */}}
|
||||||
{{- $multi := dict
|
{{- $multi := dict
|
||||||
"rustfs-api" (dict "container" "rustfs" "port" "9000" "subdomain" "s3" "theme" false "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" "theme" true "mw" "local-only,infra-headers")
|
"rustfs-console" (dict "container" "rustfs" "port" "9001" "subdomain" "s3console" "mw" "local-only,infra-headers")
|
||||||
-}}
|
-}}
|
||||||
|
|
||||||
http:
|
http:
|
||||||
@@ -68,13 +68,6 @@ http:
|
|||||||
rewrites:
|
rewrites:
|
||||||
- regex: "</head>"
|
- 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>'
|
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 ─────────────────────────────────────── */}}
|
{{/* ── Generated routers ─────────────────────────────────────── */}}
|
||||||
routers:
|
routers:
|
||||||
@@ -84,16 +77,13 @@ http:
|
|||||||
service: {{ $name }}
|
service: {{ $name }}
|
||||||
entryPoints:
|
entryPoints:
|
||||||
- web
|
- web
|
||||||
{{- $mwList := list -}}
|
{{- $mwList := list "inject-throwback" -}}
|
||||||
{{- 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 }}:
|
||||||
@@ -101,16 +91,13 @@ http:
|
|||||||
service: {{ $name }}
|
service: {{ $name }}
|
||||||
entryPoints:
|
entryPoints:
|
||||||
- web
|
- web
|
||||||
{{- $mwList := list -}}
|
{{- $mwList := list "inject-throwback" -}}
|
||||||
{{- 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 }}`)"
|
||||||
|
|||||||
Reference in New Issue
Block a user