Free, open-source screen sharing for private live streams with friends. Watch together in a browser or self-host Piik. 免费开源的私密屏幕共享,支持游戏直播、一起看电影与自部署。
docs(deploy): record H.264 production cutover [skip ci]
AAA120f3c03061b
diff --git a/docs/deployment.md b/docs/deployment.mdindex 50771ec0..21308d83 100644--- a/docs/deployment.md+++ b/docs/deployment.md@@ -20,37 +20,42 @@ tracked coturn example remains `stun-only`; the shared host retains its olderauthenticated-relay daemon configuration and firewall range. The applicationdoes not pre-advertise TURN credentials to ordinary peers.-Production currently runs exact `261e980c3a9ff2d1a6b54ce18cf3daedb491b777`+Production currently runs exact `1331fbddb59fc2b0b99ba9e5ee4848768ae907c8`on the existing shared public IP, with local/public health 200 and SQLite v3-integrity. Its immutable source artifact is 604,336 bytes with SHA-256-`d8a100d3b06e4a566a84cd9556dafa73a6d533360f82b302c62a0f354958403e`;-the locally built dist artifact is 354,230 bytes with SHA-256-`58b7149bd390d1a9b0179283b50fc4870433988f8037d5b46504019b8b3c3f30`.-The 2026-08-21T08:35:20Z UTC cutover held the deployment lock for 2,276.366 ms;-local health returned 703.625 ms after service stop (562.538 ms after the symlink+integrity. Its immutable source artifact is 606,386 bytes with SHA-256+`7defb2c8d813de0576301f011a61cfc45481ce6ff209f14d61d2b9f0096a6a99`;+the locally built dist artifact is 355,113 bytes with SHA-256+`f20719d415396e6bc1feb6fba883c3a7ef0c619ba70fe1feafff96c93f8c8740`.+The 2026-08-21T09:19:09Z UTC cutover held the deployment lock for 848.008 ms;+local health returned 626.778 ms after service stop (560.282 ms after the symlinkswitch). Screener, LiveKit, coturn, and nginx are active/running withobserved `NRestarts=0`. SQLite v3 contains five rooms including room `1`, with theservice owner/mode `screener:screener`/0600 and SHA-256`aef724ae52c4107be8ec8791e72f8dcaa11b0ec849fb432d022e2cfb9cfe0974`.-The immutable release is `/opt/screener/releases/261e980c3a9f`; backup-`/opt/screener/backups/261e980c3a9f-precutover-20260821T083520Z` preserves the+The immutable release is `/opt/screener/releases/1331fbddb59f`; backup+`/opt/screener/backups/1331fbddb59f-precutover-20260821T091908Z` preserves thedatabase, environment, artifact digests, firewall snapshot, and exact previous-target. Exact `691863e1720ebbee1b5368f29e94f05b3710ccf8` is the immediate rollback-target; exact `6634cb9fca8278b44d57e5fcddcbaf9f0dc9b137` and-`ecc794d6f01ff8e90cc07a267d221daaac8da9e1` remain secondary and tertiary.+target. Exact `261e980c3a9ff2d1a6b54ce18cf3daedb491b777` is the immediate rollback+target; exact `691863e1720ebbee1b5368f29e94f05b3710ccf8` and+`6634cb9fca8278b44d57e5fcddcbaf9f0dc9b137` remain secondary and tertiary.This release keeps one stable SFU subscriber stream, clears unavailable SFUvideo state, stays neutral until current media evidence proves P2P or SFU, andlabels TURN plus a protocol only from actual local relay stats. Routing remainsautomatic across direct/peer and bounded fallback paths. P2P reapplies theselected quality profile after each answer on the same sender; the browser still-owns degradation. The Host preview notice, shared entry/nickname UI, and two+owns degradation. P2P/browser-relay offers prefer H.264 through standard codec+ordering, and SFU publication requests H.264 with backup codec disabled; the+complete browser list retains negotiated VP8 fallback. The Host preview notice,+shared entry/nickname UI, and twodownstream slots per Webrelay remain deployed; a third child remains rejected. ProductionSTUN/SFU/selected-edge configuration and the database were unchanged.-Fresh exact-source acceptance passed typecheck, 32 test files/470 tests, both+Fresh exact-source acceptance passed typecheck, 32 test files/473 tests, bothbuilds, and repository hygiene. Deployment verified both artifact manifests andhashes, one bounded production-only install, runtime imports, `node:sqlite`,UTF-8 paths, zero cross-release regular-file inodes, and immutable permissions.+The public index and all three referenced hashed assets matched the release+byte-for-byte; the deployment lock was released after the atomic switch.This cutover triggered no browser, media, SFU, TURN, or performance canary andremains exact-source, build, configuration, and deployment evidence.A separate earlier local Screener canary using exact `16f6eab` source and the@@ -146,7 +151,7 @@ ICE. The accepted ladder is direct/peer UDP, then the revision-bound SFU/UDPvirtual parent, then optional authenticated TURN for one controller-selectedexceptional edge. LiveKit participants receive only revision-bound `sfu-config`URL/token messages and negotiate within LiveKit's separate ICE domain. The-selected-edge TURN config/wire is deployed in the current `261e980c` release with one+selected-edge TURN config/wire is deployed in the current `1331fbdd` release with oneUDP URL and a 120-second credential TTL. It was not exercised by a real mediasession during this cutover.diff --git a/docs/project-memory.md b/docs/project-memory.mdindex 42c06e03..ee043e89 100644--- a/docs/project-memory.md+++ b/docs/project-memory.md@@ -24,7 +24,7 @@ Last updated: 2026-08-21- Use direct host P2P for one or two viewers, then the bounded controller for every room when `PEER_ASSISTED_MEDIA=true`. Room `1` is historical smoke, not a runtime gate; resource, quality, recovery, SFU/UDP, bounded-failure, and browser/mobile evidence remain separate.- Browser relays resend remote `MediaStreamTrack` values and re-encode at each hop; WebRTC does not guarantee a shared encoder across peer connections, so measure the cost.- Keep experiments bounded: the standard representation sequence is below; native RTP relay, encoded-object striping, and FEC remain separate.-- Current Web source prefers H.264 through standard ordering, keeps the browser fallback list, and requests SFU H.264 with `backupCodec=false`; VP8 is used only when H.264 is unavailable. This is not a second encoder stack or shared-encode proof. ADR-0006's browser bridge remains no-go.+- Production Web prefers H.264 through standard ordering, keeps the browser fallback list, and requests SFU H.264 with `backupCodec=false`; VP8 is used only when H.264 is unavailable. This is not a second encoder stack or shared-encode proof. ADR-0006's browser bridge remains no-go.- Mobile endpoints are Web Viewer-only. Current Android/iOS browsers do not expose Web Host capture; AirPlay/system mirroring is Viewer-local output.- ADR-0005: direct/peer UDP -> bounded SFU roots -> selected-edge TURN. The deployed controller caps pending/answered `peer-selected` at one per room; Host ingress is independent. A pre-`ecc794d` exact-source/production-media canary proves active Host ingress only. Ordinary peers stay STUN-only.- The controller is process-enabled, not room-allowlisted: `PEER_ASSISTED_MEDIA=true` gives every normal room the same direct/peer -> SFU -> selected-edge path with per-room state. Room `1` is historical smoke. Preserve sticky P2P, one active upstream and break-before-make; recovery gets one attempt per layer (ICE restart, same-parent rebuild, alternate peer, then SFU), never three identical retries.@@ -43,7 +43,7 @@ Last updated: 2026-08-21## Current Implementation- The repository is one npm package using Node.js 24, React, TypeScript, Vite, native WebRTC, `ws`, Zod, Vitest, and separate coturn.-- Production is exact `261e980c3a9ff2d1a6b54ce18cf3daedb491b777`; source/dist artifacts are 604,336/354,230 bytes, with hashes in deployment; cutover 2,276.366 ms lock/703.625 ms stop-health/562.538 ms switch-health; rollbacks `691863e`, `6634cb9`, `ecc794d`.+- Production is exact `1331fbddb59fc2b0b99ba9e5ee4848768ae907c8`; source/dist artifacts are 606,386/355,113 bytes, with hashes in deployment; cutover 848.008 ms lock/626.778 ms stop-health/560.282 ms switch-health; rollbacks `261e980`, `691863e`, `6634cb9`.- Web keeps one SFU stream, clears unavailable video, exposes evidence-backed routes/transports and paused preview, and drops signals to a grace-retained offline current-edge target. Routing is automatic; entry/nickname UI is live; Native remains source-only.- Web relay is cap2 with one upstream; child3 rejects and no UA/visibility split exists.- Four services are active/running at `NRestarts=0`; local/public health are 200. SQLite v3 has five rooms, SHA-256 `aef724ae52c4107be8ec8791e72f8dcaa11b0ec849fb432d022e2cfb9cfe0974`, owner/mode `screener:screener`/0600.diff --git a/docs/status.md b/docs/status.mdindex 926eaed6..901caca0 100644--- a/docs/status.md+++ b/docs/status.md@@ -4,10 +4,10 @@ Last updated: 2026-08-21## Phase-Production at `https://share.bonfire.icu` is exact `261e980c3a9ff2d1a6b54ce18cf3daedb491b777`; immutable source/dist artifacts are 604,336/354,230 bytes, with hashes in deployment.-Cutover: 2,276.366 ms lock/703.625 ms stop-health/562.538 ms switch-health. SQLite v3/five rooms has SHA-256 `aef724ae52c4107be8ec8791e72f8dcaa11b0ec849fb432d022e2cfb9cfe0974`, owner/mode `screener:screener`/0600. Four services are active/running at `NRestarts=0`; rollbacks are `691863e`, then `6634cb9` and `ecc794d`.+Production at `https://share.bonfire.icu` is exact `1331fbddb59fc2b0b99ba9e5ee4848768ae907c8`; immutable source/dist artifacts are 606,386/355,113 bytes, with hashes in deployment.+Cutover: 848.008 ms lock/626.778 ms stop-health/560.282 ms switch-health. SQLite v3/five rooms has SHA-256 `aef724ae52c4107be8ec8791e72f8dcaa11b0ec849fb432d022e2cfb9cfe0974`, owner/mode `screener:screener`/0600. Four services are active/running at `NRestarts=0`; rollbacks are `261e980`, then `691863e` and `6634cb9`.Ordinary ICE is STUN-only; limits are SFU roots <=2, one `peer-selected` attempt excluding Host ingress, and selected UDP TTL 120. This rollout ran no browser/media/SFU/TURN/performance canary; earlier exact-`16f6eab` Host-ingress proof remains separate.-Stable SFU, route/transport truth, preview notice, entry/nickname UI and Web relay cap2 are live. Native is source-only. Production `261e980c` uses VP8; current source prefers H.264 with negotiated VP8 fallback.+Stable SFU, route/transport truth, preview notice, entry/nickname UI and Web relay cap2 are live. Native is source-only. Production prefers H.264 with negotiated VP8 fallback.## Execution Principle@@ -29,17 +29,17 @@ Parallel flagship work; minimum relevant checks and rollback proof. Research plu- Chrome 151 + local LiveKit 1.13.5/client 2.22.0 SFU/UDP passed after `q,f` -> `q,h`: one root, decoded 3 -> 23, rendered 26, Host edge one, clean leaves, no TURN. Functional only.- Host A+B and authenticated P2P Viewer C are sanitized, generation-bound, read-only, and fail closed for stale, ambiguous, or SFU-fed evidence; no raw media metadata is retained.- The `a11a73d` built-in TURN canary is rejected: local allocation passed, but direct Host/Pion Viewer failed before forced relay. Full rollback restored STUN-only client ICE and zero allocations.-- Chrome 151 loopback proves H.264 negotiation/decode interoperability, not performance. Source orders H.264 first and keeps browser repair/fallback codecs; production remains VP8 until deployment.+- Chrome 151 loopback proves H.264 negotiation/decode interoperability, not performance. Production orders H.264 first and keeps browser repair/fallback codecs.- Native WGC/MF used no browser capture/encoder. One Chrome Viewer rendered 203 1280x720 frames and received 500 Opus packets; process/LUID-correlated `VideoEncode` was nonzero, with no fatal/encoder errors.- Native Win11 audio is source-only/default-off: target isolation was 4018x and one Viewer got 495 Opus packets. Download, game sync, Win10, and other routes remain open.- Access protocol/config/HTTP/storage/SQLite/signaling focused tests pass, including commit-first teardown and v1 rollback.- Native wire/session tests enforce at most two authoritative children, no presence-created edge, stale-revision ignore, and one bounded unsupported-route failure per revision.- Production caps pending/answered `peer-selected` at one per room; Host ingress is independent. Focused admission/release/rollback/STUN-only tests pass; earlier Chrome proves active Host-ingress function only.-- Exact `261e980c` passed fresh typecheck, builds, hygiene and 32 files/470 tests. Bounded runtime, UTF-8 artifact, inode and deploy gates preserved config/nft/DB hashes and four zero-restart services.+- Exact `1331fbdd` passed fresh typecheck, builds, hygiene and 32 files/473 tests. Bounded runtime, UTF-8 artifact, inode and deploy gates preserved config/nft/DB hashes and four zero-restart services.## Unverified Boundaries-- The `261e980c` cutover ran no browser/media/SFU/TURN/performance canary. Earlier `16f6eab` proof covers Host ingress only; audible quality, last mile, external cohorts, admission rescue, resources/performance and game blur remain open.+- The `1331fbdd` cutover ran no browser/media/SFU/TURN/performance canary. Earlier `16f6eab` proof covers Host ingress only; audible quality, last mile, external cohorts, admission rescue, resources/performance and game blur remain open.- Mobile is Viewer-only. Its persistent audible media element keeps media/signaling active while the page lives; iOS lock-screen, reclamation and background reconnection remain device gates. AirPlay/system mirroring is local output; live WebRTC `srcObject` has no portable in-app TV-output contract.- Silent partitions can wait 30 to 60 seconds for heartbeat detection before the default 5-second grace; this remains unverified.- Production startup blur remains open. One local Chrome synthetic same-`balanced` A/B kept route/PC/SSRC/track and coincided with 720p -> 1080p without loss/freeze, but natural ramp prevents causal, production, or SFU proof.