feat(server): request updates through a systemd trigger (#15)

The service stays unprivileged: POST /api/settings/update only writes the
update-request file in the data directory, which a root-owned path unit
watches. Status comes from systemctl show and the root-owned update log;
the check fetches the tracked branch into FETCH_HEAD and lists new commits.
This commit is contained in:
Florian Schmidt
2026-11-16 15:31:00 +01:00
parent ebf8649ab6
commit 2fc5f99f59
5 changed files with 388 additions and 1 deletions
+8
View File
@@ -276,6 +276,14 @@ checks and responses disable caching.
service user home; credential contents are never read or returned.
- Listens on `127.0.0.1` or LAN; intended behind Traefik + firewall (LAN/Tailscale only).
- Terminal panel = shell as the service user: same trust level as the app itself.
- Self-update from Settings never gives the service privileges: POST
`/api/settings/update` only writes `<data dir>/update-request`. A root-owned systemd
path unit starts the oneshot `shellbook-update.service`, which runs the fixed
root-owned `/usr/local/sbin/shellbook-update` (it fetches the installer from the
repository and never executes the service-writable checkout) and writes its output
to `/var/log/shellbook-update.log`. The server reads state only through
`systemctl show` and that log; "check for updates" runs `git fetch` into
`FETCH_HEAD` only. A request can only start that fixed updater, nothing else.
- No secrets in notebooks, audit log or artifacts metadata.
## 8. Architecture