Improve GrampsWeb base href patching: find all index.html copies (STI-90)
The previous sed only patched two known paths. Now uses find to discover and patch all index.html files containing <base href="/"> across the entire container, with logging to show which files were patched. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -136,10 +136,14 @@ services:
|
||||
if [ -n "$$GRAMPSWEB_SUBPATH" ] && [ "$$GRAMPSWEB_SUBPATH" != "/" ]; then
|
||||
SUBPATH="$$GRAMPSWEB_SUBPATH"
|
||||
case "$$SUBPATH" in */) ;; *) SUBPATH="$${SUBPATH}/" ;; esac
|
||||
sed -i "s|<base href=\"/\">|<base href=\"$$SUBPATH\">|g" \
|
||||
/app/src/gramps_webapi/static/index.html \
|
||||
/app/static/index.html 2>/dev/null || true
|
||||
echo "Patched <base href> to $$SUBPATH"
|
||||
echo "[grampsweb] Patching <base href> to $$SUBPATH ..."
|
||||
find / -name index.html -path "*/gramps*" -o -name index.html -path "*/static/*" 2>/dev/null | while read f; do
|
||||
if grep -q '<base href="/">' "$$f" 2>/dev/null; then
|
||||
sed -i "s|<base href=\"/\">|<base href=\"$$SUBPATH\">|g" "$$f"
|
||||
echo "[grampsweb] patched: $$f"
|
||||
fi
|
||||
done
|
||||
echo "[grampsweb] Done."
|
||||
fi
|
||||
exec gunicorn -w $${GUNICORN_NUM_WORKERS:-8} -b 0.0.0.0:5000 \
|
||||
gramps_webapi.wsgi:app --timeout $${GUNICORN_TIMEOUT:-120} \
|
||||
|
||||
Reference in New Issue
Block a user