【修复】长期持有tcp连接未关闭

【新增】支持通过webhook调用自己的服务解析dns记录
【新增】支持通过webhook推送证书和密钥
【新增】导入导出工作流、通知、证书、api授权数据
【新增】支持自定义插件目录
This commit is contained in:
v-me-50
2025-08-14 16:41:29 +08:00
parent e939724f37
commit 6d0732fc31
16 changed files with 377 additions and 42 deletions

View File

@@ -16,13 +16,14 @@ import (
)
type Setting struct {
Timeout int `json:"timeout" form:"timeout"`
Secure string `json:"secure" form:"secure"`
Https string `json:"https" form:"https"`
Key string `json:"key" form:"key"`
Cert string `json:"cert" form:"cert"`
Username string `json:"username" form:"username"`
Password string `json:"password" form:"password"`
Timeout int `json:"timeout" form:"timeout"`
Secure string `json:"secure" form:"secure"`
Https string `json:"https" form:"https"`
Key string `json:"key" form:"key"`
Cert string `json:"cert" form:"cert"`
Username string `json:"username" form:"username"`
Password string `json:"password" form:"password"`
PluginPath string `json:"plugin_path" form:"plugin_path"`
}
func Get() (Setting, error) {
@@ -57,6 +58,7 @@ func Get() (Setting, error) {
}
username := data[0]["username"].(string)
setting.Username = username
setting.PluginPath = public.GetSettingIgnoreError("plugin_dir")
return setting, nil
}
@@ -108,6 +110,9 @@ func Save(setting *Setting) error {
public.TimeOut = setting.Timeout
restart = true
}
if setting.PluginPath != "" && setting.PluginPath != public.GetSettingIgnoreError("plugin_dir") {
public.UpdateSetting("plugin_dir", setting.PluginPath)
}
if setting.Https != "" {
if setting.Https == "1" {
if setting.Key == "" || setting.Cert == "" {
@@ -192,13 +197,16 @@ func GetVersion() (map[string]string, error) {
update := "0"
newVersionObj, err := http.Get("https://download.allinssl.com/version.json")
if err != nil {
return map[string]string{
"version": version,
"new_version": version,
"update": update,
"log": "",
"date": "",
}, nil
newVersionObj, err = http.Get("https://node1.allinssl.com/version.json")
if err != nil {
return map[string]string{
"version": version,
"new_version": version,
"update": update,
"log": "",
"date": "",
}, nil
}
}
defer newVersionObj.Body.Close()