From c9927ca2bf37cc5d07c092758578d30c5f094b7a Mon Sep 17 00:00:00 2001 From: josh Date: Sat, 18 Apr 2026 00:41:09 -0400 Subject: [PATCH] config: default agent.asset_dir so old configs still serve /assets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Operators who installed vetting before agent.asset_dir existed keep their config preserved by install.sh on upgrade, which left them with AssetDir="" — the router silently dropped the /assets/* mount and the quick-register one-liner hit 404 fetching the agent binary. Default AssetDir alongside the database file so the same directory install.sh already creates + drops the agent binary into is picked up automatically. Co-Authored-By: Claude Opus 4.7 --- internal/config/config.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/config/config.go b/internal/config/config.go index bb6965d..9371299 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -3,6 +3,7 @@ package config import ( "fmt" "os" + "path/filepath" "gopkg.in/yaml.v3" ) @@ -125,5 +126,13 @@ func Load(path string) (*Config, error) { if c.Dispatcher.MaxConcurrentRuns == 0 { c.Dispatcher.MaxConcurrentRuns = 3 } + // Default the agent asset dir alongside the database file so upgrades + // from configs predating the agent.asset_dir field pick up a sensible + // location automatically — install.sh creates exactly this directory + // and drops vetting-agent-linux-amd64 into it, so /assets/* serves + // without the operator having to touch vetting.yaml. + if c.Agent.AssetDir == "" { + c.Agent.AssetDir = filepath.Join(filepath.Dir(c.Database.Path), "assets") + } return &c, nil }