Serve the daemon web UI from Nix packages (#1978)

* fix(nix): include daemon-web-ui in nix package

* fix(nix): verify web UI without packaging website sources

* test(nix): cover bundled web UI inputs

---------

Co-authored-by: Mohamed Boudra <boudra.moha@gmail.com>
This commit is contained in:
Liam Diprose
2026-07-14 18:50:09 +08:00
committed by GitHub
co-authored by Mohamed Boudra
parent 279e1aa91c
commit 3b078240a8
2 changed files with 11 additions and 4 deletions
+6 -1
View File
@@ -9,12 +9,15 @@ on:
- "flake.lock" - "flake.lock"
- "package.json" - "package.json"
- "package-lock.json" - "package-lock.json"
- "packages/app/**"
- "packages/expo-two-way-audio/**"
- "packages/highlight/**" - "packages/highlight/**"
- "packages/protocol/**" - "packages/protocol/**"
- "packages/client/**" - "packages/client/**"
- "packages/server/**" - "packages/server/**"
- "packages/relay/**" - "packages/relay/**"
- "packages/cli/**" - "packages/cli/**"
- "scripts/build-daemon-web-ui.mjs"
- "scripts/update-nix.sh" - "scripts/update-nix.sh"
- "scripts/fix-lockfile.mjs" - "scripts/fix-lockfile.mjs"
- ".github/workflows/nix.yml" - ".github/workflows/nix.yml"
@@ -64,7 +67,7 @@ jobs:
} }
trap cleanup EXIT trap cleanup EXIT
./result/bin/paseo-server --no-relay >"$WRAPPER_LOG" 2>&1 & PASEO_WEB_UI_ENABLED=true ./result/bin/paseo-server --no-relay >"$WRAPPER_LOG" 2>&1 &
DAEMON_PID=$! DAEMON_PID=$!
deadline=$((SECONDS + 30)) deadline=$((SECONDS + 30))
@@ -72,6 +75,8 @@ jobs:
if STATUS_JSON="$(./result/bin/paseo daemon status --json)" \ if STATUS_JSON="$(./result/bin/paseo daemon status --json)" \
&& jq -e '.connectedDaemon == "reachable"' <<<"$STATUS_JSON" >/dev/null; then && jq -e '.connectedDaemon == "reachable"' <<<"$STATUS_JSON" >/dev/null; then
echo "$STATUS_JSON" echo "$STATUS_JSON"
curl --fail --silent --show-error http://127.0.0.1:6767/ >"$PASEO_HOME/web-ui.html"
[[ -s "$PASEO_HOME/web-ui.html" ]]
exit 0 exit 0
fi fi
+5 -3
View File
@@ -30,9 +30,7 @@ buildNpmPackage rec {
relPath = lib.removePrefix (toString ./..) path; relPath = lib.removePrefix (toString ./..) path;
in in
# Exclude non-daemon workspace contents (keep package.json for workspace resolution) # Exclude non-daemon workspace contents (keep package.json for workspace resolution)
!(lib.hasPrefix "/packages/app/src" relPath) !(lib.hasPrefix "/packages/app/android" relPath)
&& !(lib.hasPrefix "/packages/app/assets" relPath)
&& !(lib.hasPrefix "/packages/app/android" relPath)
&& !(lib.hasPrefix "/packages/app/ios" relPath) && !(lib.hasPrefix "/packages/app/ios" relPath)
&& !(lib.hasPrefix "/packages/website/src" relPath) && !(lib.hasPrefix "/packages/website/src" relPath)
&& !(lib.hasPrefix "/packages/website/public" relPath) && !(lib.hasPrefix "/packages/website/public" relPath)
@@ -81,6 +79,7 @@ buildNpmPackage rec {
# Build all server packages in dependency order (defined in package.json) # Build all server packages in dependency order (defined in package.json)
npm run build:server npm run build:server
npm run build:daemon-web-ui
runHook postBuild runHook postBuild
''; '';
@@ -107,6 +106,9 @@ buildNpmPackage rec {
# CLI/server bin starts from $out. # CLI/server bin starts from $out.
cp package.json $out/lib/paseo/ cp package.json $out/lib/paseo/
# Web UI Assets
cp -r packages/server/dist/server/web-ui $out/lib/paseo/packages/server/dist/server/
# Create wrapper for the server entry point (for systemd / direct use) # Create wrapper for the server entry point (for systemd / direct use)
mkdir -p $out/bin mkdir -p $out/bin
makeWrapper ${nodejs}/bin/node $out/bin/paseo-server \ makeWrapper ${nodejs}/bin/node $out/bin/paseo-server \