forked from unom/punktfunk
WP4 of the docs-and-onboarding overhaul (punktfunk-planning design/docs-and-onboarding-overhaul.md). scripts/install.sh — plain POSIX sh (dash-clean), ~380 lines, `curl -fsSL https://punktfunk.unom.io/install.sh | sh`: detect the distro from os-release (apt / dnf / pacman / rpm-ostree→sysext; NixOS, SteamOS, Windows and unknown distros get a one-line pointer and stop; Debian 12 / Ubuntu 24.04 / Mint 22 / Fedora 45 hit the documented floors with the right docs link) → install with the platforms.json lines VERBATIM (channel and the Fedora group are edited into the string at run time; `--yes` rewrites them non-interactive, a tty hands the package manager its own prompt; stdin is never read, because under `curl | sh` stdin is the script) → `punktfunk-host detect-conflicts` (exit 1 = active Sunshine-family host) → offer to keep both by moving the management API port (PUNKTFUNK_MGMT_BIND, default 47991, the firewall step opens it) → input group (ujust on Bazzite; no-op if already in) → optional punktfunk group, GameStream compat, shared clipboard (all default no) → firewalld/ufw profiles → enable host + console (+ the plugin runner where it isn't) → optional linger → verify (unit active, UDP 9777 bound) and print the console URL, the password command and the pairing steps. `--dry-run` prints every command and changes nothing; every prompt has a PUNKTFUNK_INSTALL_* environment twin; re-running is safe (install skipped when the binary exists). Running under sudo is refused (host.env and the units belong to the user); root without sudo gets a shim so the verbatim lines still work. Decisions: the canonical URL is punktfunk.unom.io/install.sh, a 302 on the website to the script at raw/branch/main (versioned with the code it installs; precedent: the Bazzite sysext bootstrap) — the website half is punktfunk-website PR #4. GPU drivers stay the docs pages' job; the one silent failure (Fedora + NVIDIA without RPM Fusion's ffmpeg-libs → no NVENC) is called out at the end. Gates: check-docs-drift.sh gate 6 — every apt/pacman/dnf/sysext install line in data/platforms.json must appear verbatim in the script, and the script must parse (shown to fail on a planted drift). New path-filtered workflow installer-smoke.yml runs the script unattended in debian:trixie, fedora:44 and archlinux:base against the real registry, then `punktfunk-host --version`, `detect-conflicts`, and a re-run that must say "already installed". Docs: install hub gains "Guided install (preview)" rendered from platforms.json's new `installer` block via an <Installer/> component (one-liner + inspect-first form + flags); CONTRIBUTING names the new gate. Verified locally: sh/dash -n, both docs gates, docs-site build + lint, and a --dry-run matrix over 16 faked os-release files (all four families, every floor, canary, every option, piped stdin). The container run itself is the CI job's to report — Docker on this machine was wedged under another session's emulated build. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>