From 0e6bcf97135715a6474bf5b52b0b37ef6b4e82aa Mon Sep 17 00:00:00 2001 From: Stavros Date: Tue, 3 Mar 2026 22:48:38 +0200 Subject: [PATCH] fix: lookup config file options correctly in file loader --- .gitignore | 3 +++ internal/utils/loaders/loader_file.go | 13 ++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 1c25087..9362d66 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,6 @@ __debug_* # generated markdown (for docs) /config.gen.md + +# testing config +config.certify.yml diff --git a/internal/utils/loaders/loader_file.go b/internal/utils/loaders/loader_file.go index 7242791..e9edb4d 100644 --- a/internal/utils/loaders/loader_file.go +++ b/internal/utils/loaders/loader_file.go @@ -1,6 +1,8 @@ package loaders import ( + "os" + "github.com/rs/zerolog/log" "github.com/traefik/paerser/cli" "github.com/traefik/paerser/file" @@ -16,11 +18,16 @@ func (f *FileLoader) Load(args []string, cmd *cli.Command) (bool, error) { return false, err } - // I guess we are using traefik as the root name - configFileFlag := "traefik.experimental.configFile" + // I guess we are using traefik as the root name (we can't change it) + configFileFlag := "traefik.experimental.configfile" + envVar := "TINYAUTH_EXPERIMENTAL_CONFIGFILE" if _, ok := flags[configFileFlag]; !ok { - return false, nil + if value := os.Getenv(envVar); value != "" { + flags[configFileFlag] = value + } else { + return false, nil + } } log.Warn().Msg("Using experimental file config loader, this feature is experimental and may change or be removed in future releases")