mirror of
https://github.com/zitadel/zitadel.git
synced 2025-02-28 23:57:23 +00:00
fix: allow env vars to override setup defaults (#3800)
This commit is contained in:
parent
6bd5799770
commit
504d91d424
@ -2,6 +2,7 @@ package setup
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/mitchellh/mapstructure"
|
"github.com/mitchellh/mapstructure"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
@ -57,6 +58,9 @@ type encryptionKeyConfig struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func MustNewSteps(v *viper.Viper) *Steps {
|
func MustNewSteps(v *viper.Viper) *Steps {
|
||||||
|
viper.AutomaticEnv()
|
||||||
|
viper.SetEnvPrefix("ZITADEL")
|
||||||
|
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
|
||||||
v.SetConfigType("yaml")
|
v.SetConfigType("yaml")
|
||||||
err := v.ReadConfig(bytes.NewBuffer(defaultSteps))
|
err := v.ReadConfig(bytes.NewBuffer(defaultSteps))
|
||||||
logging.OnError(err).Fatal("unable to read setup steps")
|
logging.OnError(err).Fatal("unable to read setup steps")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user