feat: complete SOP version management

This commit is contained in:
Eric 1549169735@qq.com
2026-08-08 23:29:56 +08:00
parent 4b240499c2
commit e32025d2ca
40 changed files with 966 additions and 159 deletions

View File

@@ -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
}