restreamer-ui-v2/docker-entrypoint.sh
Cesar Mendivil 00e98a19b3 feat: add InternalWHIP component and associated tests
- Implemented the InternalWHIP component for managing WHIP server configurations.
- Added functionality to load live WHIP state from Core and handle OBS URL generation.
- Included polling for active streams and notifying parent components of state changes.
- Created comprehensive tests for the InternalWHIP component covering various scenarios including fallback mechanisms and state changes.

test: add integration tests for WHIP source component

- Developed end-to-end tests for the InternalWHIP component to verify its behavior under different configurations.
- Ensured that the component correctly handles the loading of WHIP state, displays appropriate messages, and emits the correct onChange events.

test: add Settings WHIP configuration tests

- Implemented tests for the WHIP settings tab to validate loading and saving of WHIP configurations.
- Verified that the correct values are sent back to the Core when the user saves changes.
- Ensured that the UI reflects the current state of the WHIP configuration after Core restarts or changes.
2026-03-14 12:27:53 -07:00

61 lines
2.6 KiB
Bash

#!/bin/sh
set -e
# ── Generate runtime config from env vars ────────────────────────────────────
CONFIG_FILE="/ui/build/config.js"
cat > "$CONFIG_FILE" <<EOF
/**
* Restreamer UI - Runtime Configuration (auto-generated by docker-entrypoint.sh)
*/
window.__RESTREAMER_CONFIG__ = {
CORE_ADDRESS: "${CORE_ADDRESS:-}",
YTDLP_URL: "${YTDLP_URL:-}",
FB_SERVER_URL: "${FB_SERVER_URL:-}",
FB_OAUTH_CALLBACK_URL: "${FB_OAUTH_CALLBACK_URL:-}",
YT_OAUTH_CALLBACK_URL: "${YT_OAUTH_CALLBACK_URL:-}",
};
EOF
echo "[entrypoint] config.js generated:"
cat "$CONFIG_FILE"
# ── Set YTDLP_HOST for Caddy reverse_proxy (default: external service or localhost) ─
export YTDLP_HOST="${YTDLP_HOST:-192.168.1.20:8282}"
# ── Set LIVEKIT_INGRESS_HOST for Caddy reverse_proxy (/w/* → livekit-ingress) ─
export LIVEKIT_INGRESS_HOST="${LIVEKIT_INGRESS_HOST:-192.168.1.20:8088}"
# ── Set EGRESS_HOST for Caddy reverse_proxy (/whep/* → egress server) ──────
export EGRESS_HOST="${EGRESS_HOST:-llmchats-whep.zuqtxy.easypanel.host}"
# ── Persist FB data directory ─────────────────────────────────────────────────
mkdir -p /data/fb
export FB_DATA_DIR="${FB_DATA_DIR:-/data/fb}"
# ── Start Facebook OAuth2 microserver + WebRTC relay in background ────────────
echo "[entrypoint] Starting FB OAuth2 + WebRTC relay server on :3002 ..."
FB_SERVER_PORT=3002 \
FB_DATA_DIR="$FB_DATA_DIR" \
FB_ENCRYPTION_SECRET="${FB_ENCRYPTION_SECRET:-restreamer-ui-fb-secret-key-32x!}" \
RTMP_HOST="${RTMP_HOST:-127.0.0.1}" \
RTMP_PORT="${RTMP_PORT:-1935}" \
RTMP_APP="${RTMP_APP:-live}" \
FFMPEG_BIN="${FFMPEG_BIN:-ffmpeg}" \
LIVEKIT_API_KEY="${LIVEKIT_API_KEY:-}" \
LIVEKIT_API_SECRET="${LIVEKIT_API_SECRET:-}" \
LIVEKIT_WS_URL="${LIVEKIT_WS_URL:-}" \
LIVEKIT_INGRESS_INTERNAL_URL="${LIVEKIT_INGRESS_INTERNAL_URL:-http://192.168.1.20:8088}" \
UI_BASE_URL="${UI_BASE_URL:-}" \
node /ui/server/index.js &
FB_PID=$!
echo "[entrypoint] FB server PID: $FB_PID"
# ── Wait briefly for FB server to bind ───────────────────────────────────────
sleep 1
# ── Start Caddy (foreground) ──────────────────────────────────────────────────
echo "[entrypoint] Starting Caddy on :3000 ..."
exec caddy run --config /ui/Caddyfile