wger: let root use sudo so cont-init can run commands as wger (#3123) (#3132)

/etc/sudoers is created before sudo is installed and holds only the wger
rule, so dpkg keeps it and parks the default (with the root rule) as
sudoers.dpkg-new. The cont-init scripts run as root and call sudo -u wger,
which failed with 'root is not in the sudoers file', breaking the PowerSync
SQLite import and JWT key generation.

Co-authored-by: BirdNET-Go Addon Builder <addon-builder@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-10-19 19:21:19 +03:00
1 parent c005f7b8fd
commit 24cd2a2108
3 files changed
+9 -4

No files matched your search

+4
View File
@@ -1,3 +1,7 @@
## 2.8.0-dev.1.2 (2026-10-19)
- Fix `root is not in the sudoers file` at startup, which made the PowerSync SQLite import fail (and wger refuse to start), and stopped the JWT keys from being generated. The image's `/etc/sudoers` only allowed the `wger` user; it now allows root too (#3123).
## 2.8.0-dev.1.1 (2026-10-16)
- BACKUP FIRST
+4 -3
View File
@@ -112,9 +112,10 @@ ENV PACKAGES="sudo nginx"
COPY ha_autoapps.sh /ha_autoapps.sh
RUN chmod 744 /ha_autoapps.sh && /ha_autoapps.sh "$PACKAGES" || true && rm /ha_autoapps.sh
# Ensure sudoers entry exists after sudo package installation
# (installing sudo may overwrite /etc/sudoers with its default conffile)
RUN echo "wger ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# /etc/sudoers was created above holding only the wger rule, so installing sudo keeps it
# and parks its default (with the root rule) as sudoers.dpkg-new. The cont-init scripts
# run as root and call "sudo -u wger", which fails without a root rule.
RUN echo "root ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
################
# 4 Entrypoint #
+1 -1
View File
@@ -27,5 +27,5 @@ schema:
slug: wger
udev: true
url: https://github.com/alexbelgium/hassio-addons
version: "2.8.0-dev.1.1"
version: "2.8.0-dev.1.2"
webui: "[PROTO:ssl]://[HOST]:[PORT:80]"