From e093bfc571642342e0c6a32b39a0fccd96ffc9b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20D=C3=BCren?= Date: Tue, 18 Mar 2025 20:03:16 +0100 Subject: [PATCH] Fixed frontend URL error by injecting config.js and runtime-config.js before Caddy starts --- start.sh | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/start.sh b/start.sh index dd8426a..a20dedc 100644 --- a/start.sh +++ b/start.sh @@ -1037,6 +1037,66 @@ echo "==> Created Caddy config at /app/data/caddy/Caddyfile" # Start Caddy server echo "==> Starting Caddy server" + +# First inject the config.js script tags into all HTML files +echo "==> Injecting config.js into web application HTML files" + +# Function to inject the script tag +inject_script_tag() { + file="$1" + if [ -f "$file" ]; then + echo "==> Injecting config.js into $file" + # Make a backup just in case + cp "$file" "${file}.bak" + # Insert the script tag right after the opening head tag + sed -i 's//\n