datarhei-dragonfork-core/deploy/truenas
Zac Gaetano 26991ec463
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
deploy: bundle the official Datarhei Restreamer UI
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
..
core deploy: bundle the official Datarhei Restreamer UI 2026-05-03 12:58:51 +00:00
docker-compose.yml feat(webrtc): add -rtp-host flag + TrueNAS Docker deploy 2026-04-17 09:05:37 -04:00
README.md feat(webrtc): add -rtp-host flag + TrueNAS Docker deploy 2026-04-17 09:05:37 -04:00

TrueNAS deploy — WebRTC PoC (M1)

Host-networked Docker stack that runs cmd/webrtc-poc on TrueNAS for manual end-to-end testing. Not wired into the Core binary.

Prereqs

  • Docker on the TrueNAS host (TrueNAS SCALE includes it)
  • LAN or public IP that clients can reach
  • One free TCP port (WHEP) and one free UDP port (RTP ingest)

One-time setup

# On TrueNAS:
sudo mkdir -p /mnt/NVME/Docker/dragonfork-webrtc-poc
cd /mnt/NVME/Docker/dragonfork-webrtc-poc

# Copy the repo's deploy/truenas/docker-compose.yml in here, and the
# whole repo (or just cmd/ + core/ + go.mod + vendor/) somewhere the
# Dockerfile build context can see. Simplest: clone the repo adjacent
# and symlink docker-compose.yml, or point `context:` at the clone.

cat > .env <<EOF
WHEP_PORT=45121
RTP_PORT=49248
STREAM_ID=test
PUBLIC_IP=10.0.0.25
EOF

Run

docker compose up -d --build
docker compose logs -f

You should see:

listening for RTP on 127.0.0.1:49248   # or 0.0.0.0:49248 on real deploy
WHEP listening on :45121 — POST /whep/test to subscribe

Verify from another host on the LAN

curl -i -X GET http://10.0.0.25:45121/whep/test   # → 405 (POST only)
curl -i -X POST http://10.0.0.25:45121/whep/nope  # → 404 (stream not found)

For a real end-to-end check, point the repo's test/publish.sh at 10.0.0.25 49248 and the whep-client at http://10.0.0.25:45121/whep/test.

Teardown

docker compose down

Security notes

  • WHEP is served plain HTTP. Put nginx-proxy-manager or Caddy in front for TLS — but note that WHEP itself is fine over HTTPS; the real media is DTLS-SRTP-encrypted regardless.
  • No auth in M1. Anyone who can reach the port can subscribe. M3 adds a token check.
  • The binary runs as PID 1 in scratch — no shell, no package manager, no privilege escalation path. Exit codes only.