修复初始化向导服务外部监听与白名单放行并升级版本至V2.10.5
Security Checks / security (push) Waiting to run

This commit is contained in:
xuans committed 2026-10-17 01:35:41 +08:00
1 parent f9e0a425c8
commit f75bc9854f
3 files changed
+6 -7

No files matched your search

+4 -5
View File
@@ -58,11 +58,10 @@ func SetupStart() error {
setupHost := strings.TrimSpace(os.Getenv("SMAIL_SETUP_HOST"))
if setupHost == "" {
setupHost = "127.0.0.1"
}
if setupHost != "127.0.0.1" && setupHost != "localhost" {
if net.ParseIP(setupHost) == nil || strings.TrimSpace(os.Getenv("SMAIL_SETUP_ALLOWED_CIDRS")) == "" || strings.TrimSpace(os.Getenv("SMAIL_SETUP_TOKEN")) == "" {
setupHost = "127.0.0.1"
setupHost = "0.0.0.0"
} else if setupHost != "127.0.0.1" && setupHost != "localhost" {
if net.ParseIP(setupHost) == nil {
setupHost = "0.0.0.0"
}
}
setupServer = &http.Server{