Files
BetterDesk/web-nodejs/services
UNITRONIX c1925fbdf1 feat(api): panel trust bridge and Go-owned device grouping
Stage P1 and P2 of docs/important/console-backend-strangler.md, following
the architecture question in discussion #496.

Trust bridge (P1): the console signs a short-lived HMAC-SHA256 statement
(method, path, subject, role, org, issue/expiry, nonce) with
PANEL_TRUST_SECRET. Go verifies the signature, the window, the replay nonce
and the endpoint, accepts it only from loopback or PANEL_TRUST_ALLOWED_HOSTS,
and takes the role from the database when the account still exists - so a
demoted user cannot keep an old session's role, and device/pro roles are
refused outright. With no secret the bridge is off and authentication is
exactly as before.

Panel grouping (P2): Go now owns the writes for device groups, their members
and ACL, folders, device->folder assignment and per-user device grants, and
creates the tables on SQLite it previously only read. Every write is
transactional, so the RustDesk sync reader never sees a half-applied ACL.
The console keeps its screens and response shapes through
services/panelGrouping.js. BACKEND_PANEL_GROUPING=node restores the old
writer without a redeploy; a 404/501/503 falls back automatically while a
400/403 is final and never retried through the other writer.

Both .env keys are appended by the updater when missing and never
overwritten, so existing installs keep working untouched.

Refs #496

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-11 15:35:11 +01:00
..