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 TomBursch#632
  • Loading branch information
Julian Merkle committed Jan 22, 2025
1 parent 1d90e65 commit 776e28e
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions backend/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,9 @@ if [ ! -f "/proc/net/if_inet6" ]; then
sed -i 's/\[::\]//g' /usr/src/kitchenowl/wsgi.ini
fi

# patch the web base href if requested
if [ ! -z $BASE_HREF ]; then
if [[ $BASE_HREF == *"#"* ]]; then
echo "$ME: error: BASE_HREF must not contain character '#'" >&2
exit 1
elif [[ $BASE_HREF != "/"* ]]; then
echo "$ME: error: BASE_HREF must begin with a forward slash: /example/" >&2
exit 1
elif [[ $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
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 776e28e

Please sign in to comment.