mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 12:37:39 +00:00
fix: allow env vars to override setup defaults (#3800)
This commit is contained in:
@@ -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")
|
||||||
|
Reference in New Issue
Block a user