Commit Graph

296 Commits

Author SHA1 Message Date
UNITRONIX b9f721ca7c feat(rdclient): centered multi-monitor thumbnail picker
Add RustDesk multi-capture overview with live aspect-correct tiles, focus selection, mosaic All monitors, and a + tile for virtual displays. Ships via panel update.

Thanks: INSOLVE (Honorary); betterde.sk (@trybetterdesk); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-23 19:56:53 +01:00
Knienartowicz 61729eed9d fix(update): generate a missing PANEL_TRUST_SECRET on install and update
The panel trust bridge is off unless `PANEL_TRUST_SECRET` has a value, and
the template shipped it blank. The updater appends missing keys from the
template, so an install that predates the bridge ended up with
`PANEL_TRUST_SECRET=` and the console could not sign panel statements.
The Agents page then reported that address-book names were unavailable
because the console could not securely reach the Go address-book service.

`mergeEnvFile` now fills empty auto-generated secrets after merging, and
`buildEnvSubstitutions` resolves the template placeholder so fresh installs
get a real key. A non-empty value is never overwritten, and the key is
listed in PROTECTED_KEYS so a later overwrite cannot happen. Co-located
console and Go need nothing else: loopback is always allowed by
`panelTrustPeerAllowed`. Only split deployments need
`PANEL_TRUST_ALLOWED_HOSTS`, which the template now says explicitly instead
of implying it is required everywhere.

Ships via panel update (Settings -> Updates). Verify: on an install whose
`.env` has a blank `PANEL_TRUST_SECRET`, run an update and confirm the key
has a 64-character value and the Go log shows
`[panel-trust] enabled for panel-originated requests`.

Thanks: INSOLVE (Honorary); betterde.sk (@trybetterdesk, Bronze); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-23 11:30:54 +01:00
UNITRONIX 96845d377e feat(rdclient): UX36 shell and harden device-scope auth
Restyle RdClient login/dashboard to UX36 (branding, language menu, toolbar, OS marks), hide banned peers from the address book, and enforce folder/group scope on remote pages, Mesh routes, sessions, and peer-bound WebSocket upgrades.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-22 02:40:27 +01:00
UNITRONIX 677a1b0118 fix(panel): close trust fallback and improve agent recovery
Prevent panel-trust requests from falling through to the bridge API key, which could associate address-book writes with the wrong operator. Add a device identity reset path for reinstalled clients and clarify generic versus preconfigured agent distribution.

Refs #510

Refs #520

Refs #517

Reported-by: @PeterLinuxOSS

Reported-by: @mh254

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-22 01:41:28 +01:00
UNITRONIX 23c928a0a4 fix(generator): make agent release import idempotent
Refs #515

"Import latest release" re-downloaded all six assets (~181 MB) and then died
on rename(staging, destination) with ENOTEMPTY when the tag was already
imported. rename(2) cannot replace a non-empty directory, and nothing removed
the staging directory, so each attempt leaked ~181 MB. One install grew from
181 MB to 722 MB.

  - return the cached release when the tag is already installed, after
    re-verifying the stored signature and every asset checksum, so a
    tampered or partially deleted cache is re-imported instead of served
  - store the signed manifest bytes as manifest.signed next to manifest.sig
    and SHA256SUMS, because manifest.json is enriched with release_tag and
    imported_at and no longer matches the signature
  - wrap staging create/write/swap in try/finally; cleanup only ever targets
    the staging path
  - move a stale or forced tag aside before the swap, so ENOTEMPTY cannot
    happen and a partial state is impossible
  - validate release.tag_name before it becomes a path segment under root();
    only a prefix check guarded it before
  - expose already_imported in the API response and accept {"force": true}
    for a deliberate re-import

Measured on a real install: the second import returns in ~0.8 s with
alreadyImported=true and no leftover .tmp-* directories.

Reported-by: @mh254

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-20 08:57:08 +01:00
UNITRONIX e11f7865c6 fix(panel): render 403/404/500 without i18n locals
Refs #513

A user denied by a panel section policy got Express's bare "Internal Server
Error" instead of a 403 page, so the account, the login and the server all
looked broken at once.

Two independent causes, both fixed:

  - middleware order: panelAccessGuard renders errors/403 on a denial, but
    initI18n() was mounted after it, so res.locals.lang, appName and _()
    did not exist yet and the template threw
  - the error templates used lang, appName and _() unguarded, so the
    subsequent 500.ejs render threw the same way and Express fell back to
    its default page

initI18n() now mounts before loadEffectivePermissions / loadEffectivePolicy /
panelAccessGuard, which is safe because it still runs after cookieParser()
and the session middleware. The three error templates compute defensive
locals, so they render with no locals at all; 403.ejs falls back to the
title/message the guard already passes, and 500.ejs still reveals details
only under NODE_ENV=development.

Covered by tests/errorTemplates.render.test.js, which renders each template
with ejs.render(src, {}) so an unguarded local cannot come back.

Reported-by: @mh254

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-20 08:57:08 +01:00
UNITRONIX 18ed13074f fix(panel): repair user group policies and the Web Remote viewer
Refs #512
Refs #514

Two panel regressions that each made a working feature look broken.

#512 — user groups could not be saved or deleted:
panelAccessPolicyService.resolveCeilingForSubject() calls
db.getUserGroupMembers(), which existed in neither the SQLite nor the
PostgreSQL adapter, nor in the services/database.js facade. Any group save
or delete failed with "db.getUserGroupMembers is not a function" after
leaving a half-created group row behind. The suite stayed green because
tests/panel-access.ceiling.test.js mocks the function, so no test reached
the real adapter.
  - add getUserGroupMembers(guid) to both adapters and the facade
  - new regression test uses the real SQLite adapter end to end
  - the empty-group ceiling clamp is intentionally unchanged (audit H7);
    the group list now explains why levels are clamped to none

