diff --git a/compose.yml b/compose.yml index db90232..81b5bba 100644 --- a/compose.yml +++ b/compose.yml @@ -232,6 +232,12 @@ services: echo "[grampsweb] patched JS paths: $$f" fi done + if [ -f /app/static/sw.js ]; then + sed -i "s|createHandlerBoundToURL(\"/index.html\")|createHandlerBoundToURL(\"$${SUBPATH}index.html\")|g" /app/static/sw.js + SUBPATH_BS=$$(echo "$$SUBPATH" | sed "s|/|\\\\\\\\/|g") + sed -i "s|\\^\\\\/api|\\^$${SUBPATH_BS}api|g" /app/static/sw.js + echo "[grampsweb] patched sw.js navigation routes" + fi find /app/static -name '*.css' 2>/dev/null | while read f; do if grep -q '\.\./fonts/' "$$f" 2>/dev/null; then sed -i "s|'../fonts/|'fonts/|g" "$$f" diff --git a/deploy-production/docker-compose.prod.yml b/deploy-production/docker-compose.prod.yml index f6ee61d..32b6501 100644 --- a/deploy-production/docker-compose.prod.yml +++ b/deploy-production/docker-compose.prod.yml @@ -158,6 +158,12 @@ services: echo "[grampsweb] patched JS paths: $$f" fi done + if [ -f /app/static/sw.js ]; then + sed -i "s|createHandlerBoundToURL(\"/index.html\")|createHandlerBoundToURL(\"$${SUBPATH}index.html\")|g" /app/static/sw.js + SUBPATH_BS=$$(echo "$$SUBPATH" | sed "s|/|\\\\\\\\/|g") + sed -i "s|\\^\\\\/api|\\^$${SUBPATH_BS}api|g" /app/static/sw.js + echo "[grampsweb] patched sw.js navigation routes" + fi find /app/static -name '*.css' 2>/dev/null | while read f; do if grep -q '\.\./fonts/' "$$f" 2>/dev/null; then sed -i "s|'../fonts/|'fonts/|g" "$$f"