Commit graph

432 commits

Author SHA1 Message Date
a2e0a8c083 feat(webrtc): add H.264 keyframe burst cache (issue #17)
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
Introduces keyFrameCache — a bounded ring buffer that retains all RTP
packets from the most recent H.264 IDR NAL unit until the packet just
before the next one. New WHEP subscribers receive this burst immediately
on Subscribe(), cutting first-frame latency from up to one IDR interval
(typically ~2 s at GOP=60/30fps) to nearly zero.

Design notes:
- Detection covers single-NAL (type 5) and FU-A start (type 28, start
  bit set, inner type 5). STAP-A IDR leading is not handled — FFmpeg
  never uses STAP-A for IDR slices in practice.
- Bounded at 512 packets / 2 MiB per source to cap memory per stream.
- push() is called only from the single-goroutine readLoop; the lock
  it holds is tiny and brief.
- snapshot() returns a shallow copy; *rtp.Packet values are immutable
  after being placed in the cache so sharing is safe.
2026-05-09 19:03:33 -04:00
353fa0f3f3 seed-data.sh: always refresh static/ and index.html from image
Some checks failed
ci / vet + build (push) Failing after 5m7s
ci / race tests (push) Has been skipped
ci / WebRTC smoke (5-viewer fanout) (push) Has been skipped
ci / WebRTC latency p95 gate (push) Has been skipped
The React bundle hash changes every time the UI is rebuilt. With the old
no-clobber approach, a redeployed container kept serving the old bundle
because the static/ directory already existed on the data volume.

Fix: always overwrite index.html, asset-manifest.json, and the entire
static/ subdirectory from /core/static on every container start. These
are build artifacts (not operator-edited content) so overwriting is safe.
All other top-level entries (channels/, config/, etc.) remain no-clobber.
2026-05-09 17:21:05 -04:00
4d94c88d74 Add ProcessConfigWHIPIngest to API layer with Marshal/Unmarshal wiring
Some checks failed
ci / vet + build (push) Failing after 5m1s
ci / race tests (push) Has been skipped
ci / WebRTC smoke (5-viewer fanout) (push) Has been skipped
ci / WebRTC latency p95 gate (push) Has been skipped
Adds ProcessConfigWHIPIngest struct to http/api/process.go and wires it
into ProcessConfig.Marshal() and ProcessConfig.Unmarshal() so that the
WHIPIngest.Enabled flag can be set via API and correctly propagates to
app.Config.WHIPIngest, which is checked by onWHIPProcessStart in
app/webrtc/whip_lifecycle.go.

Without this change, app.Config.WHIPIngest.Enabled was always false and
WHIP ingest could never activate regardless of what the UI sent.
2026-05-09 17:01:49 -04:00
4ac63ddfc6 feat(whip): wire WHIPHandler into API — struct field, MergedHooks, NewWHIPHandler, serverConfig, cleanup
Some checks failed
ci / vet + build (push) Failing after 5m0s
ci / race tests (push) Has been skipped
ci / WebRTC smoke (5-viewer fanout) (push) Has been skipped
ci / WebRTC latency p95 gate (push) Has been skipped
2026-05-09 16:46:49 -04:00
7f545962f6 fix(whip): wire teardown hook in NewWHIPHandler constructor (mirrors WHEP NewHandler pattern)
Some checks failed
ci / vet + build (push) Failing after 5m1s
ci / race tests (push) Has been skipped
ci / WebRTC smoke (5-viewer fanout) (push) Has been skipped
ci / WebRTC latency p95 gate (push) Has been skipped
2026-05-09 16:38:29 -04:00
1be78a8185 feat(whip): wire WHIPHandler into HTTP server Config and v3 routes
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-09 16:35:48 -04:00
a22b8c68f0 fix(whip): clean up lifecycle — proper net import and checkPortFree implementation
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-09 16:34:20 -04:00
b1057756d2 fix(whip): rewrite lifecycle hooks — correct port allocation, clean FFmpeg RTP input legs
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-09 16:33:35 -04:00
4bef6563c7 feat(whip): extend Subsystem with WHIP ingest state, lookupIngest, WHIPHooks
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-09 16:32:49 -04:00
6c9d1864dd feat(restream): extend ProcessHooks with OnInputStart for WHIP ingest input legs
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-09 16:32:03 -04:00
ca3501f888 feat(whip): add WHIP process lifecycle hooks — port allocation and FFmpeg RTP input legs
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-09 16:27:25 -04:00
d72aa8afe1 feat(whip): add WHIPHandler — Echo HTTP handler for WHIP ingest endpoints
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-09 16:26:42 -04:00
2a4c8d5f52 fix(docker): chmod apply-overlay.sh before execution (exit 126)
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-09 16:25:28 -04:00
01c456cd1a feat(core/webrtc): add IngestPeer for WHIP publish side (issue #16)
Some checks failed
ci / vet + build (push) Failing after 5m3s
ci / race tests (push) Has been skipped
ci / WebRTC smoke (5-viewer fanout) (push) Has been skipped
ci / WebRTC latency p95 gate (push) Has been skipped
IngestPeer is the symmetric inverse of the WHEP Peer:
- Creates a recvonly PeerConnection (Pion receives tracks from the publisher)
- OnTrack -> reads RTP packets from the remote track and writes them to
  loopback UDP ports (videoPort, audioPort) that FFmpeg is listening on
- Full lifecycle: Done(), Connected(), Close(), AddICECandidate()

PeerFactory.CreateIngestPeer() follows the same ctx/offer/ICE-gather
pattern as CreatePeerFromSources() so the app/webrtc handler layer can
use a uniform error matrix.
2026-05-09 16:20:09 -04:00
5f9ba6f764 feat(config): add ConfigWHIPIngest to per-process config (issue #16)
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
Adds the ConfigWHIPIngest struct alongside the existing ConfigWebRTC.
When Enabled=true the app/webrtc subsystem (next commit) will prepend
RTP UDP input legs to the FFmpeg command, binding on loopback ports
that WHIP publisher peers write received WebRTC tracks to.
2026-05-09 16:18:43 -04:00
890b09a33c fix(build): remove promauto dependency, use explicit reg.MustRegister
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
promauto is not in the vendor tree. Replace promauto.With(reg).NewXxx()
with prometheus.NewXxx() + reg.MustRegister() — functionally identical
but uses only the already-vendored prometheus/client_golang/prometheus
package. Fixes the vendor-mode build error:

  cannot find module providing package .../prometheus/promauto
2026-05-09 16:16:31 -04:00
70d0ddb2e3 gui: redesign WebRTC admin page with Wild Dragon brand
Some checks failed
ci / vet + build (push) Failing after 4m50s
ci / race tests (push) Has been skipped
ci / WebRTC smoke (5-viewer fanout) (push) Has been skipped
ci / WebRTC latency p95 gate (push) Has been skipped
- Rajdhani + JetBrains Mono typefaces via Google Fonts
- Deep dark palette: #09090d bg, #ff5c28 accent
- 22px dot-grid background texture
- Sticky frosted-glass header with WD monogram SVG
- Wild Dragon wordmark SVG on login panel
- Process cards with border-left state indicator (green/amber/red)
- Animated pulse dots on state badges
- Cleaner WHEP URL row with Copy + Open buttons
- Log panels hidden until first entry (no empty box on load)
- All JS functionality preserved (JWT auth, toggle+restart, WHEP copy)
2026-05-09 12:27:08 -04:00
dd639b697f feat(ui): source UI build from wilddragon-restreamer-ui fork (issue #15)
Some checks failed
ci / vet + build (push) Failing after 4m49s
ci / race tests (push) Has been skipped
ci / WebRTC smoke (5-viewer fanout) (push) Has been skipped
ci / WebRTC latency p95 gate (push) Has been skipped
2026-05-06 16:21:23 -04:00
917225c994 chore: create test/load/results/ directory for load test reports
Some checks failed
ci / vet + build (push) Failing after 4m50s
ci / race tests (push) Has been skipped
ci / WebRTC smoke (5-viewer fanout) (push) Has been skipped
ci / WebRTC latency p95 gate (push) Has been skipped
2026-05-06 16:04:13 -04:00
9e9c7eb8f1 docs: update README quick-start with Prometheus/Grafana and Docker publish
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-06 16:04:02 -04:00
55b61dd0e5 docs: update CHANGELOG for v0.2 backlog work (closes #11, #12, #13, #14)
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-06 16:03:09 -04:00
561a93e044 feat(test): add 5-peer sustained WHEP load test (closes #14)
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-06 16:01:22 -04:00
60f64fe76b feat(ci): add Docker image publish workflow on tag push (closes #12)
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-06 16:00:32 -04:00
28a280b9b3 feat(deploy): add Prometheus + Grafana observability stack (closes #11)
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-06 16:00:15 -04:00
4beab3423d feat(deploy): add Grafana WebRTC health dashboard
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-06 15:59:56 -04:00
6b637a35e6 feat(deploy): add Grafana dashboard provisioning config
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-06 15:59:24 -04:00
7471507be7 feat(deploy): add Grafana Prometheus datasource provisioning
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-06 15:59:18 -04:00
e8f39daa75 feat(deploy): add WebRTC Prometheus alert rules
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-06 15:59:11 -04:00
4b8d9f0e8c feat(deploy): add Prometheus scrape config
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-06 15:59:00 -04:00
1748f9102d test(webrtc): add metrics unit tests
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-06 15:58:50 -04:00
47a28bf9d4 feat(webrtc): instrument WHEP handler with Prometheus metrics
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-06 15:58:26 -04:00
1d7cd5b520 feat(webrtc): add StreamCount() for metrics snapshot
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-06 15:57:13 -04:00
15af16ce97 test(prometheus): add WebRTC snapshot collector unit tests
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-06 15:56:43 -04:00
23636e4a76 feat(prometheus): add WebRTC snapshot collector
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-06 15:56:27 -04:00
eaf62b7397 feat(webrtc): add WebRTC Prometheus metrics (direct instrumentation)
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-06 15:56:12 -04:00
70324aad28 feat(webrtc): add Connected() channel to Peer for ICE establishment timing
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-06 15:55:42 -04:00
2283a32f2a docs: add upstream rebase policy (closes #13)
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-06 15:55:00 -04:00
99c568e53e Update rsLogo component to import from local images directory
Some checks failed
ci / vet + build (push) Successful in 9m49s
ci / race tests (push) Failing after 8m16s
ci / WebRTC smoke (5-viewer fanout) (push) Successful in 9m58s
ci / WebRTC latency p95 gate (push) Successful in 10m7s
2026-05-03 23:26:20 -04:00
6c3f887faa Update Logo component to import from local images directory
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-03 23:26:13 -04:00
6449f65468 feat(branding): replace placeholder logo192 with real Wild Dragon logo
Some checks failed
ci / vet + build (push) Successful in 9m51s
ci / race tests (push) Failing after 8m11s
ci / WebRTC smoke (5-viewer fanout) (push) Successful in 10m1s
ci / WebRTC latency p95 gate (push) Successful in 10m10s
2026-05-03 17:25:42 -04:00
9a618f0b70 docs(readme): mention the GUI surface in the quick-start
Some checks failed
ci / vet + build (push) Successful in 9m50s
ci / race tests (push) Failing after 8m8s
ci / WebRTC smoke (5-viewer fanout) (push) Successful in 9m54s
ci / WebRTC latency p95 gate (push) Successful in 10m4s
Users running v0.2 already have a full UI; calling it out so it isn't
just discovered by accident.
2026-05-03 16:34:44 -04:00
86a5a50dec docs(deploy): document the GUI surface (Restreamer UI + Wild Dragon WebRTC admin)
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
2026-05-03 16:33:48 -04:00
2d2bd0e5c6 docs(changelog): v0.2.0-dragonfork — GUI ship
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
Calls out the Restreamer UI bundle (which has been in the deploy
bundle since M2 but undocumented) and the new wilddragon-webrtc.html
admin page.
2026-05-03 16:32:56 -04:00
27cc39dab0 feat(deploy): add Wild Dragon WebRTC admin page
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
Single-file HTML/JS admin page seeded into /core/data alongside
whep-player.html. Lets an operator log in with the API_AUTH_USERNAME
+ API_AUTH_PASSWORD creds, list every process, and toggle webrtc.enabled
per process with a single button. WHEP URL displayed for enabled
processes with a one-click "open in WHEP player" link.

Closes the v0.1 GUI gap: the upstream Restreamer UI we ship doesn't
know about Core's webrtc config block, so toggling WebRTC required
direct API calls. This page is the user-friendly path. Reachable at
/wilddragon-webrtc.html on any deploy.

No build step — drops in via the existing seed-data.sh flow.
2026-05-03 16:31:13 -04:00
949daa26b5 docs(design): WebRTC Prometheus metrics + Grafana stack design
Some checks failed
ci / vet + build (push) Successful in 9m51s
ci / race tests (push) Failing after 8m5s
ci / WebRTC smoke (5-viewer fanout) (push) Successful in 9m53s
ci / WebRTC latency p95 gate (push) Successful in 10m4s
Closes the v0.1 observability gap. Eleven new metrics in the
dragonfork_webrtc_* namespace (RED-method on the WHEP surface plus
state gauges from the WebRTC subsystem), Prom + Grafana containers
added to deploy/truenas/core/, four pre-loaded alert rules, one
pre-provisioned dashboard.

Hybrid instrumentation: direct client_golang in app/webrtc/ for
hot-path counters and histograms; snapshot collector in
prometheus/webrtc.go for slow-changing gauges. Rationale and
trade-offs against the upstream monitor/metric bus pattern documented
in the Approach section.

Targets v0.2.0-dragonfork.
2026-05-03 14:50:56 -04:00
75afcbc0d1 deploy(compose): pass RTMP/SRT/TLS port overrides through from .env
Some checks failed
ci / vet + build (push) Successful in 9m50s
ci / race tests (push) Failing after 6m30s
ci / WebRTC smoke (5-viewer fanout) (push) Successful in 9m47s
ci / WebRTC latency p95 gate (push) Successful in 10m2s
The compose file's environment: block only forwarded the variables it
explicitly referenced — CORE_ADDRESS, CORE_API_AUTH_*, CORE_WEBRTC_*,
CORE_LOG_LEVEL. Everything else got the upstream Core defaults
regardless of what was in .env. So 'CORE_RTMP_ADDRESS=:1937' in .env
was silently ignored and Core kept binding 1935.

Hit on the live TrueNAS host where another datarhei/restreamer
container was already on 1935 with active stream state — couldn't
just stop it. Adding explicit env passthrough for the four common
collision points (RTMP, RTMPS, SRT, TLS) so an operator can remap
each individually without editing this file:

  CORE_RTMP_ADDRESS=:1937
  CORE_RTMP_ADDRESS_TLS=:1938
  CORE_SRT_ADDRESS=:6002
  CORE_TLS_ADDRESS=:8183

Defaults are unchanged — empty .env keeps :1935/:1936/:6000/:8181.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-03 13:30:02 +00:00
7621f88fea feat(ui): Wild Dragon reskin overlay on the Restreamer UI
Some checks are pending
ci / vet + build (push) Waiting to run
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
Layers Wild Dragon branding on top of upstream restreamer-ui v1.14.0
without forking the whole repo — keeps upstream UI updates flowing in
when we bump RESTREAMER_UI_REF.

Overlay (deploy/truenas/core/ui-overlay/):
  public/index.html       Wild Dragon title, theme color #0d0e12
  public/manifest.json    PWA name/short_name/colors
  public/favicon.ico      multi-res ICO (16/32/64) generated from
                          a 'WD' monogram in orange #ff6633 on dark
  public/logo192.png      Apple touch icon
  public/logo512.png      PWA install icon
  src/misc/Logo/images/   rs-logo.svg (square mark, used in the
                          Header) and logo.svg (wordmark, used in
                          the Footer) — both Wild-Dragon-themed
  src/misc/Logo/{index,rsLogo}.js
                          link the logos to forge.wilddragon.net
                          instead of datarhei.com

apply-overlay.sh runs in the Docker ui-builder stage just after the
upstream git clone and just before yarn install. Two phases:
  1. rsync the overlay's public/ and src/ on top of the cloned
     upstream tree
  2. Targeted in-place patches for one-line UI strings (header
     title, two welcome captions). Each patch is anchored to a
     unique surrounding context and the script fails loudly if the
     anchor isn't present — so a future upstream rename surfaces
     immediately rather than silently shipping un-rebranded UI.

Image size: ~+50KB (the overlay assets), no measurable build-time
delta. PWA installs and OS bookmarks now show Wild Dragon. The
remaining 'Restreamer'/'datarhei' references in views/Welcome.js,
views/Login.js, views/Settings.js, etc. are deeper-page strings
that aren't worth a one-off overlay; they'll go away when we fork
the UI repo properly for the WebRTC tab milestone.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-03 13:14:41 +00:00
10f3e20a6a fix(deploy): make seed-data.sh recursive for directory entries
Some checks are pending
ci / vet + build (push) Waiting to run
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
The Restreamer UI bundle includes subdirectories (_player,
_playersite, static, locales) and the Dockerfile copies the whole
tree into /core/static. seed-data.sh on first boot was using flat
'cp -p' which errors on directories with 'omitting directory ...';
set -e then exits, the container restarts forever in a crash loop,
and Core never starts.

Fix: 'cp -Rp' so directories are copied as trees. The no-clobber
check on the top-level name still keeps operator-edited content
safe — if /core/data/_player exists we don't replace it, even if
its internals diverge from the bundled version.

Also defends against dotfiles via the second glob.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-03 13:01:51 +00:00
26991ec463 deploy: bundle the official Datarhei Restreamer UI
Some checks are pending
ci / vet + build (push) Waiting to run
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
Replaces the placeholder Dragon Fork landing page at / with the real
React SPA — the same UI that ships in upstream's datarhei/restreamer
image. Operators get the full process management dashboard, log
viewer, restream config, and so on.

Implementation: a new Docker stage 'ui-builder' (node:21-alpine3.20)
clones datarhei/restreamer-ui at a pinned tag (v1.14.0), runs
'yarn install + yarn build' with PUBLIC_URL="./" so all asset
references are relative, and the runtime stage pulls /ui/build into
/core/static. The existing seed-data.sh script then copies it into
/core/data on first boot.

Stacking order in /core/static:
  1. UI bundle from ui-builder — provides index.html, the SPA bundle
     and assets, _player, _playersite, etc.
  2. Dragon Fork deploy/static/* — currently only whep-player.html;
     the placeholder index.html was removed so the UI's wins.

Pinned to v1.14.0 (the most recent tagged restreamer-ui release)
rather than 'main' for reproducible builds. Bumping the pin is a
one-line ARG override.

Image size: ~+25MB compressed (Restreamer UI bundle is ~3MB
gzipped, plus the build-stage layer overhead until pruned).

UI-side configuration: the SPA defaults to talking to the
same-origin /api endpoints, which is exactly what we want when
serving from Core. No '?address=' query string needed on the URL.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-03 12:58:51 +00:00
45f39a9132 deploy: ship a Dragon Fork landing page at / (fixes root 404)
Some checks failed
ci / vet + build (push) Successful in 9m49s
ci / race tests (push) Failing after 8m1s
ci / WebRTC smoke (5-viewer fanout) (push) Successful in 9m46s
ci / WebRTC latency p95 gate (push) Successful in 10m5s
A clean post-merge deploy showed an unintended UX wart: hitting
http://<host>:<port>/ in a browser returned 404 'File not found'
because Core's static-disk handler serves /core/data and we never
put anything there. Functionally fine — the API and Swagger are
reachable on /api and /api/swagger — but a confusing first
impression for a brand-new operator.

Fix is deploy-side, not code-side: ship a small landing page +
the existing test/whep-player.html as default content for the data
volume.

Pieces:
  deploy/truenas/core/static/
    index.html         — Dragon Fork-branded landing page; links
                         to Swagger and the WHEP player; live
                         /api status panel.
    whep-player.html   — same self-contained Pion subscriber that
                         lives at test/whep-player.html.
  deploy/truenas/core/seed-data.sh
    First-boot script. Copies /core/static/* into /core/data/
    only when the destination filename doesn't already exist —
    operator-supplied content is never clobbered, so this is a
    safe addition that respects upstream's contract that
    /core/data is operator-owned.
  deploy/truenas/core/Dockerfile
    COPYs the static dir and seed script into the runtime image,
    wraps the entrypoint as 'seed-data.sh && exec run.sh' (run.sh
    itself is unchanged from upstream).

Image size impact: ~15KB.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-03 12:44:04 +00:00