chore: translate Chinese strings to English across repository
This commit is contained in:
41
cmd/safelineApi/config.json
Normal file
41
cmd/safelineApi/config.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"SafeLine": {
|
||||
"Host": {
|
||||
"HostName": "192.168.1.4",
|
||||
"Port": "1443"
|
||||
},
|
||||
"ApiToken": "xxx"
|
||||
},
|
||||
"ApplyCert": {
|
||||
"Days": 30,
|
||||
"Email": "xxx",
|
||||
"SavePath": "/tmp/ssl",
|
||||
"DNSProviderConfig": {
|
||||
"DNSProvider": "xxx",
|
||||
"TencentCloud": {
|
||||
"SecretId": "xxx",
|
||||
"SecretKey": "xxx"
|
||||
},
|
||||
"AliCloud": {
|
||||
"AccessKeyId": "xxx",
|
||||
"AccessKeySecret": "xxx",
|
||||
"RAMRole": "xxx (optional)",
|
||||
"STSToken": "xxx (optional)"
|
||||
},
|
||||
"HuaweiCloud": {
|
||||
"AccessKeyId": "xxx",
|
||||
"Region": "xxx",
|
||||
"SecretAccessKey": "xxx"
|
||||
},
|
||||
"WestCN": {
|
||||
"Username": "xxx",
|
||||
"Password": "xxx"
|
||||
},
|
||||
"RainYun": {
|
||||
"ApiKey": "xxx"
|
||||
},
|
||||
"Cloudflare": {},
|
||||
"Dode": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ func main() {
|
||||
|
||||
err := os.MkdirAll(conf.SavePath, os.ModePerm)
|
||||
if err != nil {
|
||||
logger.Error.Printf("创建文件夹 %s%s%s 时发生错误: %s%s%s", logger.Cyan, conf.SavePath, logger.Reset, logger.Red, err.Error(), logger.Reset)
|
||||
logger.Error.Printf("Error creating folder %s%s%s: %s%s%s", logger.Cyan, conf.SavePath, logger.Reset, logger.Red, err.Error(), logger.Reset)
|
||||
}
|
||||
|
||||
urlStr := conf.Url()
|
||||
@@ -32,10 +32,10 @@ func main() {
|
||||
certUpsert := moudle.CheckNodes(certNodes, conf.Days)
|
||||
p, err := moudle.ChooseDNSProvider(conf.DNSProviderConfig)
|
||||
if err != nil {
|
||||
logger.Error.Println(fmt.Sprintf("验证 DNS 服务提供商时发生错误: %s%s%s", logger.Red, err, logger.Reset))
|
||||
logger.Error.Println(fmt.Sprintf("Error validating DNS provider: %s%s%s", logger.Red, err, logger.Reset))
|
||||
os.Exit(0)
|
||||
}
|
||||
log.Printf("本次需要更新证书数量有 %d 个", len(certUpsert))
|
||||
log.Printf("Number of certificates to update this run: %d", len(certUpsert))
|
||||
var failedApply [][]string
|
||||
var successApply [][]string
|
||||
for _, cert := range certUpsert {
|
||||
@@ -48,20 +48,20 @@ func main() {
|
||||
body := bytes.NewReader(upsertReq.Marshal())
|
||||
result := utils.Upsert(urlStr, conf.ApiToken.String(), body)
|
||||
if result.Msg != "" {
|
||||
logger.Error.Printf("域名 %s%s%s 证书更新失败: %s%s%s", logger.Cyan, cert.Domains, logger.Reset, logger.Red, result.Msg, logger.Reset)
|
||||
logger.Error.Printf("Certificate update failed for domain %s%s%s: %s%s%s", logger.Cyan, cert.Domains, logger.Reset, logger.Red, result.Msg, logger.Reset)
|
||||
failedApply = append(failedApply, cert.Domains)
|
||||
continue
|
||||
}
|
||||
successApply = append(successApply, cert.Domains)
|
||||
logger.Success.Printf("域名 %s%s%s 证书更新成功!", logger.Cyan, cert.Domains, logger.Reset)
|
||||
logger.Success.Printf("Certificate update succeeded for domain %s%s%s", logger.Cyan, cert.Domains, logger.Reset)
|
||||
}
|
||||
if len(successApply) != 0 {
|
||||
log.Printf("本次成功更新的域名证书如下: %s%s%s", logger.Cyan, successApply, logger.Reset)
|
||||
log.Printf("Certificates successfully updated this run: %s%s%s", logger.Cyan, successApply, logger.Reset)
|
||||
}
|
||||
|
||||
if len(failedApply) != 0 {
|
||||
log.Printf("未成功更新的域名证书如下: %s%s%s", logger.Cyan, failedApply, logger.Reset)
|
||||
log.Printf("Certificates that failed to update: %s%s%s", logger.Cyan, failedApply, logger.Reset)
|
||||
}
|
||||
log.Printf("本次任务执行完成")
|
||||
log.Printf("Task completed")
|
||||
_ = os.RemoveAll(conf.SavePath)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user