Files
BetterDesk/web-nodejs/scripts
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
..