Compare commits

...

2 Commits

Author SHA1 Message Date
alexbelgium
acfa7ec0fa fix(wger): stop the startup log from naming one database source
wger reads PS_DATABASE_URI before the DJANGO_DB_* variables (settings/main.py
on both 2.6 and 2.7), so a user who sets it through env_vars gets a database
the DJANGO_DB_* defaults have no part in. The informational line asserted
DJANGO_DB_DATABASE unconditionally and printed its value; it now names no
single variable and logs no value, since PS_DATABASE_URI carries credentials.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-05 06:16:32 +02:00
claude[bot]
c30629aa8b fix(wger): declare the database in the environment for wger 2.7
wger 2.7 removed the implicit sqlite fallback from settings/main.py, so
DJANGO_DB_ENGINE / DJANGO_DB_DATABASE are now mandatory and the add-on
aborted at startup with ImproperlyConfigured. Set them explicitly,
keeping the persistent /data/database.sqlite path.

Closes #3043

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-05 03:18:59 +00:00
4 changed files with 24 additions and 2 deletions

View File

@@ -1,3 +1,8 @@
## 2.6.4 (2026-09-05)
- Fix the add-on failing to start with `ImproperlyConfigured: Set the DJANGO_DB_ENGINE environment variable`: wger 2.7 removed the implicit sqlite fallback from its settings, so the database is now declared explicitly through `DJANGO_DB_ENGINE` / `DJANGO_DB_DATABASE`, still pointing at the persistent `/data/database.sqlite`
- Replace the misleading "Unable to find Python settings containing database path" warning with an informational message, as wger no longer hardcodes that path
## 2.6.3 (2026-08-01) ## 2.6.3 (2026-08-01)
- Version renamed from `2.6-dev-3`, which Home Assistant could not order and therefore could not reliably offer as an update: every number of the previous version is kept, as a section of its own. The addon itself and the upstream version it tracks are unchanged - Version renamed from `2.6-dev-3`, which Home Assistant could not order and therefore could not reliably offer as an update: every number of the previous version is kept, as a section of its own. The addon itself and the upstream version it tracks are unchanged

View File

@@ -34,6 +34,18 @@ ENV SYNC_EXERCISES_ON_STARTUP=True \
DJANGO_MEDIA_ROOT="/data/media" \ DJANGO_MEDIA_ROOT="/data/media" \
DJANGO_STATIC_ROOT="/data/static" DJANGO_STATIC_ROOT="/data/static"
# wger 2.7 dropped the implicit sqlite fallback in settings/main.py, so the
# database has to be declared through the environment or Django aborts with
# "Set the DJANGO_DB_ENGINE environment variable".
# USER/PASSWORD/HOST/PORT are ignored by the sqlite backend; they are set
# because wger 2.6 read them without a default, so both base images boot.
ENV DJANGO_DB_ENGINE="django.db.backends.sqlite3" \
DJANGO_DB_DATABASE="/data/database.sqlite" \
DJANGO_DB_USER="" \
DJANGO_DB_PASSWORD="" \
DJANGO_DB_HOST="" \
DJANGO_DB_PORT="5432"
USER root USER root
RUN echo "wger ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \ RUN echo "wger ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \

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.6.3" version: "2.6.4"
webui: "[PROTO:ssl]://[HOST]:[PORT:80]" webui: "[PROTO:ssl]://[HOST]:[PORT:80]"

View File

@@ -62,7 +62,12 @@ if [ "${#SETTINGS_FILES[@]}" -gt 0 ]; then
sed -i "s|/home/wger/db/database.sqlite|/data/database.sqlite|g" "$settings_file" sed -i "s|/home/wger/db/database.sqlite|/data/database.sqlite|g" "$settings_file"
done done
else else
bashio::log.warning "Unable to find Python settings containing database path under /home, skipping rewrite" # Expected on wger >= 2.7: the settings no longer hardcode a database path,
# it comes from the environment instead. Which variable wins is decided by
# wger, not here: PS_DATABASE_URI takes precedence over the DJANGO_DB_*
# defaults set in the Dockerfile, so no single one is named, and no value
# is logged (PS_DATABASE_URI carries credentials).
bashio::log.info "Settings do not hardcode a database path, the database is taken from the environment"
fi fi
##################### #####################