feat(settings): runtime-editable settings overlay + live agent fetcher edit #58

Merged
David merged 1 commit from feat/VS-37-runtime-settings-overlay into main 2026-06-16 12:00:20 +02:00
Owner

Adds a persisted settings overlay so a site admin can change selected server settings from the web UI and have them apply without a restart, delivering the mechanism plus the first editable section (agentbinaryfetcher).

The overlay is one document in meshcentral-db (main table, type="settings", id settings/overlay) carrying a settings object of section overrides, written through the existing generic document get/put API with no schema migration. At boot the binary deep-merges the overlay over config.json's settings (Config::with_settings_overlay) before any subsystem reads its section, so edits survive restarts and are the effective config from the first read.

Two new site-admin-only control actions pair with the read-only serverconfig: settingsget returns the effective (config + overlay) value of one runtime-editable section with secrets redacted, and settingsupdate validates, persists, and live-applies one section. For agentbinaryfetcher the apply path validates the minisign public key and source, rebuilds the BinaryFetcher + refresher, persists the overlay, then runs refresh_now() so the new catalog serves from /meshagents/:id with no restart. Invalid input is rejected before anything is persisted, leaving the running fetcher untouched. Writes are gated by an allowlist (meshcentral_config::RUNTIME_EDITABLE_SETTINGS_KEYS), starting with just agentbinaryfetcher.

The agent-binary refresher now lives in a shared hot-swappable slot (AgentBinaryRefresherHandle) so the periodic refresh task and the POST /agentbinaries/refresh endpoint pick up a live rebuild without a restart and a later periodic tick cannot clobber the new catalog with the old source. The allowlist and overlay mechanism are documented in the settings_overlay module rustdoc and in README.md for reuse by future sections.

#VS-37

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Adds a persisted settings overlay so a site admin can change selected server settings from the web UI and have them apply without a restart, delivering the mechanism plus the first editable section (agentbinaryfetcher). The overlay is one document in meshcentral-db (main table, type="settings", id settings/overlay) carrying a settings object of section overrides, written through the existing generic document get/put API with no schema migration. At boot the binary deep-merges the overlay over config.json's settings (Config::with_settings_overlay) before any subsystem reads its section, so edits survive restarts and are the effective config from the first read. Two new site-admin-only control actions pair with the read-only serverconfig: settingsget returns the effective (config + overlay) value of one runtime-editable section with secrets redacted, and settingsupdate validates, persists, and live-applies one section. For agentbinaryfetcher the apply path validates the minisign public key and source, rebuilds the BinaryFetcher + refresher, persists the overlay, then runs refresh_now() so the new catalog serves from /meshagents/:id with no restart. Invalid input is rejected before anything is persisted, leaving the running fetcher untouched. Writes are gated by an allowlist (meshcentral_config::RUNTIME_EDITABLE_SETTINGS_KEYS), starting with just agentbinaryfetcher. The agent-binary refresher now lives in a shared hot-swappable slot (AgentBinaryRefresherHandle) so the periodic refresh task and the POST /agentbinaries/refresh endpoint pick up a live rebuild without a restart and a later periodic tick cannot clobber the new catalog with the old source. The allowlist and overlay mechanism are documented in the settings_overlay module rustdoc and in README.md for reuse by future sections. #VS-37 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
feat(settings): runtime-editable settings overlay + live agent fetcher edit
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 1m59s
Create release / Create release from merged PR (pull_request) Has been skipped
2dbe7ca44c
Adds a persisted settings overlay so a site admin can change selected server settings from the web UI and have them apply without a restart, delivering the mechanism plus the first editable section (agentbinaryfetcher).

The overlay is one document in meshcentral-db (main table, type="settings", id settings/overlay) carrying a settings object of section overrides, written through the existing generic document get/put API with no schema migration. At boot the binary deep-merges the overlay over config.json's settings (Config::with_settings_overlay) before any subsystem reads its section, so edits survive restarts and are the effective config from the first read.

Two new site-admin-only control actions pair with the read-only serverconfig: settingsget returns the effective (config + overlay) value of one runtime-editable section with secrets redacted, and settingsupdate validates, persists, and live-applies one section. For agentbinaryfetcher the apply path validates the minisign public key and source, rebuilds the BinaryFetcher + refresher, persists the overlay, then runs refresh_now() so the new catalog serves from /meshagents/:id with no restart. Invalid input is rejected before anything is persisted, leaving the running fetcher untouched. Writes are gated by an allowlist (meshcentral_config::RUNTIME_EDITABLE_SETTINGS_KEYS), starting with just agentbinaryfetcher.

The agent-binary refresher now lives in a shared hot-swappable slot (AgentBinaryRefresherHandle) so the periodic refresh task and the POST /agentbinaries/refresh endpoint pick up a live rebuild without a restart and a later periodic tick cannot clobber the new catalog with the old source. The allowlist and overlay mechanism are documented in the settings_overlay module rustdoc and in README.md for reuse by future sections.

#VS-37

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
David merged commit 6a5cd30aff into main 2026-06-16 12:00:20 +02:00
David deleted branch feat/VS-37-runtime-settings-overlay 2026-06-16 12:00:21 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-server!58
No description provided.