From 34e90517aed4e6dcca6bf3ec81fd68125325429d Mon Sep 17 00:00:00 2001 From: Julian Merkle Date: Thu, 30 Jan 2025 16:30:54 +0100 Subject: [PATCH] fix: Backend startup with BASE_HREF set Backend does not need BASE_HREF patching and crashes if a BASE_HREF is set in the entrypoint.sh. Fixes #632 --- backend/entrypoint.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/entrypoint.sh b/backend/entrypoint.sh index 12a29ae7..91292208 100755 --- a/backend/entrypoint.sh +++ b/backend/entrypoint.sh @@ -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 @@ -20,7 +21,7 @@ if [ ! -z $BASE_HREF ]; then echo "$ME: error: BASE_HREF must end with a forward slash: /example/" >&2 exit 1 fi - sed -i "s###g" /var/www/web/kitchenowl/index.html + sed -i "s###g" "$INDEX_HTML" fi mkdir -p $STORAGE_PATH/upload @@ -28,4 +29,4 @@ flask db upgrade if [ "${SKIP_UPGRADE_DEFAULT_ITEMS}" != "true" ] && [ "${SKIP_UPGRADE_DEFAULT_ITEMS}" != "True" ]; then python upgrade_default_items.py fi -uwsgi "$@" \ No newline at end of file +uwsgi "$@"