From a202d3d81757e8e73b2cb17b95eeb2e5433a1576 Mon Sep 17 00:00:00 2001 From: stefan Date: Sat, 14 Mar 2026 21:16:22 +0100 Subject: [PATCH] Adjust Caddyfile configuration and prevent Caddy template action conflicts in frontend runtime setup --- config/docker/caddy/web-app/Caddyfile | 4 +--- .../meldestelle-portal/src/jsMain/resources/index.html | 5 +++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/config/docker/caddy/web-app/Caddyfile b/config/docker/caddy/web-app/Caddyfile index d7e13f5e..72bedcd5 100644 --- a/config/docker/caddy/web-app/Caddyfile +++ b/config/docker/caddy/web-app/Caddyfile @@ -1,8 +1,6 @@ { auto_https off - servers { - metrics - } + metrics } :4000 { diff --git a/frontend/shells/meldestelle-portal/src/jsMain/resources/index.html b/frontend/shells/meldestelle-portal/src/jsMain/resources/index.html index d5017e68..e446e356 100644 --- a/frontend/shells/meldestelle-portal/src/jsMain/resources/index.html +++ b/frontend/shells/meldestelle-portal/src/jsMain/resources/index.html @@ -33,11 +33,12 @@ const config = JSON.parse(configJson); const params = new URLSearchParams(window.location.search); + const tmplPrefix = '{' + '{'; // Verhindert, dass Caddy '{{' als Template-Action interpretiert const apiFromCaddy = config.apiBaseUrl; const apiOverride = params.get('apiBaseUrl'); globalThis.API_BASE_URL = apiOverride ? apiOverride.replace(/\/$/, '') - : (apiFromCaddy && !apiFromCaddy.startsWith('{{') + : (apiFromCaddy && !apiFromCaddy.startsWith(tmplPrefix) ? apiFromCaddy.replace(/\/$/, '') : 'http://' + window.location.origin.replace(/\/$/, '')); @@ -45,7 +46,7 @@ const kcOverride = params.get('keycloakUrl'); globalThis.KEYCLOAK_URL = kcOverride ? kcOverride.replace(/\/$/, '') - : (kcFromCaddy && !kcFromCaddy.startsWith('{{') + : (kcFromCaddy && !kcFromCaddy.startsWith(tmplPrefix) ? kcFromCaddy.replace(/\/$/, '') : 'http://' + window.location.hostname + ':8180');