Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Backend startup with BASE_HREF set #631

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 "$@"