#514 — Web Remote did nothing:
three independent defects, so fixing one left the next one visible.
  - window.open ran inside a 300 ms timer, outside the user gesture, so
    Chrome blocked it silently; the window is now opened synchronously
  - the window was pointed at /remote/, the device picker, which never
    loads remote.js and so never consumed the queued session; it now
    navigates straight to /remote/<deviceId>, where the id is in the URL
    and no queue handoff is needed
  - an empty password + Connect returned without feedback; it now shows a
    localized hint and clears it on input
  - explicit width/height so the small-screen gate does not hide the viewer
  - new contract test locks in all three properties

New i18n keys (users.group_no_members_ceiling_hint,
remote.password_empty_hint) are translated in all 26 locales. Also fixes
the French user-group member count, which had German text.

Reported-by: @mh254

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-20 08:57:08 +01:00
UNITRONIX 14655b0414 fix(update): reconcile manually deployed server binaries
Stop before a direct copy into a root-owned server binary directory and return the documented root deploy guidance. When an operator completes the validated deploy helper, clear the stale-binary warning only after the source and service binaries match byte-for-byte.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-18 23:26:55 +01:00
UNITRONIX 4806dcfa1f fix(devices): use Go address book as alias source
Route panel alias reads and writes through the Go-owned RustDesk address book so legacy SQLite, consolidated SQLite, and PostgreSQL deployments do not diverge into auth.db. Preserve the full legacy document and serialize panel/client writes.

Refs #510

Reported-by: @PeterLinuxOSS

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-18 22:40:40 +01:00
UNITRONIX 7a2725b1bb feat(devices): show per-user address book aliases
Expose each operator's RustDesk legacy address-book alias in the Devices list and preserve the full AB document when editing it.

Refs #510

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-18 18:22:01 +01:00
UNITRONIX 154279f7ed fix(ui): compact Devices/Dashboard chrome and stop sticky overlaps
Tighten the Devices rail and toolbar (status select, quieter create actions,
RDP/VNC under groups), compact the dashboard client-config tools, protect the
Default device group, and keep Settings topic tabs above branding content.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-18 15:13:13 +01:00
UNITRONIX b1f72fcac0 fix(ci): green the failing workflows and close four open advisories
Web Console CI and Installer CI both ran tests/updateService.channel.test.js,
which spied on the exported updateService.checkGoAvailable while
runUpdatePreflight called the module-local function. The mock never applied, so
the assertion depended on the runner Go version: green on older Go, red on CI.
runUpdatePreflight now calls through module.exports, which keeps the seam
spy-able and makes the test deterministic. One change fixes both workflows.

Security:
- GHSA-98mc-f6p7-gj85: bdRelay compared relay tokens with timingSafeEqual
  without a length check; a wrong-length token threw RangeError out of an
  unguarded connection listener and killed the whole console. Lengths are
  checked first, values coerced, and the listener keeps failures local.
- GHSA-7j6j-h4qf-86mq: CDAP API key auth ignored expires_at, so an expired key
  kept authenticating agents while the REST path rejected it. Expiry is now
  enforced on both paths.
- GHSA-22mg-g52q-x75c: /ws/remote-viewer/:device_id checked device.connect but
  not device scope, so an operator could view a device outside their scope.
  Added the userCanAccessDevice check used by remoteTargetGateway; a scope miss
  answers 404 like a missing device.
- GHSA-qxwx-jg77-5v67: the startup banner logged the PostgreSQL DSN with its
  password. config.RedactedDBPath now strips credentials.

CI: all actions moved to their Node 24 majors with SHA pins, concurrency groups
and timeouts added throughout, a blocking i18n gate added to Web Console CI, and
a GHCR preflight added so a registry authorization outage reports as
infrastructure instead of a false build failure. The orphaned "Web UI CI"
registration (no workflow file in any branch) was disabled.

i18n: translated the 58 users.access_* keys into all 24 non-English locales and
dropped four legacy meta.* keys from fr/zh-TW.

Reported-by: @evanonym0us
Reported-by: @kta1kri
Reported-by: @Marc-T-robotics
Reported-by: @KolosovV

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-18 01:42:05 +01:00
UNITRONIX 5a169e528b feat(rdclient): add multi-session file transfer
Add friendly monitor labels, queued multi-session viewer startup, and dual-side file transfer pickers for local and remote sessions. Remote-to-remote file copies are streamed through the operator browser with a 256 MB per-file safety limit.\n\nThanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-18 01:00:23 +01:00
UNITRONIX 7b88fe3b03 fix(compat): harden RustDesk 1.5 relay and proto parity
Refs #504
Refs #505

Fix force-relay target advertisement for RustDesk 1.5 relay allowlists, sync additive 1.5.x protocol fields, filter locked strategy keys, and add translated deployment guidance plus regression coverage.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-18 00:40:17 +01:00
UNITRONIX 185a36d9fb feat(rdclient): add bidirectional rich clipboard bridge
Add shared text, HTML, and PNG clipboard state across the operator and remote sessions. Preserve clipboard content when browser permissions block OS writes, support multi-format RustDesk messages, and expose explicit send/copy actions in the viewer.\n\nTests: npm test -- --runInBand; npm run check:frontend\n\nThanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-18 00:30:50 +01:00
Mateusz Ratajczak d67c4559cf Repair drag and drop on touchscreen devices 2026-11-17 13:18:42 +01:00
Knienartowicz 95f8ea6964 fix(signal): advertise rendezvous servers, never relay, in ConfigUpdate
handleTestNat() built ConfigUpdate.rendezvous_servers from
GetRelayServers(), so every TestNatResponse told the client that its *ID
server* was the relay endpoint. On this instance RENDEZVOUS_SERVERS is unset,
so the list contained exactly `85.14.70.12:21117` and was sent 113 times
today.

