Add files via upload

This commit is contained in:
公明
2026-07-20 10:49:40 +08:00
committed by GitHub
parent cb0d61a48d
commit 9a269ac0ec
2 changed files with 45 additions and 0 deletions
+14
View File
@@ -44,3 +44,17 @@ func ApplyDevHTTPSBootstrap(cfg *Config) {
}
cfg.Server.TLSAutoSelfSign = true
}
// ApplyPlainHTTPBootstrap 供 --http / 一键脚本使用:强制主站使用明文 HTTP。
// 它会覆盖配置文件中的 TLS 开关、自签证书以及证书路径,避免 --http 仍被配置中的 HTTPS 选项重新启用。
func ApplyPlainHTTPBootstrap(cfg *Config) {
if cfg == nil {
return
}
cfg.Server.TLSEnabled = false
cfg.Server.TLSAutoSelfSign = false
cfg.Server.TLSCertPath = ""
cfg.Server.TLSKeyPath = ""
disabled := false
cfg.Server.TLSHTTPRedirect = &disabled
}