diff --git a/compose.yml b/compose.yml index b2fd8b2..b629cf1 100644 --- a/compose.yml +++ b/compose.yml @@ -209,12 +209,15 @@ services: - | if [ -n "$$GRAMPSWEB_SUBPATH" ] && [ "$$GRAMPSWEB_SUBPATH" != "/" ]; then SUBPATH="$$GRAMPSWEB_SUBPATH" - # Ensure trailing slash for base href case "$$SUBPATH" in */) ;; *) SUBPATH="$${SUBPATH}/" ;; esac - sed -i "s|||g" \ - /app/src/gramps_webapi/static/index.html \ - /app/static/index.html 2>/dev/null || true - echo "Patched to $$SUBPATH" + echo "[grampsweb] Patching to $$SUBPATH ..." + find / -name index.html -path "*/gramps*" -o -name index.html -path "*/static/*" 2>/dev/null | while read f; do + if grep -q '' "$$f" 2>/dev/null; then + sed -i "s|||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} \ diff --git a/deploy-production/docker-compose.prod.yml b/deploy-production/docker-compose.prod.yml index 173a234..fe4b69a 100644 --- a/deploy-production/docker-compose.prod.yml +++ b/deploy-production/docker-compose.prod.yml @@ -136,10 +136,14 @@ services: if [ -n "$$GRAMPSWEB_SUBPATH" ] && [ "$$GRAMPSWEB_SUBPATH" != "/" ]; then SUBPATH="$$GRAMPSWEB_SUBPATH" case "$$SUBPATH" in */) ;; *) SUBPATH="$${SUBPATH}/" ;; esac - sed -i "s|||g" \ - /app/src/gramps_webapi/static/index.html \ - /app/static/index.html 2>/dev/null || true - echo "Patched to $$SUBPATH" + echo "[grampsweb] Patching to $$SUBPATH ..." + find / -name index.html -path "*/gramps*" -o -name index.html -path "*/static/*" 2>/dev/null | while read f; do + if grep -q '' "$$f" 2>/dev/null; then + sed -i "s|||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} \