From 322e2882cac734c662319ce2d4fcd3b11b3e7d86 Mon Sep 17 00:00:00 2001 From: Honey Date: Fri, 24 Jul 2026 21:29:55 +0200 Subject: [PATCH] Serve the Pi's web UI on port 80 instead of 8080 Just http:// now instead of http://:8080. Safe since the systemd service already runs as root (needed for GPIO/SPI access anyway), so binding the privileged port isn't a new requirement. Local --mock dev stays on 8080 (README/main.py default unchanged) -- that's normally run without root, and port 80 needs it. install.sh now does enable + restart instead of enable --now, so re-running it after a unit-file change (like this one) actually applies on an already-installed instance, not just a fresh install. --- README.md | 2 +- install.sh | 8 ++++++-- paperwall.service.template | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 518509b..e49820e 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ InkyPi (or anything else) already running, it stops it first -- two things can't drive the same panel at once -- but nothing is copied from or reused out of it. Safe to re-run. -Then open `http://:8080`, fill in Navidrome credentials under +Then open `http://`, fill in Navidrome credentials under **Navidrome** and a city under **Weather**. Everything saves immediately and takes effect within a few seconds -- no restart needed. diff --git a/install.sh b/install.sh index 5f6bc8c..40fd15b 100755 --- a/install.sh +++ b/install.sh @@ -94,7 +94,11 @@ install_service() { -e "s#{{PYTHON}}#$VENV_DIR/bin/python3#g" \ "$APP_DIR/paperwall.service.template" > "$SERVICE_TARGET" systemctl daemon-reload - systemctl enable --now "$SERVICE_NAME" + systemctl enable "$SERVICE_NAME" + # restart (not just enable --now) so re-running this after a unit file + # change -- e.g. the port -- actually picks it up on an already-running + # install, not just on a fresh one. + systemctl restart "$SERVICE_NAME" echo " installed and started." } @@ -104,7 +108,7 @@ show_status() { systemctl status "$SERVICE_NAME" --no-pager -l | head -15 || true ip_address=$(hostname -I | awk '{print $1}') echo - echo "Web UI: http://$ip_address:8080 (or http://$(hostname).local:8080)" + echo "Web UI: http://$ip_address (or http://$(hostname).local)" echo "Logs: journalctl -u $SERVICE_NAME -f" echo "Remove: sudo bash uninstall.sh" if grep -qE '^\s*dtoverlay=spi0-2cs' "$CONFIG_TXT" 2>/dev/null; then diff --git a/paperwall.service.template b/paperwall.service.template index 462800c..87338c1 100644 --- a/paperwall.service.template +++ b/paperwall.service.template @@ -6,7 +6,7 @@ Wants=network-online.target [Service] Type=simple # Filled in by install.sh to point at this project's own self-contained venv. -ExecStart={{PYTHON}} {{APP_DIR}}/main.py --host 0.0.0.0 --port 8080 +ExecStart={{PYTHON}} {{APP_DIR}}/main.py --host 0.0.0.0 --port 80 WorkingDirectory={{APP_DIR}} Restart=on-failure RestartSec=5