Newer RustDesk clients honour ConfigUpdate. Reconfiguring the signal socket to
the relay port makes the host stop answering RequestRelay altogether: the panel
connected as initiator, hbbr logged `Connection ... for UUID` and then
`Pair timeout` 30 s later, and the browser saw "Relay connection closed
(WebSocket 1005)". Peer 275129227 (RustDesk 1.4.9) showed exactly that
signature: TestNatRequest, heartbeats, and no relay connection ever.

- config: add GetRendezvousServers() which parses RENDEZVOUS_SERVERS and
  appends SignalPort, with the same validation as GetRelayServers().
- signal: handleTestNat() now advertises only configured rendezvous servers and
  omits ConfigUpdate entirely when none are configured.
- web: relay endpoints are always emitted as host:port (resolveRustDeskEndpoints,
  keyService, customTxtBuilder, agentBundleService, generator config). A bare
  relay host made clients fall back to the API port, which hbbr cannot pair.

Refs #329

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-17 09:54:48 +01:00
UNITRONIX 790b65fd32 fix(enrollment): keep stock clients and Support Agents able to enroll (C1 follow-up)
Hardening device registration must not lock out the clients the product is built
for. Stock RustDesk clients and Support Agents cannot produce an Ed25519
signature, so `POST /api/bd/register` now accepts three equivalent proofs of
admission instead of demanding a signature:

1. an `approved` row in `pending_registrations` for this exact device id
   (operator clicked Approve in the Registrations tab),
2. a single-use enrollment token issued by `POST /api/bd/enroll`,
3. an Ed25519 proof of possession of the key being bound.

Banned and soft-deleted ids are still refused before any write, and an existing
device's key/uuid can only be rotated by the key it already has — admission
proves identity, not ownership of an established identity. The refusal is a
single neutral error (`403 enrollment_proof_required`) so a caller cannot probe
which admission method is missing.

Verified end to end on the test host: register before approval -> 403
enrollment_proof_required; register-request -> pending; operator approval;
register with no signature -> 200; template + enroll -> 200; register with the
token -> 200; a second device reusing the same token -> 403.

Also fixed, because it silently broke this same model:

- `POST /api/bd/enroll` and the agent-template tab called `db.get()` /
  `db.query()`, which the database facade never exposed, so every enrollment
  token answered 401. Added `listAgentTemplates` / `getAgentTemplateByToken` /
  `createAgentTemplate` to both adapters and `lib/agentTemplates.js`.
- PostgreSQL installs had no `agent_templates` table (it only existed in SQLite
  auth.db). It is now created by the adapter schema on both backends with
  `enrolled_device_id` / `enrolled_at`, so a token is single-use and bound to one
  device.

Tests: `tests/bd-register.enrollment.test.js` (8 cases covering approval,
pending, rejected, token, token reuse, no-admission, later heartbeats and
removed devices) plus the existing hardening suite (11 cases).

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-13 21:45:07 +01:00
UNITRONIX 80787c7121 feat(users): allow changing a local account's username (#498)
The panel could not rename an administrator: PATCH /api/users/:id accepted only
role, password and email, and the edit dialog locked the username field.

`username` is not just a label. It is the primary key of address_books
(username, ab_type) and the lookup key in org_users and
strategy_assignments.target_key. Renaming only the users row would orphan the
address book and silently detach organisation membership and strategy
assignments, so the rename cascades in one transaction:

- Go: db.Database.RenameUser (SQLite + PostgreSQL) updates users, moves
  address_books, follows org_users and strategy_assignments.target_key, deletes
  a stale lockout on the target name and moves login_attempts. Collisions return
  ErrUsernameTaken (409), bad names ErrInvalidUsername (400).
- Go API: PATCH /api/users/{id} accepts username, refuses LDAP/OIDC accounts
  (the provider owns the name) and audits user_renamed.
- Console: db.renameUser with the same cascade for the auth.db store, the route
  validates the name, surfaces 409/400, records user_renamed and best-effort
  syncs to Go.
- UI: the username field is editable for local accounts with a warning that the
  address book and group assignments follow and that the user is signed out.
- Account names now accept A-Z a-z 0-9 . _ @ - (3-64 chars) in the panel, the Go
  server and the helper text, so names imported from LDAP/OIDC survive a rename.

Tests: betterdesk-server/db/rename_user_test.go (cascade, collision, invalid
name, missing user, format) and web-nodejs/tests/usernameRename.test.js
(cascade order, lockout handling, missing-table tolerance, format).

Refs #498

Reported-by: @Yamada993

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-13 21:30:32 +01:00
UNITRONIX 0429c4080d fix(security): close the 2026-11-13 audit findings (C1-C3, H1-H10, M4-M6/M8/M11)
Full report and per-finding status in docs/security/AUDIT_2026-11-13.md.

Critical
- POST /api/bd/register now requires an Ed25519 proof of possession for a
  first registration and for any public_key/uuid rotation, rejects banned and
  soft-deleted ids before writing, and is rate limited per IP. Knowing a device
  id is no longer enough to flood inventory, resurrect a removed device or
  swap its key.
