mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 20:15:41 +01:00
entrypoint fixes
This commit is contained in:
parent
b518b15559
commit
f8aa276c36
1 changed files with 13 additions and 0 deletions
|
|
@ -1,6 +1,19 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# replace /__ENTRYPOINT__ with the runtime-configured entrypoint
|
# replace /__ENTRYPOINT__ with the runtime-configured entrypoint
|
||||||
|
if [ "$ALLOWED_FRAME_URLS" = "" ]; then
|
||||||
|
# root entrypoint is handled differently from non-root, in particular
|
||||||
|
# - basePath="" rather than "/"
|
||||||
|
# - an extra redirect is added /x/ => /x -- but with root that would be // => / which is invalid
|
||||||
|
cp .next/routes-manifest.json .next/routes-manifest.json.in
|
||||||
|
jq -rc '.basePath = ""
|
||||||
|
| .redirects = [
|
||||||
|
.redirects
|
||||||
|
| .[]
|
||||||
|
| select((.source == "/__ENTRYPOINT__/" and .destination == "/__ENTRYPOINT__") | not)
|
||||||
|
]' .next/routes-manifest.json.in > .next/routes-manifest.json
|
||||||
|
fi
|
||||||
|
|
||||||
escaped_frame_urls=$(echo "$ALLOWED_FRAME_URLS" | sed 's/\//\\\//g')
|
escaped_frame_urls=$(echo "$ALLOWED_FRAME_URLS" | sed 's/\//\\\//g')
|
||||||
|
|
||||||
echo "Replacing /__ENTRYPOINT__ in all .next file..."
|
echo "Replacing /__ENTRYPOINT__ in all .next file..."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue