功能修改

This commit is contained in:
npc0-hue
2026-07-20 16:42:33 +08:00
parent 48b8ad8d6c
commit a0e69417db
224 changed files with 22015 additions and 884 deletions
+9
View File
@@ -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 {