Commit 5ad00c3a authored by Steven's avatar Steven

chore: fix env binding

parent 8bf7cdfd
...@@ -138,13 +138,16 @@ func init() { ...@@ -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"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment