From 9263222927115a5ce635b87daae73acb1ae4b149 Mon Sep 17 00:00:00 2001 From: "azykov@mail.ru" Date: Sun, 9 Aug 2026 20:59:43 +0300 Subject: [PATCH] fix for davical /server url path --- .../base/apps/davical/helmrelease-davical.yaml | 14 ++++++++++++-- clusters/base/apps/davical/kustomization.yaml | 1 - clusters/base/apps/davical/middleware.yaml | 9 --------- 3 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 clusters/base/apps/davical/middleware.yaml diff --git a/clusters/base/apps/davical/helmrelease-davical.yaml b/clusters/base/apps/davical/helmrelease-davical.yaml index 03664c0..88f01ea 100644 --- a/clusters/base/apps/davical/helmrelease-davical.yaml +++ b/clusters/base/apps/davical/helmrelease-davical.yaml @@ -27,6 +27,14 @@ spec: if [ ! -f /mnt/config-pvc/davical.php ]; then cp -r /config/. /mnt/config-pvc/ fi + # Apache's SCRIPT_NAME (and DAViCal's base_url derived from it) + # only reflects the /server prefix if Apache itself resolves + # that prefix - Traefik forwards the path unstripped. Add an + # Alias so /server/* maps to the app root; idempotent so it + # self-heals if apache.conf predates this fix. + if ! grep -q '^\s*Alias /server ' /mnt/config-pvc/apache.conf; then + sed -i '/^\s*DocumentRoot \/usr\/share\/davical\/htdocs/a\ Alias /server /usr/share/davical/htdocs' /mnt/config-pvc/apache.conf + fi containers: app: image: @@ -78,8 +86,10 @@ spec: # requests/owns the Certificate for c.aggtaa.com -> radicale-tls. # A second Ingress with the annotation would create a competing # Certificate for the same host/secret. - annotations: - traefik.ingress.kubernetes.io/router.middlewares: pim-davical-stripprefix@kubernetescrd + # + # No stripPrefix middleware either: Apache needs to see the /server + # prefix itself (via the Alias added in the seed-config initContainer) + # so that DAViCal's self-referential links come out correct. hosts: - host: c.aggtaa.com paths: diff --git a/clusters/base/apps/davical/kustomization.yaml b/clusters/base/apps/davical/kustomization.yaml index 7c12d0f..25d792e 100644 --- a/clusters/base/apps/davical/kustomization.yaml +++ b/clusters/base/apps/davical/kustomization.yaml @@ -3,6 +3,5 @@ kind: Kustomization resources: - helmrepository.yaml - secret.enc.yaml - - middleware.yaml - helmrelease-postgres.yaml - helmrelease-davical.yaml diff --git a/clusters/base/apps/davical/middleware.yaml b/clusters/base/apps/davical/middleware.yaml deleted file mode 100644 index 02b8276..0000000 --- a/clusters/base/apps/davical/middleware.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: traefik.io/v1alpha1 -kind: Middleware -metadata: - name: davical-stripprefix - namespace: pim -spec: - stripPrefix: - prefixes: - - /server