插件接口

This commit is contained in:
v-me-50
2025-06-16 17:02:47 +08:00
parent 9155f47ec9
commit 143db0baae
5 changed files with 53 additions and 2 deletions

View File

@@ -128,6 +128,11 @@ func AddAccount(email, ca, Kid, HmacEncoded, CADirURL string) error {
return fmt.Errorf("failed to get sqlite: %w", err)
}
now := time.Now().Format("2006-01-02 15:04:05")
if (ca == "sslcom" || ca == "google") && (Kid == "" || HmacEncoded == "") {
return fmt.Errorf("Kid and HmacEncoded are required for %s CA", ca)
} else if ca == "custom" && CADirURL == "" {
return fmt.Errorf("CADirURL is required for custom CA")
}
account := map[string]interface{}{
"email": email,
"type": ca,

View File

@@ -192,7 +192,13 @@ func GetVersion() (map[string]string, error) {
update := "0"
newVersionObj, err := http.Get("https://download.allinssl.com/version.json")
if err != nil {
return nil, fmt.Errorf("failed to fetch version: %v", err)
return map[string]string{
"version": version,
"new_version": version,
"update": update,
"log": "",
"date": "",
}, err
}
defer newVersionObj.Body.Close()