4a7cf9af7b
Every user needs the console for pairing, so ship it via apt, auto-wired to the host — no manual bun/env setup. New punktfunk-web .deb (Architecture: all, Depends: nodejs >= 20 — runs the node-server build under apt-native node, no bundled bun): - packaging/debian/build-web-deb.sh: stages web/.output (server + public) + a /usr/bin/punktfunk-web-server wrapper (node) + the systemd --user units + the web.env template + docs. Refuses a bun bundle (Bun.serve) as a wrong-preset guard. - scripts/punktfunk-web.service: --user unit on :3000, EnvironmentFile sources the host's ~/.config/punktfunk/mgmt-token (the shared bearer) + the generated web-password; sets PUNKTFUNK_MGMT_URL=https://127.0.0.1:47990 + NODE_TLS_REJECT_UNAUTHORIZED=0 (loopback self-signed cert). Restart=on-failure rides out the host-writes-token-first ordering. - scripts/punktfunk-web-init.service + web-init.sh: --user one-shot that generates the login password (a .deb postinst runs as root → wrong $HOME) and surfaces it to the journal. - build-deb.sh: punktfunk-host now Recommends punktfunk-web (apt pulls it by default; headless boxes opt out with --no-install-recommends). - deb.yml: build the web console + smoke-boot it under node (gate the .deb on a real /login 200) + build-web-deb.sh; the publish loop globs it automatically. - web/{.env.example,web.env.example}: document the auto-wiring vs a manual deploy. End state: `apt install punktfunk-host` pulls punktfunk-web; enable both --user services; the console logs in (password from the journal) and proxies the host's HTTPS mgmt API with the shared token — zero hand-edited env. Local .deb build + node smoke-boot verified. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
18 lines
682 B
Desktop File
18 lines
682 B
Desktop File
# punktfunk web console first-run setup — systemd USER one-shot.
|
|
#
|
|
# Generates the console login password (PUNKTFUNK_UI_PASSWORD) in the streaming user's
|
|
# ~/.config/punktfunk on first start, surfaced to the --user journal for retrieval. A .deb postinst
|
|
# runs as root (wrong $HOME), so credential generation must happen as the user — hence this unit.
|
|
# Pulled in by punktfunk-web.service (Wants=); also runnable directly.
|
|
[Unit]
|
|
Description=punktfunk web console first-run setup (login password)
|
|
ConditionPathExists=!%h/.config/punktfunk/web-password
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
RemainAfterExit=yes
|
|
ExecStart=/usr/share/punktfunk-web/web-init.sh
|
|
|
|
[Install]
|
|
WantedBy=default.target
|