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

This commit is contained in:
Zac Gaetano 2026-05-06 16:21:23 -04:00
parent 917225c994
commit dd639b697f

View file

@ -6,7 +6,10 @@
# #
# Two-stage: # Two-stage:
# 1. builder: compile a static Go binary (CGO off — no dynamic libs) # 1. builder: compile a static Go binary (CGO off — no dynamic libs)
# 2. runtime: alpine with ffmpeg for the subprocess path # 2. ui-builder: clone wilddragon-restreamer-ui, apply its overlay on
# top of upstream datarhei/restreamer-ui v1.14.0, yarn build.
# See https://forge.wilddragon.net/zgaetano/wilddragon-restreamer-ui
# 3. runtime: alpine with ffmpeg for the subprocess path
# #
# Usage via compose: # Usage via compose:
# docker compose -f deploy/truenas/core/docker-compose.yml up -d --build # docker compose -f deploy/truenas/core/docker-compose.yml up -d --build
@ -28,32 +31,34 @@ ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64
RUN make release && make import && make ffmigrate RUN make release && make import && make ffmigrate
# ---- ui-builder ---- # ---- ui-builder ----
# Builds the official Datarhei Restreamer UI (React 18 + MUI). Pinned # Clones wilddragon-restreamer-ui (the Wild Dragon UI fork) which
# to a specific tag so reproducible. PUBLIC_URL=./ makes asset # provides apply-overlay.sh and all overlay files (branding, WebRTC
# references relative — the bundle then works when served from / or # WHEP controls). Then clones upstream restreamer-ui at the pinned
# any subdirectory under Core's static-disk filesystem. # tag, applies the overlay, and runs yarn build.
# #
# Pulling from the public github mirror keeps the Forgejo runner's # WD_UI_REF: branch or tag in wilddragon-restreamer-ui to build from.
# network footprint small; no auth required for clone. # RESTREAMER_UI_REF: upstream datarhei/restreamer-ui tag to base on.
FROM node:21-alpine3.20 AS ui-builder FROM node:21-alpine3.20 AS ui-builder
ARG WD_UI_REF=main
ARG RESTREAMER_UI_REF=v1.14.0 ARG RESTREAMER_UI_REF=v1.14.0
RUN apk add --no-cache git RUN apk add --no-cache git
WORKDIR /ui
# 1. Pull upstream restreamer-ui at the pinned tag. # Wild Dragon UI fork: overlay files + apply-overlay.sh
RUN git clone --depth=1 --branch ${WD_UI_REF} \
https://forge.wilddragon.net/zgaetano/wilddragon-restreamer-ui.git /wd-ui
# Upstream React SPA at the pinned version
RUN git clone --depth=1 --branch ${RESTREAMER_UI_REF} \ RUN git clone --depth=1 --branch ${RESTREAMER_UI_REF} \
https://github.com/datarhei/restreamer-ui.git . https://github.com/datarhei/restreamer-ui.git /ui
# 2. Layer Wild Dragon overlays on top of the upstream tree before the WORKDIR /ui
# build runs. apply-overlay.sh does the rsync + targeted seds; see RUN yarn install --frozen-lockfile --network-timeout 600000
# deploy/truenas/core/ui-overlay/apply-overlay.sh for the contract.
COPY deploy/truenas/core/ui-overlay /overlay
RUN OVERLAY=/overlay UI=/ui /overlay/apply-overlay.sh
# 3. Install + build. PUBLIC_URL=./ keeps asset references relative so # Apply Wild Dragon branding + WebRTC controls
# the bundle is portable across mount paths. RUN OVERLAY=/wd-ui/overlay UI=/ui /wd-ui/apply-overlay.sh
RUN yarn install --frozen-lockfile --network-timeout 600000 \
&& PUBLIC_URL="./" GENERATE_SOURCEMAP=false yarn build RUN PUBLIC_URL="./" GENERATE_SOURCEMAP=false yarn build
# ---- runtime ---- # ---- runtime ----
# Alpine with ffmpeg (Core shells out to it for every restream process). # Alpine with ffmpeg (Core shells out to it for every restream process).
@ -81,7 +86,7 @@ COPY --from=builder /src/run.sh /core/bin/run.sh
# 2. Dragon Fork extras (whep-player.html, etc.) — won't overwrite # 2. Dragon Fork extras (whep-player.html, etc.) — won't overwrite
# the UI's index.html (seed-data is no-clobber). # the UI's index.html (seed-data is no-clobber).
# #
# The result: GET / serves the official Restreamer dashboard, and # The result: GET / serves the Wild Dragon dashboard, and
# /whep-player.html serves the standalone WHEP smoke player. # /whep-player.html serves the standalone WHEP smoke player.
COPY --from=ui-builder /ui/build/ /core/static/ 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/static/ /core/static/