功能修改
This commit is contained in:
@@ -23,6 +23,7 @@ type Config struct {
|
||||
BootstrapAdminEmail string
|
||||
BootstrapAdminPassword string
|
||||
SecretEnvelopeKey string
|
||||
AIProviderMode string
|
||||
}
|
||||
|
||||
func Load() Config {
|
||||
@@ -66,9 +67,17 @@ func Load() Config {
|
||||
BootstrapAdminEmail: strings.TrimSpace(os.Getenv("PLATFORM_BOOTSTRAP_ADMIN_EMAIL")),
|
||||
BootstrapAdminPassword: os.Getenv("PLATFORM_BOOTSTRAP_ADMIN_PASSWORD"),
|
||||
SecretEnvelopeKey: os.Getenv("PLATFORM_SECRET_ENVELOPE_KEY"),
|
||||
AIProviderMode: defaultString(strings.TrimSpace(os.Getenv("PLATFORM_AI_PROVIDER_MODE")), "live"),
|
||||
}
|
||||
}
|
||||
|
||||
func defaultString(value, fallback string) string {
|
||||
if value == "" {
|
||||
return fallback
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
func loadLocalEnvFiles() {
|
||||
candidates := []string{".env", filepath.Join("platform", ".env")}
|
||||
for _, path := range candidates {
|
||||
|
||||
Reference in New Issue
Block a user