diff --git a/deploy/truenas/core/Dockerfile b/deploy/truenas/core/Dockerfile index 8cc7a3c..0e51269 100644 --- a/deploy/truenas/core/Dockerfile +++ b/deploy/truenas/core/Dockerfile @@ -27,6 +27,23 @@ COPY . . ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64 RUN make release && make import && make ffmigrate +# ---- ui-builder ---- +# Builds the official Datarhei Restreamer UI (React 18 + MUI). Pinned +# to a specific tag so reproducible. PUBLIC_URL=./ makes asset +# references relative — the bundle then works when served from / or +# any subdirectory under Core's static-disk filesystem. +# +# Pulling from the public github mirror keeps the Forgejo runner's +# network footprint small; no auth required for clone. +FROM node:21-alpine3.20 AS ui-builder +ARG RESTREAMER_UI_REF=v1.14.0 +RUN apk add --no-cache git +WORKDIR /ui +RUN git clone --depth=1 --branch ${RESTREAMER_UI_REF} \ + https://github.com/datarhei/restreamer-ui.git . \ + && yarn install --frozen-lockfile --network-timeout 600000 \ + && PUBLIC_URL="./" GENERATE_SOURCEMAP=false yarn build + # ---- runtime ---- # Alpine with ffmpeg (Core shells out to it for every restream process). # Scratch isn't an option here because the process manager needs ffmpeg @@ -47,11 +64,17 @@ COPY --from=builder /src/ffmigrate /core/bin/ffmigrate COPY --from=builder /src/mime.types /core/mime.types COPY --from=builder /src/run.sh /core/bin/run.sh -# Dragon Fork landing page + browser WHEP player. Seeded into -# /core/data on first boot by /core/bin/seed-data.sh below; the seed -# is a no-op when the operator has already put content in /core/data. -COPY --from=builder /src/deploy/truenas/core/static/ /core/static/ -COPY --from=builder /src/deploy/truenas/core/seed-data.sh /core/bin/seed-data.sh +# Static content for /core/data, seeded on first boot by seed-data.sh. +# Stacking order: +# 1. Restreamer UI bundle (the React SPA — gives us index.html) +# 2. Dragon Fork extras (whep-player.html, etc.) — won't overwrite +# the UI's index.html (seed-data is no-clobber). +# +# The result: GET / serves the official Restreamer dashboard, and +# /whep-player.html serves the standalone WHEP smoke player. +COPY --from=ui-builder /ui/build/ /core/static/ +COPY --from=builder /src/deploy/truenas/core/static/ /core/static/ +COPY --from=builder /src/deploy/truenas/core/seed-data.sh /core/bin/seed-data.sh RUN chmod +x /core/bin/seed-data.sh && mkdir -p /core/config /core/data diff --git a/deploy/truenas/core/static/index.html b/deploy/truenas/core/static/index.html deleted file mode 100644 index ba88bf8..0000000 --- a/deploy/truenas/core/static/index.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - -Datarhei — Dragon Fork - - - - -
-

Datarhei Dragon Fork

-
a fork of datarhei/core with native WebRTC (WHEP) egress
-
-
-

Quick links

-
- API documentation (Swagger UI) -

Full HTTP API including /api/v3/process, /api/v3/whep/{id}, RTMP / SRT / config / metrics. Most endpoints require a JWT — issue one via POST /api/login.

-
-
- Browser WHEP player -

Self-contained subscriber for any process whose config.webrtc.enabled = true. Paste the WHEP URL and a JWT; press Subscribe.

-
- -

About this build

-
Loading…
- -

How to add a WebRTC stream

-
-

Create a process with "webrtc": { "enabled": true }. Once it starts, POST /api/v3/whep/<process-id> takes an SDP offer and returns an SDP answer.

-
-
- - - -