mirror of
https://gitee.com/mirrors/AllinSSL.git
synced 2026-03-14 10:22:02 +08:00
插件接口
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user