Skip to content

Commit 0e6bcf9

Browse files
committed
fix: lookup config file options correctly in file loader
1 parent af5a8bc commit 0e6bcf9

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,6 @@ __debug_*
4545

4646
# generated markdown (for docs)
4747
/config.gen.md
48+
49+
# testing config
50+
config.certify.yml

internal/utils/loaders/loader_file.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package loaders
22

33
import (
4+
"os"
5+
46
"github.com/rs/zerolog/log"
57
"github.com/traefik/paerser/cli"
68
"github.com/traefik/paerser/file"
@@ -16,11 +18,16 @@ func (f *FileLoader) Load(args []string, cmd *cli.Command) (bool, error) {
1618
return false, err
1719
}
1820

19-
// I guess we are using traefik as the root name
20-
configFileFlag := "traefik.experimental.configFile"
21+
// I guess we are using traefik as the root name (we can't change it)
22+
configFileFlag := "traefik.experimental.configfile"
23+
envVar := "TINYAUTH_EXPERIMENTAL_CONFIGFILE"
2124

2225
if _, ok := flags[configFileFlag]; !ok {
23-
return false, nil
26+
if value := os.Getenv(envVar); value != "" {
27+
flags[configFileFlag] = value
28+
} else {
29+
return false, nil
30+
}
2431
}
2532

2633
log.Warn().Msg("Using experimental file config loader, this feature is experimental and may change or be removed in future releases")

0 commit comments

Comments
 (0)