Skip to content

ADFA-4839: dashboard packaging — compiled JS, loopback bind, supervision, dev push - #254

Merged
luisguzman-adfa merged 2 commits into
mainfrom
feat/ADFA-4839-dashboard-packaging
Jul 24, 2026
Merged

luisguzman-adfa merged 2 commits into
mainfrom
feat/ADFA-4839-dashboard-packaging

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

Phase 2 hardening of the in-server dashboard (ADFA-4832). Batched into the single Phase 2 rootfs rebuild alongside ADFA-4838.

  • Compiled JS: tsconfig outDir=dist + build/start scripts; the dash-node pdsm service now runs node dist/server.js (was npx ts-node server.ts) with a respawn supervisor (auto-restart on crash, PID-tracked so stop ends the loop cleanly before killing the server) and a health probe (GET /api/kiwix/jobs). The bootstrap runs yarn build after yarn install.
  • Path fix: views/public resolve via process.cwd() (the service cd's into /library/dashboard), so they hold once __dirname becomes .../dist.
  • Loopback bind: the server listens on 127.0.0.1 — nginx already proxies from loopback, so :4000 no longer listens on the device's network interfaces (closes the network-reachable :4000).
  • Dev iteration: tools/dev-push-dashboard.sh copies static/dashboard into an installed rootfs, rebuilds and restarts — iterate without the ~2h rebuild (tar excludes node_modules/dist so the native better-sqlite3 isn't clobbered).

Validation: TypeScript compile confirmed (tsc emits dist/ cleanly, no test files leaked). Not runnable in the sandbox (native better-sqlite3 won't build here), so the runtime under plain node, the supervisor stop/health shell paths, and the provisioning yarn build step need on-device verification in the rebuild (or via the dev-push script).

…ion, dev push

Phase 2 hardening of the in-server dashboard.

- Run compiled JS: tsconfig outDir=dist + 'build'/'start' scripts; dash-node service
  now runs 'node dist/server.js' (was 'npx ts-node server.ts') with a respawn supervisor
  (auto-restart on crash, PID-tracked so stop ends the loop cleanly) and a 'health' probe
  (GET /api/kiwix/jobs). Bootstrap runs 'yarn build' after install.
- Resolve views/public via process.cwd() (the service cd's into /library/dashboard) so
  paths hold once __dirname is .../dist.
- Bind the server to 127.0.0.1: nginx already proxies from loopback, so :4000 no longer
  needs to listen on the device's network interfaces (closes network-reachable :4000).
- tools/dev-push-dashboard.sh: push static/dashboard into an installed rootfs + rebuild +
  restart, for iterating without the ~2h rootfs rebuild (tar excludes node_modules/dist).

Compile validated (tsc emits dist cleanly). Runtime under plain node (native better-sqlite3),
the supervisor stop/health shell paths, and the provisioning 'yarn build' need on-device
verification in the rebuild.
@luisguzman-adfa
luisguzman-adfa merged commit 9a4846e into main Jul 24, 2026
4 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the feat/ADFA-4839-dashboard-packaging branch July 24, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant