feat(docker): add configurable path for vecna.json

* set default config path to /config
* update docker-compose example for config usage
* modify config resolution to include /config directory
This commit is contained in:
2026-04-11 20:48:21 +02:00
parent 4009a54e39
commit 5c070e441e
4 changed files with 11 additions and 6 deletions

View File

@@ -79,7 +79,7 @@ func ResolveFile(cfgFile string) string {
return cfgFile
}
home, _ := os.UserHomeDir()
dirs := []string{".", home, home + "/.config/vecna"}
dirs := []string{"/config", ".", home, home + "/.config/vecna"}
for _, dir := range dirs {
for _, ext := range extensions {
path := dir + "/vecna." + ext
@@ -117,6 +117,7 @@ func Load(cfgFile string) (*Config, error) {
home, _ := os.UserHomeDir()
v.SetConfigName("vecna")
// No SetConfigType — viper detects format from file extension (json, yaml, toml, etc.)
v.AddConfigPath("/config")
v.AddConfigPath(".")
v.AddConfigPath(home)
v.AddConfigPath(home + "/.config/vecna")