From dd639b697f3fb2266f004d0f969e9e63843fc265 Mon Sep 17 00:00:00 2001 From: ZGaetano Date: Wed, 6 May 2026 16:21:23 -0400 Subject: [PATCH] feat(ui): source UI build from wilddragon-restreamer-ui fork (issue #15) --- deploy/truenas/core/Dockerfile | 45 +++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/deploy/truenas/core/Dockerfile b/deploy/truenas/core/Dockerfile index f1f9166..237dcfa 100644 --- a/deploy/truenas/core/Dockerfile +++ b/deploy/truenas/core/Dockerfile @@ -6,7 +6,10 @@ # # Two-stage: # 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: # 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 # ---- 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. +# Clones wilddragon-restreamer-ui (the Wild Dragon UI fork) which +# provides apply-overlay.sh and all overlay files (branding, WebRTC +# WHEP controls). Then clones upstream restreamer-ui at the pinned +# tag, applies the overlay, and runs yarn build. # -# Pulling from the public github mirror keeps the Forgejo runner's -# network footprint small; no auth required for clone. +# WD_UI_REF: branch or tag in wilddragon-restreamer-ui to build from. +# RESTREAMER_UI_REF: upstream datarhei/restreamer-ui tag to base on. FROM node:21-alpine3.20 AS ui-builder +ARG WD_UI_REF=main ARG RESTREAMER_UI_REF=v1.14.0 + 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} \ - 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 -# build runs. apply-overlay.sh does the rsync + targeted seds; see -# 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 +WORKDIR /ui +RUN yarn install --frozen-lockfile --network-timeout 600000 -# 3. Install + build. PUBLIC_URL=./ keeps asset references relative so -# the bundle is portable across mount paths. -RUN yarn install --frozen-lockfile --network-timeout 600000 \ - && PUBLIC_URL="./" GENERATE_SOURCEMAP=false yarn build +# Apply Wild Dragon branding + WebRTC controls +RUN OVERLAY=/wd-ui/overlay UI=/ui /wd-ui/apply-overlay.sh + +RUN PUBLIC_URL="./" GENERATE_SOURCEMAP=false yarn build # ---- runtime ---- # 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 # 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. COPY --from=ui-builder /ui/build/ /core/static/ COPY --from=builder /src/deploy/truenas/core/static/ /core/static/