diff --git a/birdnet-pi/CHANGELOG.md b/birdnet-pi/CHANGELOG.md index 535298e0fc..f878994446 100644 --- a/birdnet-pi/CHANGELOG.md +++ b/birdnet-pi/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2026.07.10-1 (10-07-2026) +- Fix standalone (no-Supervisor) mode: strip `sudo` from BirdNET-Pi scripts at build time (the previous hook ran before the repo was cloned, so `sudo` remained and broke service/WebUI actions run by non-sudoers users such as `caddy`/`abc`) +- Ensure `/run/php` exists before starting PHP-FPM so the WebUI starts even when `/run` is a fresh tmpfs ## 2026.07.10 (10-07-2026) - Minor bugs fixed ## 2026.06.01 (19-06-2026) diff --git a/birdnet-pi/Dockerfile b/birdnet-pi/Dockerfile index 44d1703689..0c5511fb0b 100644 --- a/birdnet-pi/Dockerfile +++ b/birdnet-pi/Dockerfile @@ -74,17 +74,6 @@ RUN \ curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/BirdNET-Pi/main/newinstaller.sh" -o /newinstaller.sh && \ chmod 777 /newinstaller.sh && \ \ - # Use installer to modify other scripts - ####################################### - # Define file - sed -i "1a /./newinstallermod.sh" /newinstaller.sh && \ - echo '#!/bin/bash' >> /newinstallermod.sh && \ - # Remove all instances of sudo from all other scripts - echo 'for file in $(grep -srl "sudo" $HOME/BirdNET-Pi/scripts); do sed -i "s|sudo ||" "$file"; done' >> /newinstallermod.sh && \ - echo 'for file in $(grep -srl "my_dir" $HOME/BirdNET-Pi/scripts); do sed -i "s|\$my_dir|/config|" "$file"; done' >> /newinstallermod.sh && \ - # Set permission - chmod +x /newinstallermod.sh && \ - \ # Modify installer ################## # Use my repository @@ -110,6 +99,16 @@ RUN \ # Execute installer /./newinstaller.sh && \ \ + # Remove sudo from the installed BirdNET-Pi scripts. + # Inside the container everything already runs with the privileges it needs + # (root during init, user "pi" for the services), so "sudo" is never required. + # Leaving it in breaks any script invoked by a user that is not in sudoers - + # e.g. php-fpm's "caddy" user driving the WebUI System Controls, or the "abc" + # user - which is what prevented BirdNET-Pi from working in standalone + # (no-Supervisor) mode. This must run AFTER the installer has cloned the repo; + # the previous build-time hook ran before the clone and was therefore a no-op. + for file in $(grep -srlF "sudo " "$HOME/BirdNET-Pi/scripts"); do sed -i "s|sudo ||g" "$file"; done && \ + \ # Install dateparser and resampy, upgrade numpy $PYTHON_VIRTUAL_ENV /usr/bin/pip3 install dateparser resampy && \ \ diff --git a/birdnet-pi/config.yaml b/birdnet-pi/config.yaml index 42b148b948..d2db429e2f 100644 --- a/birdnet-pi/config.yaml +++ b/birdnet-pi/config.yaml @@ -116,5 +116,5 @@ tmpfs: true udev: true url: https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-pi usb: true -version: 2026.07.10 +version: 2026.07.10-1 video: true diff --git a/birdnet-pi/rootfs/custom-services.d/00-php_pfm.sh b/birdnet-pi/rootfs/custom-services.d/00-php_pfm.sh index 0519e60bf6..76c2497cd3 100755 --- a/birdnet-pi/rootfs/custom-services.d/00-php_pfm.sh +++ b/birdnet-pi/rootfs/custom-services.d/00-php_pfm.sh @@ -4,6 +4,14 @@ # Correct /config permissions after startup chown pi:pi /config +# Ensure the PHP-FPM runtime directory exists. It is normally created by +# systemd-tmpfiles (/usr/lib/tmpfiles.d/php*-fpm.conf), which does not run in +# this container - so on a fresh/tmpfs /run the socket cannot be bound and the +# WebUI never starts. Create it here so the web stack works with or without +# Home Assistant Supervisor. +mkdir -p /run/php +chown www-data:www-data /run/php 2> /dev/null || true + # Set timezone without requiring Home Assistant Supervisor or D-Bus. TZ_VALUE="${TZ:-}" if [[ -S /var/run/dbus/system_bus_socket ]] && command -v timedatectl > /dev/null 2>&1; then