mirror of https://github.com/allinssl/allinssl
【调整】可在设置中将安全入口设置为空
parent
c653b09a0d
commit
624fc06f3e
|
@ -3,6 +3,7 @@ package deploy
|
|||
import (
|
||||
"ALLinSSL/backend/internal/cert/deploy/aliyun"
|
||||
"ALLinSSL/backend/internal/cert/deploy/doge"
|
||||
"ALLinSSL/backend/internal/cert/deploy/lecdn"
|
||||
"ALLinSSL/backend/internal/cert/deploy/plugin"
|
||||
"ALLinSSL/backend/public"
|
||||
"fmt"
|
||||
|
@ -99,6 +100,9 @@ func Deploy(cfg map[string]any, logger *public.Logger) error {
|
|||
case "doge-cdn":
|
||||
logger.Debug("部署到多吉云CDN...")
|
||||
return doge.DeployCdn(cfg)
|
||||
case "lecdn":
|
||||
logger.Debug("部署到LeCDN...")
|
||||
return lecdn.DeployLeCDN(cfg)
|
||||
case "plugin":
|
||||
logger.Debug("使用插件部署...")
|
||||
return plugin.Deploy(cfg, logger)
|
||||
|
|
|
@ -103,7 +103,7 @@ func Save(setting *Setting) error {
|
|||
public.TimeOut = setting.Timeout
|
||||
restart = true
|
||||
}
|
||||
if setting.Secure != "" && setting.Secure != public.Secure {
|
||||
if setting.Secure != public.Secure {
|
||||
s.Where("key = 'secure'", []interface{}{}).Update(map[string]interface{}{"value": setting.Secure})
|
||||
public.TimeOut = setting.Timeout
|
||||
restart = true
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
"ALLinSSL/backend/public"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
|
@ -78,6 +79,10 @@ func Monitor() {
|
|||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
fmt.Printf("监控任务发生错误: %v\n", r)
|
||||
// 打印堆栈
|
||||
buf := make([]byte, 1<<16) // 64KB
|
||||
n := runtime.Stack(buf, false)
|
||||
fmt.Println("堆栈信息:\n", string(buf[:n]))
|
||||
}
|
||||
}()
|
||||
defer wg.Done()
|
||||
|
@ -98,7 +103,7 @@ func Monitor() {
|
|||
}
|
||||
|
||||
if Err != nil {
|
||||
checkErr = strings.Split(Err.Error(), ":")[0] // 只取错误信息的第一部分
|
||||
checkErr = Err.Error()
|
||||
} else {
|
||||
if certInfo.VerifyError != "" && (!certInfo.Valid || certInfo.DaysLeft <= int(advanceDay)) {
|
||||
checkErr = certInfo.VerifyError
|
||||
|
@ -157,7 +162,7 @@ func Monitor() {
|
|||
"provider": reportType,
|
||||
"provider_id": strconv.FormatInt(rdata[0]["id"].(int64), 10),
|
||||
"subject": "ALLinSSL 监控通知",
|
||||
"body": fmt.Sprintf(MonitorErrTemplate, v["name"], monitorType, v["target"], checkErr, now.Format("2006-01-02 15:04:05")),
|
||||
"body": fmt.Sprintf(MonitorErrTemplate, v["name"], monitorType, v["target"], strings.Split(checkErr, ":")[0], now.Format("2006-01-02 15:04:05")),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue