chore: fix env binding
This commit is contained in:
parent
8bf7cdfd31
commit
5ad00c3a50
1 changed files with 4 additions and 1 deletions
|
|
@ -138,13 +138,16 @@ func init() {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viper.SetEnvPrefix("memos")
|
||||||
|
viper.AutomaticEnv()
|
||||||
|
viper.BindEnv("password-auth", "MEMOS_PASSWORD_AUTH")
|
||||||
|
|
||||||
viper.SetDefault("mode", "demo")
|
viper.SetDefault("mode", "demo")
|
||||||
viper.SetDefault("driver", "sqlite")
|
viper.SetDefault("driver", "sqlite")
|
||||||
viper.SetDefault("addr", "")
|
viper.SetDefault("addr", "")
|
||||||
viper.SetDefault("port", 8081)
|
viper.SetDefault("port", 8081)
|
||||||
viper.SetDefault("public", false)
|
viper.SetDefault("public", false)
|
||||||
viper.SetDefault("password-auth", true)
|
viper.SetDefault("password-auth", true)
|
||||||
viper.SetEnvPrefix("memos")
|
|
||||||
|
|
||||||
instanceProfile = &profile.Profile{
|
instanceProfile = &profile.Profile{
|
||||||
Mode: viper.GetString("mode"),
|
Mode: viper.GetString("mode"),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue