summaryrefslogtreecommitdiff
path: root/internal/configuration/helpers.go
diff options
context:
space:
mode:
authorJames Elliott <james-d-elliott@users.noreply.github.com>2024-03-05 19:53:02 +1100
committerGitHub <noreply@github.com>2024-03-05 18:53:02 +1000
commitc70c83f74593c1ed75c2195e2dba74a5dfcd30cc (patch)
treed9cbad6cbf628ed881bdbf309b15d730536c0486 /internal/configuration/helpers.go
parent177c624947490efc5d9f5ed7681572eac9fdbbc7 (diff)
fix(configuration): warning about log level env (#6784)
The AUTHELIA_LOG_LEVEL env variable is incorrectly detected as the deprecated version which maps to the `log_level` key instead of the `log.level` key. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Diffstat (limited to 'internal/configuration/helpers.go')
-rw-r--r--internal/configuration/helpers.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/internal/configuration/helpers.go b/internal/configuration/helpers.go
index db4450727..a65f69911 100644
--- a/internal/configuration/helpers.go
+++ b/internal/configuration/helpers.go
@@ -11,9 +11,7 @@ func getEnvConfigMap(keys []string, prefix, delimiter string, ds map[string]Depr
keyMap = make(map[string]string)
for _, key := range keys {
- if strings.Contains(key, delimiter) {
- keyMap[ToEnvironmentKey(key, prefix, delimiter)] = key
- }
+ keyMap[ToEnvironmentKey(key, prefix, delimiter)] = key
// Secret envs should be ignored by the env parser.
if IsSecretKey(key) {
@@ -32,7 +30,13 @@ func getEnvConfigMap(keys []string, prefix, delimiter string, ds map[string]Depr
continue
}
- keyMap[ToEnvironmentKey(deprecation.Key, prefix, delimiter)] = deprecation.Key
+ d := ToEnvironmentKey(deprecation.Key, prefix, delimiter)
+
+ if _, ok := keyMap[d]; ok {
+ continue
+ }
+
+ keyMap[d] = deprecation.Key
}
return keyMap, ignoredKeys