diff --git a/README.md b/README.md index dcb2b19..8e702b6 100644 --- a/README.md +++ b/README.md @@ -1112,7 +1112,7 @@ All specializations should be added to `*.override.*` files. - see [`.github/workflows/config/options.conf`](.github/workflows/config/options.conf) for an example - `static.override.env` may store additional service-specific constants - similar idea as its global counterpart `static.global.env` - - see [`.archive/nocodb/static.env`](.archive/nocodb/static.env) for an example + - see [`gitea/static.env`](gitea/static.env) for an example - `dynamic.override.env.sh` may generate additional service-specific evironment variables - similar idea as its global counterpart `dynamic.global.env.sh` - see [`pihole/dynamic.env.sh`](pihole/dynamic.env.sh) for an example diff --git a/airdcpp/docker-compose.labels.yml b/airdcpp/docker-compose.labels.yml index 483f1e0..20fabda 100644 --- a/airdcpp/docker-compose.labels.yml +++ b/airdcpp/docker-compose.labels.yml @@ -2,8 +2,8 @@ services: airdcpp: labels: traefik.enable: true - traefik.http.middlewares.strip-airdcpp-prefix.stripPrefix.prefixes: "/airdcpp" - traefik.http.routers.airdcpp.rule: PathPrefix(`/airdcpp`) + traefik.http.middlewares.strip-airdcpp-prefix.stripPrefix.prefixes: "/${AIRDCPP_BASE_PATH:?}" + traefik.http.routers.airdcpp.rule: PathPrefix(`/${AIRDCPP_BASE_PATH:?}`) traefik.http.services.airdcpp.loadBalancer.server.port: 5600 traefik.http.routers.airdcpp.entryPoints: wan-https traefik.http.routers.airdcpp.middlewares: strip-airdcpp-prefix diff --git a/airdcpp/static.env b/airdcpp/static.env new file mode 100755 index 0000000..6076e5a --- /dev/null +++ b/airdcpp/static.env @@ -0,0 +1 @@ +AIRDCPP_BASE_PATH=airdcpp diff --git a/gitea/dynamic.env.sh b/gitea/dynamic.env.sh deleted file mode 100755 index adeaa37..0000000 --- a/gitea/dynamic.env.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -echo 'GITEA_BASE_PATH=gitea' diff --git a/gitea/static.env b/gitea/static.env new file mode 100755 index 0000000..7660e43 --- /dev/null +++ b/gitea/static.env @@ -0,0 +1 @@ +GITEA_BASE_PATH=gitea diff --git a/indexarr/dynamic.env.sh b/indexarr/dynamic.env.sh deleted file mode 100755 index bce7f8b..0000000 --- a/indexarr/dynamic.env.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -echo 'JACKETT_BASE_PATH=jackett' diff --git a/indexarr/static.env b/indexarr/static.env new file mode 100755 index 0000000..6a232d5 --- /dev/null +++ b/indexarr/static.env @@ -0,0 +1 @@ +JACKETT_BASE_PATH=jackett diff --git a/monitarr/dynamic.env.sh b/monitarr/dynamic.env.sh deleted file mode 100755 index 5e4224e..0000000 --- a/monitarr/dynamic.env.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -echo 'LIDARR_BASE_PATH=lidarr' -echo 'RADARR_BASE_PATH=radarr' -echo 'SONARR_BASE_PATH=sonarr' diff --git a/monitarr/static.env b/monitarr/static.env new file mode 100755 index 0000000..c2fb1cd --- /dev/null +++ b/monitarr/static.env @@ -0,0 +1,3 @@ +LIDARR_BASE_PATH=lidarr +RADARR_BASE_PATH=radarr +SONARR_BASE_PATH=sonarr diff --git a/navidrome/docker-compose.labels.yml b/navidrome/docker-compose.labels.yml index 14c7270..fc9b4b8 100644 --- a/navidrome/docker-compose.labels.yml +++ b/navidrome/docker-compose.labels.yml @@ -2,5 +2,5 @@ services: navidrome: labels: traefik.enable: true - traefik.http.routers.navidrome.rule: PathPrefix(`/navidrome`) + traefik.http.routers.navidrome.rule: PathPrefix(`/${NAVIDROME_BASE_PATH:?}`) traefik.http.routers.navidrome.entryPoints: wan-https diff --git a/navidrome/docker-compose.yml b/navidrome/docker-compose.yml index 91fdcb7..aaa8c8c 100644 --- a/navidrome/docker-compose.yml +++ b/navidrome/docker-compose.yml @@ -20,7 +20,7 @@ services: - ./data/navidrome/data:/data:rw environment: - ND_BASEURL: /navidrome + ND_BASEURL: "/${NAVIDROME_BASE_PATH:?}" ND_LOGLEVEL: info ND_SCANSCHEDULE: 30m ND_SESSIONTIMEOUT: 8h diff --git a/navidrome/static.env b/navidrome/static.env new file mode 100755 index 0000000..51aaca6 --- /dev/null +++ b/navidrome/static.env @@ -0,0 +1 @@ +NAVIDROME_BASE_PATH=navidrome diff --git a/nextcloud/docker-compose.labels.yml b/nextcloud/docker-compose.labels.yml index 7e3d92c..780ec2a 100644 --- a/nextcloud/docker-compose.labels.yml +++ b/nextcloud/docker-compose.labels.yml @@ -2,11 +2,11 @@ services: nextcloud: labels: traefik.enable: true - traefik.http.middlewares.strip-nextcloud-prefix.stripPrefix.prefixes: "/nextcloud" + traefik.http.middlewares.strip-nextcloud-prefix.stripPrefix.prefixes: "/${NEXTCLOUD_BASE_PATH:?}" traefik.http.middlewares.nextcloud-caldav-redirect.redirectRegex.permanent: true - traefik.http.middlewares.nextcloud-caldav-redirect.redirectRegex.regex: "^https://(.+)/nextcloud/.well-known/(card|cal)dav" - traefik.http.middlewares.nextcloud-caldav-redirect.redirectRegex.replacement: "https://$${1}/nextcloud/remote.php/dav/" - traefik.http.routers.nextcloud.rule: PathPrefix(`/nextcloud`) + traefik.http.middlewares.nextcloud-caldav-redirect.redirectRegex.regex: "^https://(.+)/${NEXTCLOUD_BASE_PATH:?}/.well-known/(card|cal)dav" + traefik.http.middlewares.nextcloud-caldav-redirect.redirectRegex.replacement: "https://$${1}/${NEXTCLOUD_BASE_PATH:?}/remote.php/dav/" + traefik.http.routers.nextcloud.rule: PathPrefix(`/${NEXTCLOUD_BASE_PATH:?}`) traefik.http.routers.nextcloud.entryPoints: wan-https # NOTE: Order of middlewares matters: redirect must be performed before stripping traefik.http.routers.nextcloud.middlewares: nextcloud-caldav-redirect@docker,strip-nextcloud-prefix diff --git a/nextcloud/static.env b/nextcloud/static.env new file mode 100755 index 0000000..14c99bb --- /dev/null +++ b/nextcloud/static.env @@ -0,0 +1 @@ +NEXTCLOUD_BASE_PATH=nextcloud diff --git a/pihole/docker-compose.labels.yml b/pihole/docker-compose.labels.yml index c30e703..b326683 100644 --- a/pihole/docker-compose.labels.yml +++ b/pihole/docker-compose.labels.yml @@ -2,9 +2,12 @@ services: pihole: labels: traefik.enable: true - traefik.http.middlewares.strip-pihole-prefix.stripPrefix.prefixes: "/pihole" + traefik.http.middlewares.strip-pihole-prefix.stripPrefix.prefixes: "/${PIHOLE_BASE_PATH:?}" traefik.http.middlewares.add-admin-prefix.addPrefix.prefix: "/admin" - traefik.http.routers.pihole.rule: PathPrefix(`/pihole`) + traefik.http.middlewares.pihole-postlogin-redirect.redirectRegex.permanent: true + traefik.http.middlewares.pihole-postlogin-redirect.redirectRegex.regex: "^https://(.+)/admin/$" + traefik.http.middlewares.pihole-postlogin-redirect.redirectRegex.replacement: "https://$${1}/${PIHOLE_BASE_PATH:?}/" + traefik.http.routers.pihole.rule: PathPrefix(`/${PIHOLE_BASE_PATH:?}`) traefik.http.services.pihole.loadBalancer.server.port: 80 traefik.http.routers.pihole.entryPoints: lan-https - traefik.http.routers.pihole.middlewares: strip-pihole-prefix, add-admin-prefix + traefik.http.routers.pihole.middlewares: pihole-postlogin-redirect@docker, strip-pihole-prefix, add-admin-prefix diff --git a/pihole/static.env b/pihole/static.env new file mode 100755 index 0000000..69f5ad8 --- /dev/null +++ b/pihole/static.env @@ -0,0 +1 @@ +PIHOLE_BASE_PATH=pihole diff --git a/qbittorrent/docker-compose.labels.yml b/qbittorrent/docker-compose.labels.yml index eaddb87..b378a11 100644 --- a/qbittorrent/docker-compose.labels.yml +++ b/qbittorrent/docker-compose.labels.yml @@ -2,8 +2,8 @@ services: qbittorrent: labels: traefik.enable: true - traefik.http.middlewares.strip-qbittorrent-prefix.stripPrefix.prefixes: "/qbittorrent" - traefik.http.routers.qbittorrent.rule: PathPrefix(`/qbittorrent`) + traefik.http.middlewares.strip-qbittorrent-prefix.stripPrefix.prefixes: "/${QBITTORRENT_BASE_PATH:?}" + traefik.http.routers.qbittorrent.rule: PathPrefix(`/${QBITTORRENT_BASE_PATH:?}`) traefik.http.services.qbittorrent.loadBalancer.server.port: 8080 traefik.http.routers.qbittorrent.entryPoints: wan-https traefik.http.routers.qbittorrent.middlewares: strip-qbittorrent-prefix diff --git a/qbittorrent/static.env b/qbittorrent/static.env new file mode 100755 index 0000000..810c948 --- /dev/null +++ b/qbittorrent/static.env @@ -0,0 +1 @@ +QBITTORRENT_BASE_PATH=qbittorrent diff --git a/tang/docker-compose.labels.yml b/tang/docker-compose.labels.yml index b91d218..b4bb419 100644 --- a/tang/docker-compose.labels.yml +++ b/tang/docker-compose.labels.yml @@ -2,7 +2,7 @@ services: tang: labels: traefik.enable: true - traefik.http.middlewares.strip-tang-prefix.stripPrefix.prefixes: "/tang" - traefik.http.routers.tang.rule: PathPrefix(`/tang`) + traefik.http.middlewares.strip-tang-prefix.stripPrefix.prefixes: "/${TANG_BASE_PATH:?}" + traefik.http.routers.tang.rule: PathPrefix(`/${TANG_BASE_PATH:?}`) traefik.http.routers.tang.entryPoints: lan-http traefik.http.routers.tang.middlewares: strip-tang-prefix diff --git a/tang/static.env b/tang/static.env new file mode 100755 index 0000000..a530b9a --- /dev/null +++ b/tang/static.env @@ -0,0 +1 @@ +TANG_BASE_PATH=gitea diff --git a/teslamate/docker-compose.labels.yml b/teslamate/docker-compose.labels.yml index a6cb8c4..adeae2f 100644 --- a/teslamate/docker-compose.labels.yml +++ b/teslamate/docker-compose.labels.yml @@ -2,12 +2,12 @@ services: teslamate: labels: traefik.enable: true - traefik.http.middlewares.strip-teslamate-prefix.stripPrefix.prefixes: "/teslamate" + traefik.http.middlewares.strip-teslamate-prefix.stripPrefix.prefixes: "/${TESLAMATE_BASE_PATH:?}" traefik.http.middlewares.only-https-forwarded-proto.headers.customRequestHeaders.X-Forwarded-Proto: https traefik.http.middlewares.only-wss-forwarded-proto.headers.customRequestHeaders.X-Forwarded-Proto: wss - traefik.http.routers.teslamate.rule: PathPrefix(`/teslamate`) + traefik.http.routers.teslamate.rule: PathPrefix(`/${TESLAMATE_BASE_PATH:?}`) traefik.http.routers.teslamate.entryPoints: lan-https traefik.http.routers.teslamate.middlewares: strip-teslamate-prefix, only-https-forwarded-proto - traefik.http.routers.teslamate-websocket.rule: PathPrefix(`/teslamate/live/websocket`) + traefik.http.routers.teslamate-websocket.rule: PathPrefix(`/${TESLAMATE_BASE_PATH:?}/live/websocket`) traefik.http.routers.teslamate-websocket.entryPoints: lan-https traefik.http.routers.teslamate-websocket.middlewares: strip-teslamate-prefix, only-wss-forwarded-proto diff --git a/teslamate/docker-compose.yml b/teslamate/docker-compose.yml index 1ec9c9c..5fd2d43 100644 --- a/teslamate/docker-compose.yml +++ b/teslamate/docker-compose.yml @@ -81,7 +81,7 @@ services: DATABASE_NAME: teslamate DATABASE_HOST: db MQTT_HOST: mqtt - URL_PATH: '/teslamate' + URL_PATH: '/${TESLAMATE_BASE_PATH:?}' TZ: ${TZ:?} healthcheck: diff --git a/teslamate/static.env b/teslamate/static.env new file mode 100755 index 0000000..c0482b3 --- /dev/null +++ b/teslamate/static.env @@ -0,0 +1 @@ +TESLAMATE_BASE_PATH=teslamate