mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-03-05 06:12:03 +00:00
fix: lookup config file options correctly in file loader
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -45,3 +45,6 @@ __debug_*
|
|||||||
|
|
||||||
# generated markdown (for docs)
|
# generated markdown (for docs)
|
||||||
/config.gen.md
|
/config.gen.md
|
||||||
|
|
||||||
|
# testing config
|
||||||
|
config.certify.yml
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package loaders
|
package loaders
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/traefik/paerser/cli"
|
"github.com/traefik/paerser/cli"
|
||||||
"github.com/traefik/paerser/file"
|
"github.com/traefik/paerser/file"
|
||||||
@@ -16,12 +18,17 @@ func (f *FileLoader) Load(args []string, cmd *cli.Command) (bool, error) {
|
|||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// I guess we are using traefik as the root name
|
// I guess we are using traefik as the root name (we can't change it)
|
||||||
configFileFlag := "traefik.experimental.configFile"
|
configFileFlag := "traefik.experimental.configfile"
|
||||||
|
envVar := "TINYAUTH_EXPERIMENTAL_CONFIGFILE"
|
||||||
|
|
||||||
if _, ok := flags[configFileFlag]; !ok {
|
if _, ok := flags[configFileFlag]; !ok {
|
||||||
|
if value := os.Getenv(envVar); value != "" {
|
||||||
|
flags[configFileFlag] = value
|
||||||
|
} else {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log.Warn().Msg("Using experimental file config loader, this feature is experimental and may change or be removed in future releases")
|
log.Warn().Msg("Using experimental file config loader, this feature is experimental and may change or be removed in future releases")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user