feat(boot): config-driven agent binary path (VS-19) #28

Merged
David merged 1 commit from feat/agent-binaries-config-path-vs-19 into main 2026-05-19 03:44:15 +02:00
Owner

Summary

Implements VS-19. load_agent_binaries() now consults settings.agentbinariespath from config.json before falling back to the existing <datapath>/agents and ./agents directories. A configured-but-missing path emits a warning and stops the search rather than silently falling through, so a config typo is visible in the boot log instead of presenting as a mysteriously empty catalog.

Behavior

  • settings.agentbinariespath (string, optional) - absolute or relative path to a directory of meshagent-<AgentId> files.
  • Resolution order: configured path -> <datapath>/agents/ -> ./agents/.
  • Configured-but-missing path: warn! + empty catalog. No fallback to legacy directories.
  • Configured-but-empty path: info! + empty catalog. No fallback.
  • Path actually consulted is logged at info level on every boot, including the empty case.
  • Backwards compatible: omit the key and the legacy fallback ladder runs unchanged.

Test plan

  • cargo build --workspace clean
  • cargo clippy --package meshcentral --all-targets -- -D warnings clean
  • cargo test --package meshcentral --bin meshcentral boot:: - 14 tests pass, 5 new
  • Start the server with settings.agentbinariespath pointing at a populated dir; confirm loaded agent binary catalog path=... count=N log line
  • Start the server with a typo'd agentbinariespath; confirm settings.agentbinariespath does not exist; agent binary catalog empty warning

Follow-up

VS-20 will add a fetcher that writes signed binaries into this configured path.

## Summary Implements VS-19. `load_agent_binaries()` now consults `settings.agentbinariespath` from `config.json` before falling back to the existing `<datapath>/agents` and `./agents` directories. A configured-but-missing path emits a warning and stops the search rather than silently falling through, so a config typo is visible in the boot log instead of presenting as a mysteriously empty catalog. ## Behavior - `settings.agentbinariespath` (string, optional) - absolute or relative path to a directory of `meshagent-<AgentId>` files. - Resolution order: configured path -> `<datapath>/agents/` -> `./agents/`. - Configured-but-missing path: `warn!` + empty catalog. No fallback to legacy directories. - Configured-but-empty path: `info!` + empty catalog. No fallback. - Path actually consulted is logged at info level on every boot, including the empty case. - Backwards compatible: omit the key and the legacy fallback ladder runs unchanged. ## Test plan - [x] `cargo build --workspace` clean - [x] `cargo clippy --package meshcentral --all-targets -- -D warnings` clean - [x] `cargo test --package meshcentral --bin meshcentral boot::` - 14 tests pass, 5 new - [ ] Start the server with `settings.agentbinariespath` pointing at a populated dir; confirm `loaded agent binary catalog path=... count=N` log line - [ ] Start the server with a typo'd `agentbinariespath`; confirm `settings.agentbinariespath does not exist; agent binary catalog empty` warning ## Follow-up VS-20 will add a fetcher that writes signed binaries into this configured path.
feat(boot): config-driven agent binary path (VS-19)
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 1m25s
Create release / Create release from merged PR (pull_request) Has been skipped
60d8883ce0
- `load_agent_binaries` now consults `settings.agentbinariespath` from `config.json` before the existing `<datapath>/agents` / `./agents` fallbacks, so operators can stage binaries anywhere on disk without symlinks.
- A configured path that does not exist emits `warn!` and yields an empty catalog instead of silently falling through to the legacy directories, which is what made a config typo invisible before.
- The directory actually consulted is logged at info level on every boot (including the empty case), so misconfiguration is one grep away.
- Behavior with no `agentbinariespath` set is unchanged.
- New unit tests cover: empty when no dir, datapath fallback, configured override, configured-overrides-datapath, and configured-missing-stops-search.

#VS-19 State Done

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
David merged commit eefa12b42a into main 2026-05-19 03:44:15 +02:00
David deleted branch feat/agent-binaries-config-path-vs-19 2026-05-19 03:44:15 +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!28
No description provided.