feat(settings): runtime-editable settings overlay + live agent fetcher edit #58
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/VS-37-runtime-settings-overlay"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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