Skip to content

Commit

Permalink
fix: Backend startup with BASE_HREF set
Browse files Browse the repository at this point in the history
Backend does not need BASE_HREF patching and crashes if a BASE_HREF is set in the
entrypoint.sh.

Fixes #632
  • Loading branch information
Julian Merkle committed Jan 30, 2025
1 parent 1d90e65 commit 34e9051
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions backend/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ if [ ! -f "/proc/net/if_inet6" ]; then
fi

# patch the web base href if requested
if [ ! -z $BASE_HREF ]; then
INDEX_HTML=/var/www/web/kitchenowl/index.html
if [ ! -z $BASE_HREF ] && [ -f "$INDEX_HTML" ]; then
if [[ $BASE_HREF == *"#"* ]]; then
echo "$ME: error: BASE_HREF must not contain character '#'" >&2
exit 1
Expand All @@ -20,12 +21,12 @@ if [ ! -z $BASE_HREF ]; then
echo "$ME: error: BASE_HREF must end with a forward slash: /example/" >&2
exit 1
fi
sed -i "s#<base href=\"/\">#<base href=\"${BASE_HREF}\">#g" /var/www/web/kitchenowl/index.html
sed -i "s#<base href=\"/\">#<base href=\"${BASE_HREF}\">#g" "$INDEX_HTML"
fi

mkdir -p $STORAGE_PATH/upload
flask db upgrade
if [ "${SKIP_UPGRADE_DEFAULT_ITEMS}" != "true" ] && [ "${SKIP_UPGRADE_DEFAULT_ITEMS}" != "True" ]; then
python upgrade_default_items.py
fi
uwsgi "$@"
uwsgi "$@"

0 comments on commit 34e9051

Please sign in to comment.