From b4803f89aae719977836203ff89097a5061238c8 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Sat, 5 Oct 2024 21:10:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E7=81=AB=E5=B1=B1?= =?UTF-8?q?=E5=BC=95=E6=93=8EDNS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/utils/ssl/client.go | 10 ++++++++++ frontend/src/global/mimetype.ts | 4 ++++ frontend/src/lang/modules/en.ts | 1 + frontend/src/lang/modules/tw.ts | 1 + frontend/src/lang/modules/zh.ts | 1 + .../src/views/website/ssl/dns-account/create/index.vue | 8 ++++++++ go.mod | 2 +- go.sum | 1 + 8 files changed, 27 insertions(+), 1 deletion(-) diff --git a/backend/utils/ssl/client.go b/backend/utils/ssl/client.go index 52d5177f8c678..8ca9769601d6e 100644 --- a/backend/utils/ssl/client.go +++ b/backend/utils/ssl/client.go @@ -23,6 +23,7 @@ import ( "github.com/go-acme/lego/v4/providers/dns/namedotcom" "github.com/go-acme/lego/v4/providers/dns/namesilo" "github.com/go-acme/lego/v4/providers/dns/tencentcloud" + "github.com/go-acme/lego/v4/providers/dns/volcengine" "github.com/go-acme/lego/v4/providers/http/webroot" "github.com/go-acme/lego/v4/registration" "github.com/pkg/errors" @@ -67,6 +68,7 @@ type DnsType string const ( DnsPod DnsType = "DnsPod" AliYun DnsType = "AliYun" + Volcengine DnsType = "Volcengine" CloudFlare DnsType = "CloudFlare" NameSilo DnsType = "NameSilo" NameCheap DnsType = "NameCheap" @@ -122,6 +124,14 @@ func (c *AcmeClient) UseDns(dnsType DnsType, params string, websiteSSL model.Web alidnsConfig.PollingInterval = pollingInterval alidnsConfig.TTL = ttl p, err = alidns.NewDNSProviderConfig(alidnsConfig) + case Volcengine: + volcConfig := volcengine.NewDefaultConfig() + volcConfig.SecretKey = param.SecretKey + volcConfig.AccessKey = param.AccessKey + volcConfig.PropagationTimeout = propagationTimeout + volcConfig.PollingInterval = pollingInterval + volcConfig.TTL = ttl + p, err = volcengine.NewDNSProviderConfig(volcConfig) case CloudFlare: cloudflareConfig := cloudflare.NewDefaultConfig() cloudflareConfig.AuthEmail = param.Email diff --git a/frontend/src/global/mimetype.ts b/frontend/src/global/mimetype.ts index ed342e4df1477..ce2d8bfc91f94 100644 --- a/frontend/src/global/mimetype.ts +++ b/frontend/src/global/mimetype.ts @@ -168,6 +168,10 @@ export const DNSTypes = [ label: i18n.global.t('website.huaweicloud'), value: 'HuaweiCloud', }, + { + label: i18n.global.t('website.volcengine'), + value: 'Volcengine', + }, { label: 'DNSPod (' + i18n.global.t('ssl.deprecated') + ')', value: 'DnsPod', diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index dc872f8a2d259..d60c5a7994cb7 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -1922,6 +1922,7 @@ const message = { SSLList: 'Certificate List', createDnsAccount: 'DNS Account', aliyun: 'Aliyun', + volcengine: 'Volcengine', manual: 'Manual parsing', key: 'Key', check: 'View', diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index 9bdc256d211f1..78cdde90a3d73 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -1784,6 +1784,7 @@ const message = { SSLList: '證書列表', createDnsAccount: 'DNS賬戶', aliyun: '阿裏雲', + volcengine: '火山引擎', manual: '手動解析', key: '密鑰', check: '查看', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 5cfe274dafade..cd148ffe62e78 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -1785,6 +1785,7 @@ const message = { SSLList: '证书列表', createDnsAccount: 'DNS账户', aliyun: '阿里云', + volcengine: '火山引擎', manual: '手动解析', key: '密钥', check: '查看', diff --git a/frontend/src/views/website/ssl/dns-account/create/index.vue b/frontend/src/views/website/ssl/dns-account/create/index.vue index bb72d3f3994b5..61a8a10e60a6b 100644 --- a/frontend/src/views/website/ssl/dns-account/create/index.vue +++ b/frontend/src/views/website/ssl/dns-account/create/index.vue @@ -44,6 +44,14 @@ +
+ + + + + + +
diff --git a/go.mod b/go.mod index 4d989e3d92fed..e9833507f491a 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/gin-contrib/gzip v0.0.6 github.com/gin-gonic/gin v1.9.1 github.com/glebarez/sqlite v1.10.0 - github.com/go-acme/lego/v4 v4.19.2 + github.com/go-acme/lego/v4 v4.19.3-0.20241021182303-19b535caac61 github.com/go-gormigrate/gormigrate/v2 v2.1.1 github.com/go-playground/validator/v10 v10.18.0 github.com/go-redis/redis v6.15.9+incompatible diff --git a/go.sum b/go.sum index 8c3676459ddbd..68ec686881144 100644 --- a/go.sum +++ b/go.sum @@ -265,6 +265,7 @@ github.com/glebarez/sqlite v1.10.0 h1:u4gt8y7OND/cCei/NMHmfbLxF6xP2wgKcT/BJf2pYk github.com/glebarez/sqlite v1.10.0/go.mod h1:IJ+lfSOmiekhQsFTJRx/lHtGYmCdtAiTaf5wI9u5uHA= github.com/go-acme/lego/v4 v4.19.2 h1:Y8hrmMvWETdqzzkRly7m98xtPJJivWFsgWi8fcvZo+Y= github.com/go-acme/lego/v4 v4.19.2/go.mod h1:wtDe3dDkmV4/oI2nydpNXSJpvV10J9RCyZ6MbYxNtlQ= +github.com/go-acme/lego/v4 v4.19.3-0.20241021182303-19b535caac61/go.mod h1:WU9e59K5mO9UAq4zUpk9fQFUdHxEBO0WUMyVpTra9kg= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=