feat(boot): seed agentbinaryfetcher from env on first run #59
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/VS-38-env-seed-agent-fetcher"
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?
A fresh vervain-server deploy has no config.json and an empty settings overlay, so settings.agentbinaryfetcher is absent and the agent catalog stays empty until an admin configures the fetcher by hand. This seeds that section from VERVAIN_AGENT_FETCHER_* env vars on first boot so a Docker-only deployment fetches and serves agents with no manual UI step.
New agent_fetcher_seed module builds a Forgejo agentbinaryfetcher section from VERVAIN_AGENT_FETCHER_BASE_URL (the trigger), OWNER, PACKAGE, VERSION, PUBLIC_KEY (required) plus optional TOKEN, AGENT_IDS, and REFRESH_INTERVAL_SECS. The token and public key support the Docker *_FILE secret convention; setting both the plain var and the *_FILE var for one field is a hard error, and the token value is never logged or placed in an error message.
The seed only fills the section when the persisted overlay has none, so a site admin's runtime edits always win; it is held in memory for that boot and never written to the database. Because a brand-new deploy has no config.json (config is None), the boot merge now stands up a minimal config from the seeded overlay instead of short-circuiting on None. A misconfigured seed surfaces as an admin warning and boots without the fetcher rather than blocking startup.
Documents the env vars and a ready compose snippet in README.md and .env.example.
#VS-38