Fresh install is not turnkey — media server (livekit-server) is never downloaded/configured/started by lab build --start #42
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After
lab build --start, hero_proc reports everything "running", but no meeting works until a human runs the Server tab: Install → Configure → Start flow (README:62-64).LiveKitService.install(rpc.rs:447) downloadslivekit-serverfrom GitHub releases and mints the API secret — only when called.LiveKitService.configurewriteslivekit.yaml+backend.env.LiveKitService.start(rpc.rs:614) spawnslivekit-server+lk-backend; errors"binaries not installed -- call install first"otherwise.Nothing auto-invokes these: the admin
/backend/starthandler (server.rs:145) only spawns thehero_livekit_serverdaemon, and there's no hero_proc post-start hook.Proposal: make first-boot turnkey — e.g.
hero_livekit_serverruns install+configure on first start iflivekit-serveris missing (network-gated, version-pinnable), or a hero_proc post-start hook performs the bootstrap. Must stay idempotent and reuse the existing secret on re-runs.Acceptance: a fresh
lab build --start(with network) yields a working meeting without manual UI steps.Approved design spec — turnkey one-command livekit start
Committed to
integrationatdocs/superpowers/specs/2026-06-08-livekit-turnkey-start-design.md(commite116645). Reproduced here as the source of truth.LiveKit Turnkey Start — Design Spec
Goal
Bring up a fully working livekit instance — the downloaded
livekit-servermedia binary, generated config, and running child processes — from a single
lab service hero_livekit --start(orlab build --start), on realservers, with no manual
install → configure → startRPC dance.Config source: hero_proc secrets
Per-server configuration lives in hero_proc's secret store — the canonical
Hero pattern ("services probe their secrets from hero_proc at boot"), already
used in this repo by
hero_livekit_admin(whitelist.rsreads its IPallow-list via
secret_get). Three values:LIVEKIT_NODE_IPLIVEKIT_VERSIONlivekit-serverrelease to download (e.g.v1.7.2).LIVEKIT_API_SECRETExact key names to be reconciled with hero_proc's
KNOWN_SECRET_KEYScatalogue during planning.
Mechanism: server-side idempotent ensure-on-start
On
hero_livekit_serverstartup, afterrpc.sockis bound and serving,run one idempotent
ensure_ready()routine as a background task (so a slowdownload never delays RPC availability):
LIVEKIT_VERSIONbeing set is the single opt-insignal: if it is unset, skip provisioning and serve the plain daemon
(today's behavior); no extra flag. When provisioning, if
LIVEKIT_NODE_IPis unset, default to
127.0.0.1and log a loud warning (works for localdev; clearly flagged as wrong for a real server).
livekit-serverbinary is missing, download the pinnedLIVEKIT_VERSION(best-effort). Download-if-missing only this iteration:a changed
LIVEKIT_VERSIONon an already-installed box does notauto-re-download (that would need installed-version tracking) — a version
bump is an explicit re-install for now; auto-upgrade is a follow-up.
livekit.yaml+backend.envfrom the secrets — only if changed.livekit-server+lk-backendonly if they are not alreadyrunning (liveness-checked).
ensure_ready()is non-disruptive: it mustNOT kill or restart healthy children — unlike the explicit
start()RPC,which
pkills and respawns. Healthy stack on restart → no churn.ensure_ready()re-runs on every server start, so it self-heals after arestart.
Safety rules (non-negotiable for real servers)
A failed download (offline, GitHub down, rate-limited) logs a clear warning
and is retried on the next start — it never fails or bricks the daemon.
box that did not opt in.
server / livekit-server / lk-backend and across restarts; no per-run random
secret.
Scope / non-goals
interface) and local dev (
LIVEKIT_NODE_IP=127.0.0.1).advertised-IP /
rtc.use_external_ip). IfLIVEKIT_NODE_IPis not on alocal interface, log a clear warning; advanced NAT config is a follow-up.
lk-backend/livekit-serverlaterbecome hero_proc-supervised, only step 5 (spawn children) moves out to
hero_proc; steps 1–4 stay in the server.
Acceptance criteria
lab service hero_livekit --starton aserver with internet egress yields a working room + token, no manual UI.
--startbrings up the daemon only (unchanged).next start.
(re)spawned only if down.
Open questions for planning
node_ipon-interface check + warning wording.