mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
fix(config): env var prefix clashing in k8s (#937)
* fix: log config error * fix: add extra underscore to env prefix * fix: config revert * chore: add web/.gitkeep * chore: fix web/dist/.gitkeep * fix: add extra underscore to env prefix
This commit is contained in:
parent
6898ad8315
commit
d31866b03e
1 changed files with 2 additions and 2 deletions
|
@ -243,14 +243,14 @@ func (c *AppConfig) load(configPath string) {
|
|||
|
||||
for _, key := range viper.AllKeys() {
|
||||
envKey := strings.ToUpper(strings.ReplaceAll(key, ".", "_"))
|
||||
err := viper.BindEnv(key, "AUTOBRR_"+envKey)
|
||||
err := viper.BindEnv(key, "AUTOBRR__"+envKey)
|
||||
if err != nil {
|
||||
log.Fatal("config: unable to bind env: " + err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
if err := viper.Unmarshal(c.Config); err != nil {
|
||||
log.Fatalf("Could not unmarshal config file: %v", viper.ConfigFileUsed())
|
||||
log.Fatalf("Could not unmarshal config file: %v: err %q", viper.ConfigFileUsed(), err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue