From 5b7c92848d0564e8727dabb9d95bd881285e2928 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Sun, 5 Apr 2026 23:52:30 +0200 Subject: [PATCH] fix: remove path-rewriting sed that doubled BASE_PATH in tag The second sed matched the just-injected and rewrote it to . Since Vite builds with base: './' (relative paths), the tag alone is sufficient. Co-Authored-By: Claude Opus 4.6 (1M context) --- ui/docker-entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/docker-entrypoint.sh b/ui/docker-entrypoint.sh index 382afd65..ef7cd46d 100644 --- a/ui/docker-entrypoint.sh +++ b/ui/docker-entrypoint.sh @@ -1,6 +1,8 @@ #!/bin/sh # Inject tag into index.html when BASE_PATH is set. # This allows the SPA to be served from a subpath (e.g., /server/). +# Vite builds with base: './' (relative paths), so the tag +# is sufficient — no asset path rewriting needed. # Default: / (standalone mode, no tag needed). BASE_PATH="${BASE_PATH:-/}" @@ -10,11 +12,9 @@ if [ "$BASE_PATH" != "/" ]; then BASE_PATH=$(echo "$BASE_PATH" | sed 's#/*$#/#; s#^/*#/#') INDEX="/usr/share/nginx/html/index.html" - # Inject tag after and rewrite absolute asset paths sed -i "s|||" "$INDEX" - sed -i "s|href=\"/|href=\"${BASE_PATH}|g; s|src=\"/|src=\"${BASE_PATH}|g" "$INDEX" - echo "BASE_PATH set to ${BASE_PATH} — rewrote index.html" + echo "BASE_PATH set to ${BASE_PATH} — injected tag into index.html" fi # Delegate to the default nginx entrypoint (handles envsubst for nginx templates)