feat: complete SOP version management
This commit is contained in:
@@ -98,6 +98,14 @@ func Load(options LoadOptions) (Config, error) {
|
||||
if environment != "" {
|
||||
cfg.App.Env = environment
|
||||
}
|
||||
if cfg.App.Env == "prod" {
|
||||
if strings.TrimSpace(os.Getenv("APP_DATABASE_PASSWORD")) == "" {
|
||||
return Config{}, errors.New("APP_DATABASE_PASSWORD must be set in production")
|
||||
}
|
||||
if strings.TrimSpace(os.Getenv("APP_AUTH_JWT_SECRET")) == "" {
|
||||
return Config{}, errors.New("APP_AUTH_JWT_SECRET must be set in production")
|
||||
}
|
||||
}
|
||||
if err := cfg.Validate(); err != nil {
|
||||
return Config{}, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user