mirror of
https://github.com/TwiN/gatus.git
synced 2025-01-31 02:21:35 +01:00
Revert "Add GATUS_DONT_EXPAND_ENV env var"
This commit is contained in:
parent
3be6d04d29
commit
a4e9d8e9b0
@ -38,8 +38,6 @@ var (
|
|||||||
|
|
||||||
// ErrInvalidSecurityConfig is an error returned when the security configuration is invalid
|
// ErrInvalidSecurityConfig is an error returned when the security configuration is invalid
|
||||||
ErrInvalidSecurityConfig = errors.New("invalid security configuration")
|
ErrInvalidSecurityConfig = errors.New("invalid security configuration")
|
||||||
|
|
||||||
dontExpandEnv = os.Getenv("GATUS_DONT_EXPAND_ENV") == "true"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Config is the main configuration structure
|
// Config is the main configuration structure
|
||||||
@ -154,9 +152,7 @@ func readConfigurationFile(fileName string) (config *Config, err error) {
|
|||||||
// parseAndValidateConfigBytes parses a Gatus configuration file into a Config struct and validates its parameters
|
// parseAndValidateConfigBytes parses a Gatus configuration file into a Config struct and validates its parameters
|
||||||
func parseAndValidateConfigBytes(yamlBytes []byte) (config *Config, err error) {
|
func parseAndValidateConfigBytes(yamlBytes []byte) (config *Config, err error) {
|
||||||
// Expand environment variables
|
// Expand environment variables
|
||||||
if !dontExpandEnv {
|
yamlBytes = []byte(os.ExpandEnv(string(yamlBytes)))
|
||||||
yamlBytes = []byte(os.ExpandEnv(string(yamlBytes)))
|
|
||||||
}
|
|
||||||
// Parse configuration file
|
// Parse configuration file
|
||||||
if err = yaml.Unmarshal(yamlBytes, &config); err != nil {
|
if err = yaml.Unmarshal(yamlBytes, &config); err != nil {
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user