2 Commits

Author SHA1 Message Date
UNITRONIX a23b860d41 fix(scaling): make Relay Nodes Add/Edit actually save (#119)
Three independent bugs combined to make 'Add Relay' silently do nothing:

1. saveRelay() in public/js/scaling.js used raw fetch() without the panel's
   CSRF token, so every POST/PUT/DELETE was rejected by the CSRF middleware.
2. The catch block swallowed every error and the modal closed regardless of
   the response code, so the user never saw the rejection.
3. The relay/rules routes proxied to /scaling/relays on the Go server, but
   the Go server doesn't (yet) implement those endpoints — every request
   ended up as a 404 and the panel's relay table stayed empty forever.

Changes:

- routes/scaling.routes.js: drop the dead Go proxy, persist relay-node
  metadata and assignment rules in the existing 'settings' table
  (auth.db / DATABASE_URL). Strict input validation (host:port,
  Unicode-safe name, ranges for sessions/bandwidth/priority), 409 on
  duplicate addresses, capped at 100 relays / 200 rules. Health and
  metrics endpoints now return explicit 'live telemetry not yet
  available' placeholders instead of 500s.
- public/js/scaling.js: every mutating fetch() now sends x-csrf-token,
  validates inputs with a toast, parses JSON error bodies, only closes
  the modal and reloads on success. Falls back to alert() if the toast
  service is missing so users are never left guessing.
- views/scaling.ejs: info banner above the Relay Nodes table making
  clear that the list is operator-side metadata and that actual relay
  routing is configured via RELAY_SERVERS on the BetterDesk server.
- public/css/scaling.css: styles for the new info banner.
- lang/en.json, lang/pl.json: i18n keys for the banner, validation
  messages and success/failure toasts.

Note: the reporter also tried RELAY=... — only RELAY_SERVERS is read
by the Go server (see config/config.go:160). Worth surfacing in docs
in a follow-up.

Reported-by: @Elektrik1
2026-05-01 22:24:57 +02:00
UNITRONIX dd0889e3d6 Add SessionManager; update docs, i18n & CI
Introduce a SessionManager for relay-based remote sessions in the Tauri MGMT client: new SessionCommand API, start/stop/session input routing, clipboard/recording/quality controls, and notification read/dismiss state. Wire AppState with new mutexes and show main window on startup. CI: add SBOM generation (anchore) and Trivy vulnerability scan steps. Misc: change console Docker DB path, large README/CHANGELOG updates (chat E2E, unattended access/WOL, i18n expansion, CDAP/SDK docs), and many web-nodejs assets/locales/routes/views/services and server-side changes.
2026-04-05 13:42:07 +02:00