web/deploy: add one-shot install.sh

Adds web/deploy/install.sh — full LXC setup in one command. It derives the
repo path from its own location (clone anywhere; /opt/ponfw recommended),
installs git/node/npm if missing (checks Node >= 18), creates the ponfw
service user, runs npm install --omit=dev, writes /etc/pon-fleet-web.env on
first run, and installs+enables the systemd unit with WorkingDirectory set to
the checkout. Idempotent; warns if cloned under /home (ProtectHome blocks it).

README + CLAUDE.md §16 updated to lead with install.sh and clarify the clone
location.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Jon Vanvik 2026-06-23 14:30:06 +02:00
parent c2206ad5a7
commit de037c8795
3 changed files with 126 additions and 23 deletions

View file

@ -808,10 +808,13 @@ Consequences for editing:
age badge from it (`renderCacheBadge`), and the Dashboard **Refresh** button
sends `fresh:true` to bypass the cache. The Electron app sends no cache
field, so the badge shows "live".
- **Deploy** lives in `web/deploy/` (systemd unit + env template +
`update.sh`); Debian-13-LXC clone-to-run steps and the Nginx Proxy Manager
setup are in `web/README.md`. Note streams send `X-Accel-Buffering: no` so
nginx/NPM don't buffer the NDJSON progress.
- **Deploy** lives in `web/deploy/`: `install.sh` (one-shot, idempotent —
derives the repo path from its own location, so clone anywhere; points the
systemd unit at that checkout), `update.sh` (git pull + npm install +
restart), the unit, and the env template. Debian-13-LXC steps + Nginx Proxy
Manager setup are in `web/README.md`. Clone to `/opt/ponfw` — the hardened
unit's `ProtectHome=true` blocks a checkout under `/home`. Streams send
`X-Accel-Buffering: no` so nginx/NPM don't buffer the NDJSON progress.
The web app must stay a subdirectory of this repo — it `require`s `../src/*`
and borrows `../node_modules` (`tough-cookie`); no separate install. Deploy