mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-11-23 17:42:09 +00:00
c1925fbdf1
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)