add tencent cdn deployer

This commit is contained in:
yoan
2024-08-29 11:34:08 +08:00
parent 1861e73531
commit 1e11b23fdc
15 changed files with 288 additions and 128 deletions

View File

@@ -1,17 +1,13 @@
package applicant
import (
"certimate/internal/domain"
"encoding/json"
"os"
"github.com/go-acme/lego/v4/providers/dns/alidns"
)
type aliyunAccess struct {
AccessKeyId string `json:"accessKeyId"`
AccessKeySecret string `json:"accessKeySecret"`
}
type aliyun struct {
option *ApplyOption
}
@@ -24,7 +20,7 @@ func NewAliyun(option *ApplyOption) Applicant {
func (a *aliyun) Apply() (*Certificate, error) {
access := &aliyunAccess{}
access := &domain.AliyunAccess{}
json.Unmarshal([]byte(a.option.Access), access)
os.Setenv("ALICLOUD_ACCESS_KEY", access.AccessKeyId)

View File

@@ -1,17 +1,13 @@
package applicant
import (
"certimate/internal/domain"
"encoding/json"
"os"
"github.com/go-acme/lego/v4/providers/dns/tencentcloud"
)
type tencentAccess struct {
SecretId string `json:"secretId"`
SecretKey string `json:"secretKey"`
}
type tencent struct {
option *ApplyOption
}
@@ -24,7 +20,7 @@ func NewTencent(option *ApplyOption) Applicant {
func (t *tencent) Apply() (*Certificate, error) {
access := &tencentAccess{}
access := &domain.TencentAccess{}
json.Unmarshal([]byte(t.option.Access), access)
os.Setenv("TENCENTCLOUD_SECRET_ID", access.SecretId)