mirror of
https://github.com/Luzifer/nginx-sso.git
synced 2024-12-20 04:41:17 +00:00
Add cookie auth key environment variable (#59)
This commit is contained in:
parent
827cc380d0
commit
5e40728ec3
1 changed files with 5 additions and 0 deletions
5
main.go
5
main.go
|
@ -45,6 +45,7 @@ type mainConfig struct {
|
|||
var (
|
||||
cfg = struct {
|
||||
ConfigFile string `flag:"config,c" default:"config.yaml" env:"CONFIG" description:"Location of the configuration file"`
|
||||
AuthKey string `flag:"authkey" env:"COOKIE_AUTHENTICATION_KEY" description:"Cookie authentication key"`
|
||||
LogLevel string `flag:"log-level" default:"info" description:"Level of logs to display (debug, info, warn, error)"`
|
||||
TemplateDir string `flag:"frontend-dir" default:"./frontend/" env:"FRONTEND_DIR" description:"Location of the directory containing the web assets"`
|
||||
VersionAndExit bool `flag:"version" default:"false" description:"Prints current version and exits"`
|
||||
|
@ -91,6 +92,10 @@ func loadConfiguration() ([]byte, error) {
|
|||
return nil, errors.Wrap(err, "Unable to load configuration file")
|
||||
}
|
||||
|
||||
if cfg.AuthKey != "" {
|
||||
mainCfg.Cookie.AuthKey = cfg.AuthKey
|
||||
}
|
||||
|
||||
return yamlSource, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue