root: fix listen trusted_proxy_cidrs config loading from environment (#8075)
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
committed by
GitHub
parent
0064c1df74
commit
b0e74d348a
@ -1,6 +1,7 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"context"
|
||||
_ "embed"
|
||||
"errors"
|
||||
"fmt"
|
||||
@ -10,10 +11,11 @@ import (
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
env "github.com/Netflix/go-env"
|
||||
env "github.com/sethvargo/go-envconfig"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"goauthentik.io/authentik/lib"
|
||||
"gopkg.in/yaml.v2"
|
||||
|
||||
"goauthentik.io/authentik/lib"
|
||||
)
|
||||
|
||||
var cfg *Config
|
||||
@ -113,7 +115,8 @@ func (c *Config) LoadConfigFromFile(path string) error {
|
||||
}
|
||||
|
||||
func (c *Config) fromEnv() error {
|
||||
_, err := env.UnmarshalFromEnviron(c)
|
||||
ctx := context.Background()
|
||||
err := env.Process(ctx, c)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to load environment variables: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user