Skip to content

Commit

Permalink
feat: 增加火山引擎DNS
Browse files Browse the repository at this point in the history
  • Loading branch information
liuruibin committed Oct 22, 2024
1 parent 2458d60 commit 63519de
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 2 deletions.
13 changes: 12 additions & 1 deletion backend/utils/ssl/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package ssl
import (
"crypto"
"encoding/json"
"github.com/1Panel-dev/1Panel/backend/utils/ssl/huaweicloud"
"github.com/go-acme/lego/v4/providers/dns/cloudflare"
"os"
"strings"
"time"
Expand All @@ -15,14 +17,14 @@ 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/cloudflare"
"github.com/go-acme/lego/v4/providers/dns/dnspod"
"github.com/go-acme/lego/v4/providers/dns/godaddy"
"github.com/go-acme/lego/v4/providers/dns/huaweicloud"
"github.com/go-acme/lego/v4/providers/dns/namecheap"
"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"
Expand Down Expand Up @@ -67,6 +69,7 @@ type DnsType string
const (
DnsPod DnsType = "DnsPod"
AliYun DnsType = "AliYun"
Volcengine DnsType = "Volcengine"
CloudFlare DnsType = "CloudFlare"
NameSilo DnsType = "NameSilo"
NameCheap DnsType = "NameCheap"
Expand Down Expand Up @@ -122,6 +125,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
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/global/mimetype.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1922,6 +1922,7 @@ const message = {
SSLList: 'Certificate List',
createDnsAccount: 'DNS Account',
aliyun: 'Aliyun',
volcengine: 'Volcengine',
manual: 'Manual parsing',
key: 'Key',
check: 'View',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1784,6 +1784,7 @@ const message = {
SSLList: '證書列表',
createDnsAccount: 'DNS賬戶',
aliyun: '阿裏雲',
volcengine: '火山引擎',
manual: '手動解析',
key: '密',
check: '查',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1785,6 +1785,7 @@ const message = {
SSLList: '证书列表',
createDnsAccount: 'DNS账户',
aliyun: '阿里云',
volcengine: '火山引擎',
manual: '手动解析',
key: '密',
check: '查',
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/views/website/ssl/dns-account/create/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@
<el-form-item label="Region" prop="authorization.region" v-if="account.type === 'HuaweiCloud'">
<el-input v-model.trim="account.authorization['region']" :placeholder="'cn-north-1'"></el-input>
</el-form-item>
<div v-if="account.type === 'Volcengine'">
<el-form-item label="Access Key" prop="authorization.accessKey">
<el-input v-model.trim="account.authorization['accessKey']"></el-input>
</el-form-item>
<el-form-item label="Secret Key" prop="authorization.secretKey">
<el-input v-model.trim="account.authorization['secretKey']"></el-input>
</el-form-item>
</div>
<div v-if="account.type === 'TencentCloud'">
<el-form-item label="Secret ID" prop="authorization.secretID">
<el-input v-model.trim="account.authorization['secretID']"></el-input>
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down

0 comments on commit 63519de

Please sign in to comment.