- Signal RegisterPk with old_id is applied only when the supplied key or the
  machine UUID matches the stored peer, so an unauthenticated caller can no
  longer move and delete someone else's row. Stock RustDesk change-ID (no pk,
  matching UUID) still works.
- The Go server runs as betterdesk from /usr/local/bin/betterdesk-server and
  /opt/rustdesk is no longer group-writable at the directory level, so the
  console user cannot replace the binary. DSNs and the bootstrap admin password
  are gone from systemd units.

High
- /metrics and /api/health/detail require the metrics allowlist or an API key;
  public /api/health returns only {status, version}.
- Panel login consults the shared account-lockout tracker (429 + Retry-After);
  delegated 2FA fails closed; pending-2FA state is written after session
  regeneration; GET /logout no longer destroys the session.
- HTTP->HTTPS redirect no longer trusts the Host header or absolute request
  targets.
- Desktop login no longer pre-renders the account list; a rate-limited
  /login/lookup returns at most 8 prefix matches.
- Panel section overrides are clamped to the role ceiling, so a per-user policy
  cannot grant a permission the role lacks.
- /api/devices/:id/* is covered by one scope guard (tags, rename, change-id,
  restore, access-policy).
- applyUpdate verifies an optional Ed25519-signed manifest and can be made
  fail-closed with UPDATE_REQUIRE_SIGNED_MANIFEST=true.
- The privileged broker no longer manages DATABASE_URL, SESSION_SECRET,
  DEFAULT_ADMIN_PASSWORD, UPDATE_GITHUB_TOKEN, API_KEY_PATH,
  ORG_PEER_VAULT_KEY, SMTP_PASS or API_TOKEN_EXPIRY_DAYS, and reports a
  protocol version so a stale broker is detectable.
- Peer status/online/metrics/linked/policy endpoints require device.view and
  enforce organisation scope.

Medium / low
- Backup restore enforces a decompressed-size and entry-count budget.
- limit/offset clamped on the console and in the Go audit handlers; public
  audit writes are rate limited.
- Data embedded in inline <script> blocks goes through safeJsonScript; the
  pairing page escapes the suggested host.
- Go toolchain and builder images bumped to go1.26.11 (GO-2026-6859); the
  console requires at least that version to rebuild the server.
- Workflow Actions pinned to commit SHAs; Dependabot tracks github-actions.
- Restart tokens compared with crypto.timingSafeEqual.

Tooling
- scripts/security/pentest-local.sh / .ps1 local security gate.
- scripts/check-security-regressions.sh CI gate (unit credentials, inline
  script escaping), wired into Secret Scan.
- Two long-standing red tests fixed (platform loopback address, missing
  panelAccessPolicyService mock).

Verified on the test host: /metrics 401, /api/health/detail 401,
/api/peers/online 401, desktop login ships an empty user list, unproven
register returns 403, Host spoofing redirects to the configured public host,
and the broker reports version 2 with a secret-free manifest.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-13 21:25:10 +01:00
UNITRONIX 5896cf13cb Merge origin/dev into hotfix/repair-loading-installers-agent
Keep the external portal.js CSP fix from #499 while preserving
diagnostic empty-state copy from dev, and update related tests.

Refs #475
Reported-by: @gelunet

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-12 13:37:07 +01:00
Mateusz Ratajczak 9ad5144614 Repair portal page - error with loading... 2026-11-12 12:36:56 +01:00
UNITRONIX 01fb4d0470 fix(console): resolve the pairing address through the helper that exists
The pairing route called getPublicEndpoints() on rustDeskPublicEndpointsService,
which does not export it. The call sat in a try/catch whose comment said "the Go
server reports the authoritative host on mint", so the failure was invisible: the
page rendered an empty address, and the client-side code filled it in from Go —
which, behind a reverse proxy, answers with the address the panel used to reach
the server (127.0.0.1 on the test host). A user following that would try to pair
with their own machine.

The route now uses clientConfigHost.resolveClientFacingHost(req), the same helper
the dashboard's client-config card uses, so both surfaces show one value. The
test pins the helper and fails if the old, non-existent call returns.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-11 20:25:37 +01:00
UNITRONIX bf01332431 fix(console): never hand the user a loopback pairing address
The pairing page rendered the address the panel resolved from its public
endpoint settings, then overwrote it with whatever the Go server answered.
Behind a reverse proxy that answer is the address the panel used to reach the
server - 127.0.0.1 on the test host - so the page would tell a user to pair
with their own machine.

The rendered address now wins. The server's value is used only when the page
has nothing usable, and a loopback value is never shown: the page falls back
to "ask your administrator" instead of an address that cannot work.

Guarded in the pairing page tests.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-11 20:23:23 +01:00
UNITRONIX 5f2f43a0f3 feat(console): the pairing page hands out a code instead of asking for a host
The page looked like client setup: a "Server address" field for the operator
to fill in, and a code only after pressing a button. That reads as pairing
the panel with a server, which is backwards — this console IS the server.
The operator's whole job is to give a code to whoever installs the client.

The page now mints a code on arrival and shows it as the largest element,
grouped ABC-DEF so it can be read aloud, with a countdown, a copy button and
a regenerate button. Under it sits the only other value the user needs: the
server address to type. Label and address inputs are gone; the label a code
carries is empty by default because nobody asked for one.

The client already accepts exactly this (BetterDesk-Client, "Connect with a
code": address plus six characters), and the Go endpoints are unchanged —
POST /api/pairing/codes, GET for the active list, DELETE to revoke.

common.refresh was missing in all 26 locales, so the refresh button rendered
its raw key; it and the new pairing strings are added everywhere with real
translations.

tests/pairing-page.test.js pins the two things that went wrong: the page must
mint a code on load, and it must not ask the operator for a server address.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-11 20:22:20 +01:00
UNITRONIX 65637e856e fix(console): give the inline scripts their CSP nonce
The public download portal stayed on "Loading available installers…"
forever. The page renders its fetch in an inline <script> with no nonce,
while the console sends script-src 'self' plus a per-request nonce and no
'unsafe-inline' — so the browser blocked the script and the fetch never ran.
The API behind it was fine (six installers for the current release).

Two more views had the same defect and would fail the same way: the guest
remote page, which seeds window.__guestAccess/__guestToken, and resource
control, which calls ResourceControl.init().

All three now interpolate cspNonce, which middleware/security.js already
publishes to res.locals for every request.

tests/csp-inline-scripts.test.js walks the whole views tree instead of
listing known files, and also asserts the policy keeps requiring a nonce
rather than being relaxed with 'unsafe-inline'.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-11 20:16:25 +01:00
UNITRONIX 858d9fe7fb fix(console): give the settings search a field of its own
The search row was a borderless input sitting on a full-width rule, so the
focus ring of the input painted a floating frame across the whole content
column. It read as a broken box, wider than the panels under it and jammed
against the topic tabs.

The row is now the field: one bordered box capped at 520px (full width on a
phone), with the row carrying the focus state through :focus-within so the
ring frames something the user can see. The icon and the clear button keep
their size, so only the text shrinks on narrow screens.

Guarded in the beta layout tests.

Based-on: @rathlinus UX redesign (Refs #493, #495)

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-11 20:13:36 +01:00
UNITRONIX 10313ab0eb fix(console): centre the icons in their boxes again
Every icon inside a square or circle container sat in the top-left corner:
the toolkit tools, and the same pattern on Users, Scaling and Resource
Control.

Cause is load order, not a missing rule. The component sheets set
display: flex with align-items/justify-content: center on their icon box,
but ux36/base.css loads after them and declared a plain
.material-icons { display: inline-block; font-size: 18px }. Same
specificity, later file, so the base rule won the tie and the box stopped
being a flex container: the glyph fell back to inline flow in the corner,
and its size was forced from 24px to 18px.

The base rule is now wrapped in :where(), which gives it zero specificity.
The font setup still applies, but a component that centres its icon keeps
its own display and size. Pages that never set either still inherit 18px.

Guarded by a test that asserts the :where() wrapper, that no plain
.material-icons selector reappears in base.css, and that .tool-icon keeps
its flex centring.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-11 20:10:42 +01:00
UNITRONIX 2fbf39beea fix(console): pair agent opens its page, and the dialog stops blocking input
Two defects behind one report.

Navigation: "Pair agent" (and the agents page button) opened the Dashboard
behind a dialog, so asking to pair showed the whole overview, and the
dialog sat over a page it does not belong to. /?activateAgent=1 now
redirects to /pairing, the page that mints the code, and the sidebar has a
single pairing entry pointing there. The separate "Pairing" entry in the
clients group is gone, and so is the activate-agent nav key, which existed
only to mark the dashboard as active.

Blocking: the dialog was opened with an inline display: flex while the beta
sheet had already set .modal-overlay to display: none with opacity 0 for the
closed state. An inline display wins, so the overlay became a visible layer
that the sheet still painted transparent - every click landed on it and the
panel looked frozen. Both dashboard dialogs (pairing code and QR scanner) are
now toggled with the same class the rest of the console uses; no inline
display is left in dashboard.js.

Tests: the pairing UI suite now asserts the redirect, the class-based
toggle, and that no surface links to the old deep link. Its harness also
gained the locals the shell sidebar needs, which is why it failed on the
baseline before.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-11 20:07:50 +01:00
UNITRONIX 7f83dc4aeb fix(console): drop the leftover strategies link from the Devices page
A quiet link to /strategies was left behind when the strategies card moved
off the Devices page. In the beta grid its row rule placed it above the page
header, so the title and the actions read as if they were anchored to the
bottom of the list instead of the top.

The link is gone: strategies have their own sidebar entry, and a second
pointer on the device list only pushed the header down. Its rules are
removed from both sheets, and the tests now assert the Devices page carries
neither the card, the list, the button nor the link, and that the header is
the first block after the page container.

Based-on: @rathlinus UX redesign (Refs #493, #495)

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-11 20:03:29 +01:00
UNITRONIX 87811fa07a fix(console): left-align the Devices header actions
"Add RDP/VNC target" and "Sync status" sat at the far right edge of the
Devices header, reading as unrelated chrome. Two v2 rules put them there:
the header's justify-content: space-between and margin-inline-end: auto on
the title. The beta sheet now justifies the header to the start and drops
the auto margin, so title, count and both buttons form one left-aligned
group; the actions keep their own gap so the pair stays together.

Guarded in the beta layout tests.

Based-on: @rathlinus UX redesign (Refs #493, #495)

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-11 15:53:14 +01:00
UNITRONIX 8a9222fcb8 fix(console): closed overlays no longer block the whole panel
The beta sheet replaced the v2 overlay rules with display: flex plus
opacity: 0. Opacity is a paint property: it does not remove the box from hit
testing, so a closed overlay stayed as an invisible full-viewport layer over
the console and swallowed every click. Opening Commercialization -> Sessions
and closing the assign-package dialog left the page frozen exactly that way.

A closed .modal-overlay is now display: none and comes back as flex on
.open/.active/.show. The same defect existed in .sheet-layer and
.ux35-sidebar-overlay; both now hide through visibility + pointer-events,
which keeps their fade working instead of snapping. The sidebar overlay also
regains the [hidden] rule it needs while the drawer animates.

Guarded by tests/ux36-overlays.test.js, which also walks every fixed
full-viewport layer that fades out, so a new overlay cannot reintroduce it.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-11 15:48:53 +01:00
UNITRONIX 34103e704c fix(console): flatten the Dashboard cards that still used v2 gradients
The beta sheet covered the layout but not every card: dashboard.css (v2)
puts a radial blue glow on the hero, a linear gradient plus a blue border on
the client-config card, and a glass surface with a shadow on the activity
panel and the attention list. Inside the ruled beta layout those read as a
different design language.

They now use one plain surface on the same hairline as every other beta
page: background var(--bg), no background-image, 1px var(--rule), no
shadow. The hero loses its glow, the status pills keep their colour meaning
without the tint behind them, and the inner blocks of the client-config
card drop their nested glass. The operator's own colours still flow through
--bg / --rule, so branding keeps working and themeMode: custom is untouched.

Guarded by a test that first asserts the v2 gradients exist and then that
the beta overrides all of them, so removing the override fails rather than
silently bringing the gradients back.

Based-on: @rathlinus UX redesign (Refs #493, #495)

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-11 15:46:15 +01:00
UNITRONIX cde8a58ad1 feat(api): serve the panel catalog from Go
Stage P3 (definition half) of the strangler plan. The console kept its own
panel section list and role map while Go owned the permissions - the
"second copy" discussion #496 pointed at.

GET /api/panel/catalog now serves the section list (key, label, group,
read/write permission), the group list, the whole permission vocabulary and
the built-in role defaults. Every signed-in principal may read it, because
every role renders its own navigation from it.

The console loads it at startup and looks sections up through
panelCatalog(); the bundled copy stays only as the fallback for an older
server binary and for unit tests. tests/panelCatalogParity.test.js fails if
the two definitions drift apart - it already caught a duplicate "toolkit"
entry nobody had noticed.

Also documents the whole plan in docs/important/console-backend-strangler.md
(domain/table ownership, stages, rollback switches) and updates the UX 3.6
wiki page and the changelog.

Refs #496

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-11 15:35:11 +01:00
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
UNITRONIX b9be0bc381 feat(console): move access control strategies to their own page
The RustDesk Pro strategy list was a card halfway down the Devices page,
below the folder rail and above the table. Nobody found it there.

It now has its own page at /strategies, listed with the other security
rules in the sidebar (Rules & policies group) in both shells and in the
Ctrl+K search index. The Devices page keeps one quiet link, so the old
location still leads somewhere.

The list, the edit and assign dialogs, the permission grid and every
endpoint are unchanged; the code moved from devices.js to
public/js/strategies.js. Access is gated by the existing "strategies"
panel section, so a role that could manage strategies before still can and
nobody else gains access.

Based-on: @rathlinus UX redesign (Refs #493, #495)

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-11 15:35:11 +01:00
UNITRONIX 71f7bb2dfd feat(console): finish the UX 3.6 port - search, More rows, page rhythm
Global search (Ctrl+K, or "/" when no field has focus) searches pages,
devices and people from one dialog. Pages come from a server-built index
filtered by panel access and RBAC, so it never lists a page the role cannot
open; devices and people load only when the session may read them.

Long sidebar sections keep their daily pages and fold the rest into a
section-level "More" row with a count, remembered per browser. The menu
filter exists in the beta sidebar too, matches inside those rows and opens
them. Width, collapsed groups, "More" rows and scroll position are restored
before the first paint, so the menu never jumps.

The rest of the console keeps its markup and takes the same rhythm: one
content column, ruled sections instead of floating cards, stat numbers in
one ruled row, page tabs as a ruled row, hairline tables. Chat and Remote
stay full-bleed workspaces. Settings search now names another topic when
the typed words match one.

The shell scroll chain is fixed: the beta declared min-height only while
body.app-page clips overflow, so a long list (Devices) could not scroll and
the floating horizontal bar sat at the bottom of the list instead of the
screen. The content column is the single scrollport again, as in UX 3.5.

nav.more / nav.fewer / search.* / settings.ui.search_topic exist in all 26
locales; the icon subset gains more_horiz; tokens.css gains --radius-full.

Based-on: @rathlinus UX redesign (Refs #493, #495)

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-11 15:35:11 +01:00
UNITRONIX ce91201d53 fix(console): let operator custom colours win over the UX 3.6 palette
palette.css is now skipped when branding.themeMode is custom, so an operator who tuned their own colours keeps them in the beta shell. Light and dark still come from the contributor's scale.

Refs #493
Refs #495
Based-on: @rathlinus UX redesign (Refs #493, #495)

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-10 01:11:20 +01:00
UNITRONIX 6e5f7af78a feat(console): port the UX 3.6 design system instead of recolouring UX 3.5
The first beta was only a thin layer over the UX 3.5 sheets: it copied a few layout ideas but kept the old palette, the system font stack and the old component styling, so pages looked almost unchanged and the beta read as fragments of the design.

This ports the contributor's actual design system into web-nodejs/public/css/ux36/ and loads it last for the beta shell only:

- palette.css - his neutral dark scale (#141616...) and white-based light theme, rather than the GitHub blue-black we had.
- tokens.css, base.css, components.css, shell.css - his token set, IBM Plex Sans/Mono typography, component styles (.btn, .form-input, tables, menus, tags, notices) and shell layout, taken from web-nodejs/public/css/ui/ at d710bdb.
- pages.css - this console's page classes mapped onto his page rhythm: ruled rows instead of floating cards, stats as one ruled strip, Devices as a 210px folder rail beside the table, Settings as a ruled topic row, device details as a side sheet.
- legacy-bridge.css - his token names mapped onto the v2 names the remaining page sheets use, so no page mixes two type or spacing scales.
- shared-chrome.css - the switch and its BETA badge, needed in both shells.

The top bar and sidebar are their own partials now (ux36-topbar.ejs, ux36-sidebar.ejs) using his structure: logo column sized to the sidebar, breadcrumb from the section model, sections as <ul> lists with icons and group labels.

IBM Plex fonts ship with their SIL OFL licence. ux35-shell.js no longer writes the UX 3.5 palette inline while the beta shell is active, because those inline vars would beat palette.css on a theme toggle.

UX 3.5 is untouched: same sheets, same markup, same palette. Custom operator colours still win - the beta palette is scoped to data-ui-shell=ux36 and light/dark only.

Refs #493
Refs #495
Reported-by: @rathlinus
Based-on: @rathlinus UX redesign (Refs #493, #495)

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-10 01:11:20 +01:00
UNITRONIX d09015ca46 feat(console): move the UX 3.6 switch into the top bar and credit its designer
The shell switch now sits with the theme / refresh / language controls, so the beta is one click away from every page. In UX 3.5 the button carries a small BETA badge and opens UX 3.6; in UX 3.6 the same button returns to UX 3.5, and the sidebar footer repeats it as a labelled 'Switch back to UX 3.5' entry.

Move the request logic to public/js/ui-shell.js because the toggle renders in both shells (ux36-shell.js now only owns beta-only layout behaviour). The Settings card stays as the descriptive entry point.

Attribution: README gains a Credits section naming Linus Rath (@rathlinus) as the designer of the redesign that UX 3.6 is modelled on, and the Settings card links the contributor profile plus issue #493 and PR #495 next to the existing credit line. CONTRIBUTOR-ATTRIBUTIONS.md and .cursor/rules/ux36-attribution.mdc already require the 'Based-on: @rathlinus UX redesign (Refs #493, #495)' trailer on every port commit.

Refs #493
Refs #495
Reported-by: @rathlinus
Based-on: @rathlinus UX redesign (Refs #493, #495)

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-10 00:55:13 +01:00
UNITRONIX 602fa36573 feat(console): add opt-in UX 3.6 beta shell in the current EJS stack
Adds an alternative console layout modelled on the community redesign by
@rathlinus and rebuilt on the existing EJS/JavaScript/CSS stack -- the
svelte-rewrite branch stays a design reference and is not merged.

What ships:

- lib/uiShell.js resolves the shell once (query, then cookie, then default)
  so SSR markup, asset includes and window.BetterDesk.uiShell cannot
  disagree. UX 3.5 remains the default and the fallback; unknown values
  (including the removed `classic`) are ignored instead of erroring.
- routes/ui-shell.routes.js exposes GET/POST /api/ui-shell (auth + CSRF) and
  persists the choice per browser in the bd_ui_shell cookie. No database
  migration, no effect on other operators.
- lib/consoleNav.js groups the existing pages into Devices, Support, People,
  Activity and Settings. Every entry keeps its route, RBAC permission and
  panel-access section, so a role sees exactly the pages it could open
  before; the grouping is presentation only.
- views/partials/ux36-sidebar.ejs renders that model with proper
  aria-current/aria-expanded state and no duplicate navigation markup.
- public/css/ux36.css layers the new chrome on top of ux35.css without
  forking the --ux35-* token contract, so branding, wallpapers, fonts and
  light/dark/custom themes keep working in both shells.
- public/js/ux36-shell.js adds the one-open-group default, filter sync and
  the Settings switch; ux35-shell.js keeps owning drawer, resize and theme.
- Settings -> General gains a "Console interface" card so operators can opt
  in and out without a URL; ?ui=ux36 works as a support deep link.
- Settings deep links now accept ?tab=<topic> in addition to #topic.
- New nav.* and ux36.* keys in all 26 locales (real translations).
- Docs: CHANGELOG, UX wiki page, Web-Console wiki page, README, contributor
  attributions, and .cursor/rules/ux36-attribution.mdc so future UX 3.6
  commits keep the credit.

Tests: tests/ux36-shell.test.js, tests/ux36-pages.render.test.js and
tests/ux36-ui-shell.routes.test.js; ux35-ui-contract.test.js updated to
assert both shells. Full web-nodejs suite: 986 passed; the three failing
suites (users.routes, devices.routes, dashboardPairingUi) fail identically
on the untouched branch.

Refs #493
Refs #495
Reported-by: @rathlinus
Based-on: @rathlinus UX redesign (Refs #493, #495)

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-10 00:53:29 +01:00
UNITRONIX 34825e6fd1 feat(console): add panel access policies with group inheritance
Give users and groups none/read/write section access and client feature toggles, rebuild the users page matrix UI, and harden settings restart completion.
2026-11-09 00:24:03 +01:00
UNITRONIX a426bf1a65 fix(console): dashboard agent pairing issues a one-time code, not the QR scanner
Główne asked operators to scan a QR while the product moved to short-code pairing, so the dashboard button and the /?activateAgent=1 deep link opened the wrong flow.

- Client-config card button and the sidebar entry (nav.pair_agent) open a pairing-code dialog: server address prefilled from the resolved client address, optional label, code generation, 10-minute countdown, copy.

- Codes are minted via the existing POST /api/panel/pairing/codes behind enrollment.approve; plaintext shown once, never logged. No new endpoint.

- The QR scanner stays reachable from the dialog (Scan agent QR) and from /pairing; the scanner modal title now names itself instead of reusing the old Activate agent label.

- New keys nav.pair_agent, dashboard.pair_with_code, pairing.scan_qr_agent, pairing.generating in all 26 locales; agents.* step 3 / button / body no longer present QR as the primary path.

- Test: web-nodejs/tests/dashboardPairingUi.test.js renders the view and asserts the code dialog wiring and the deep-link target.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-08 20:59:57 +01:00
UNITRONIX 850c0f42a0 fix(update): build the Go server with the version from its own source tree
applyUpdate() writes the root VERSION file only AFTER buildGoServer() runs, so
at build time the root VERSION still held the previous release. That value went
into `-X main.Version=`, producing a freshly compiled server that reported the
old version on /api/health while the panel showed the new one (e.g. panel
3.5.218, server 3.5.214).

betterdesk-server/internal/productversion/VERSION is the file `//go:embed`
actually ships in the binary, and ensureServerSource() already refreshes it as
part of the 287-file server tree sync that happens before the build. Read it
first via readEmbeddedServerVersion(), falling back to the previous logic when
absent or malformed.

Covers the ordering bug with tests that pin the stale-root-VERSION scenario.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-08 15:47:35 +01:00
UNITRONIX f1e75683a9 test(console): resolve lazy route paths without executing modules
The integrity test required every routes/*.js module directly. Requiring a
route module starts its dependencies' timers (e.g. fileTransferService's
setInterval), which Jest reported as a leaked open handle and which made the
suite flaky in CI.

Scan routes/index.js for `lazyRoute('./x')` string paths instead: those are
invisible to a plain require() scan and are never loaded at boot, which is the
exact gap this guard exists to close.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-08 15:40:58 +01:00
UNITRONIX 819e1d2d21 fix(console): pairing route requires the real database module
routes/pairing.routes.js shipped `require('../db')`. That module has never
existed in this repository, so the post-update integrity scan resolved it to
`db.js`, asked GitHub for `web-nodejs/db.js`, got a 404, and classified the
download as a CRITICAL failure. The updater then rolled back the entire console
update to the previous SHA - every panel that tried to install 3.5.215/3.5.216
stayed stranded below the new release.

Use `require('../services/database')`, the same import as every other route
module, and add tests/consoleRequireIntegrity.test.js: a static scan that fails
when any relative require() in the deployable console tree points at a missing
file, plus a smoke require of every lazily loaded routes/*.js. `node --check`
only parses and lazy routes are not loaded at boot, which is why no existing
gate caught this.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-08 15:39:03 +01:00
UNITRONIX 6b87f53943 feat(console): pairing page, public route allowlist and locale keys
The panel side of short-code pairing.

- New `/pairing` page (`views/pairing.ejs` + `public/js/pairing.js`) next to the existing
  QR activation flow: mint a code with an optional label, see the countdown, copy it, and
  revoke active codes. The plaintext code is shown once, because only its hash is stored.
- `routes/pairing.routes.js` proxies mint/list/revoke to Go behind `requireAuth` and
  `enrollment.approve`; the client redeems directly against Go, so no code is ever handled
  by the panel's public API.
- `wanSecurity.js` allows `/api/pairing/redeem` and `/api/pairing/config` on :21121 as POST
  only. Minting and listing stay off the public client API: a GET could spend somebody
  else's code via a link preview, and listing would expose code metadata.
- `betterdeskApi` gains `createPairingCode`, `listPairingCodes`, `revokePairingCode`.
- 28 new keys plus a `nav.pairing` entry in all 26 locale files. `scripts/check-pairing-i18n.js`
  enforces parity and runs in CI.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-08 15:04:34 +01:00
Mahdi Hedhli 77b543407b fix(console): restrict currentUser WAN methods 2026-11-08 10:42:06 +01:00
UNITRONIX f20a6be46f fix(portal,toolchain): explain empty installer list and keep Flutter checksum
Two user-visible gaps from the backlog:

- /api/portal/installers returned an empty array with no explanation when no
  Support Agent release had been imported, so the public page looked broken
  (#439, #475). It now reports no_release_imported, release_cache_incomplete or
  cache_unreadable, and the page renders a specific sentence for each. Covered
  by tests/portalInstallers.test.js. No new public surface is added.

- scripts/install-build-toolchain.sh fetched ${url}.sha256, a path Flutter does
  not publish, so the optional toolchain install always failed at the checksum
  step (#466). The hash is now resolved from Flutter's releases_linux.json and
  a missing hash aborts instead of skipping verification; FLUTTER_ARCHIVE_SHA256
  overrides it. Verified against the live manifest for 3.24.5.

Also adds the drive-root regression for Web Remote parent navigation (#467).

Refs #439, #466, #467, #475

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow); muopc (@muopc)
2026-11-08 10:37:57 +01:00
da3dsoul d2c75b9794 feat(auth): make panel sessions per account configurable
Add SESSION_MAX_PER_USER to control how many concurrent panel sessions an
account may hold. A new login ends only the least recently active sessions
beyond the limit.

- 1 (default): unchanged single-session behaviour
- N: keep the N most recently active sessions
- 0: unlimited

The Docker compose files now pass SESSION_IDLE_TIMEOUT, SESSION_MAX_AGE,
SESSION_IDLE_WARN_MS and SESSION_MAX_PER_USER through to the container;
previously the session policy could not be changed in Docker deployments.
The security-audit hardening checklist reports the configured limit.
2026-11-07 20:48:18 -05:00