Merge pull request #2571 from alexbelgium/codex/fix-custom-script-execution-error

wger: scan /home for settings.py and patch database path; bump version and changelog
This commit is contained in:
Alexandre
2026-03-09 20:27:20 +01:00
committed by GitHub
3 changed files with 13 additions and 2 deletions

View File

@@ -1,3 +1,6 @@
## 2.5-dev-3 (2026-03-09)
- Fix startup script database path rewrite by scanning `/home` for matching `settings.py` files and patching all matches.
## 2.5-dev-2 (25-02-2026) ## 2.5-dev-2 (25-02-2026)
- Minor bugs fixed - Minor bugs fixed

View File

@@ -23,5 +23,5 @@ schema:
slug: wger slug: wger
udev: true udev: true
url: https://github.com/alexbelgium/hassio-addons url: https://github.com/alexbelgium/hassio-addons
version: "2.5-dev-2" version: "2.5-dev-3"
webui: "[PROTO:ssl]://[HOST]:[PORT:80]" webui: "[PROTO:ssl]://[HOST]:[PORT:80]"

View File

@@ -4,7 +4,15 @@
# Change database location # # Change database location #
############################ ############################
echo "... set database path" echo "... set database path"
sed -i "s|/home/wger/db/database.sqlite|/data/database.sqlite|g" /home/wger/src/settings.py mapfile -t SETTINGS_FILES < <(grep -rl --include='settings.py' '/home/wger/db/database.sqlite' /home 2> /dev/null || true)
if [ "${#SETTINGS_FILES[@]}" -gt 0 ]; then
for settings_file in "${SETTINGS_FILES[@]}"; do
sed -i "s|/home/wger/db/database.sqlite|/data/database.sqlite|g" "$settings_file"
done
else
bashio::log.warning "Unable to find settings.py containing database path under /home, skipping rewrite"
fi
##################### #####################
# Adapt directories # # Adapt directories #