From af41e8e429c5182e8e2d1902d16f6a55bc69fd20 Mon Sep 17 00:00:00 2001
From: igophper <34326532+igophper@users.noreply.github.com>
Date: Fri, 15 Nov 2024 16:46:45 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0DNS=E6=9C=8D=E5=8A=A1?=
=?UTF-8?q?=E5=95=86CloudDNS=20(#7081)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Refs #7038
---
backend/utils/ssl/client.go | 13 +++++++++++++
frontend/src/global/mimetype.ts | 4 ++++
.../views/website/ssl/dns-account/create/index.vue | 14 ++++++++++++++
3 files changed, 31 insertions(+)
diff --git a/backend/utils/ssl/client.go b/backend/utils/ssl/client.go
index 8ca976960..8365f7c9b 100644
--- a/backend/utils/ssl/client.go
+++ b/backend/utils/ssl/client.go
@@ -15,6 +15,7 @@ import (
"github.com/go-acme/lego/v4/challenge/dns01"
"github.com/go-acme/lego/v4/lego"
"github.com/go-acme/lego/v4/providers/dns/alidns"
+ "github.com/go-acme/lego/v4/providers/dns/clouddns"
"github.com/go-acme/lego/v4/providers/dns/cloudflare"
"github.com/go-acme/lego/v4/providers/dns/dnspod"
"github.com/go-acme/lego/v4/providers/dns/godaddy"
@@ -70,6 +71,7 @@ const (
AliYun DnsType = "AliYun"
Volcengine DnsType = "Volcengine"
CloudFlare DnsType = "CloudFlare"
+ CloudDns DnsType = "CloudDns"
NameSilo DnsType = "NameSilo"
NameCheap DnsType = "NameCheap"
NameCom DnsType = "NameCom"
@@ -89,6 +91,8 @@ type DNSParam struct {
APISecret string `json:"apiSecret"`
SecretID string `json:"secretID"`
Region string `json:"region"`
+ ClientID string `json:"clientID"`
+ Password string `json:"password"`
}
var (
@@ -140,6 +144,15 @@ func (c *AcmeClient) UseDns(dnsType DnsType, params string, websiteSSL model.Web
cloudflareConfig.PollingInterval = pollingInterval
cloudflareConfig.TTL = 3600
p, err = cloudflare.NewDNSProviderConfig(cloudflareConfig)
+ case CloudDns:
+ clouddnsConfig := clouddns.NewDefaultConfig()
+ clouddnsConfig.ClientID = param.ClientID
+ clouddnsConfig.Email = param.Email
+ clouddnsConfig.Password = param.Password
+ clouddnsConfig.PropagationTimeout = propagationTimeout
+ clouddnsConfig.PollingInterval = pollingInterval
+ clouddnsConfig.TTL = ttl
+ p, err = clouddns.NewDNSProviderConfig(clouddnsConfig)
case NameCheap:
namecheapConfig := namecheap.NewDefaultConfig()
namecheapConfig.APIKey = param.APIkey
diff --git a/frontend/src/global/mimetype.ts b/frontend/src/global/mimetype.ts
index ce2d8bfc9..a4f0123fe 100644
--- a/frontend/src/global/mimetype.ts
+++ b/frontend/src/global/mimetype.ts
@@ -180,6 +180,10 @@ export const DNSTypes = [
label: 'Cloudflare',
value: 'CloudFlare',
},
+ {
+ label: 'CloudDns',
+ value: 'CloudDns',
+ },
{
label: 'NameSilo',
value: 'NameSilo',
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 61a8a10e6..59187cce1 100644
--- a/frontend/src/views/website/ssl/dns-account/create/index.vue
+++ b/frontend/src/views/website/ssl/dns-account/create/index.vue
@@ -77,6 +77,17 @@