Fix share router name

This commit is contained in:
Daniel Berteaud 2024-02-26 22:32:57 +01:00
parent 91481f48ea
commit 2e5f5b6cc5
3 changed files with 2 additions and 5 deletions

View File

@ -89,10 +89,9 @@ job "immich" {
"traefik.http.routers.immich.middlewares=security-headers@file,forward-proto@file,inflight-std@file,hsts@file,compression@file,csp-immich",
"traefik.http.routers.share.rule=Host(`immich.example.org`) && PathRegexp(`^/(share/|_app/immutable/|custom\\.css|api/(asset|server-info)/.*)`)",
"traefik.enable=true",
"traefik.http.routers.immich-share.entrypoints=https",
"traefik.http.routers.immich-share.rule=Host(`immich.example.org`) && PathRegexp(`^/(share/|_app/immutable/|custom\\.css|api/(asset|server-info)/.*)`)",
"traefik.http.middlewares.csp-immich-share.headers.contentsecuritypolicy=connect-src 'self' https://maputnik.github.io https://*.cofractal.com https://fonts.openmaptiles.org;default-src 'self';font-src 'self' data:;img-src 'self' data: blob:;script-src 'self' 'unsafe-inline' 'unsafe-eval';style-src 'self' 'unsafe-inline';",
"traefik.http.routers.immich-share.middlewares=security-headers@file,forward-proto@file,inflight-std@file,hsts@file,compression@file,csp-immich-share",

View File

@ -35,8 +35,6 @@ job "[[ .instance ]]" {
tags = [
[[ template "common/traefik_tags" $c ]]
[[- $s := merge $c.share $c ]]
"[[ $s.traefik.instance ]].http.routers.[[ $s.traefik.router ]].rule=Host(`[[ (urlParse $s.public_url).Hostname ]]`) && PathRegexp(`^[[ (urlParse $s.public_url).Path ]]/(share/|_app/immutable/|custom\\.css|api/(asset|server-info)/.*)`)",
[[ template "common/traefik_tags" $s ]]
]
}

View File

@ -66,7 +66,7 @@ immich:
# Use distinct Traefik settings for /share. This can be used for example to restrict the main app to trusted IP but allow /share from anywhere
share:
traefik:
auto_rule: false
rule: 'Host(`[[ (urlParse .immich.server.public_url).Hostname ]]`) && PathRegexp(`^[[ (urlParse .immich.server.public_url).Path ]]/(share/|_app/immutable/|custom\\.css|api/(asset|server-info)/.*)`)'
router: share
# Volumes used for data storage