feat: Website SSL DNS Type support WestCN (#8305)
Some checks failed
SonarCloud Scan / SonarCloud (push) Has been cancelled

This commit is contained in:
zhengkunwang 2025-04-02 18:21:54 +08:00 committed by GitHub
parent dc880835d0
commit 3437d62f31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 38 additions and 1 deletions

View file

@ -3,6 +3,7 @@ package ssl
import (
"crypto"
"encoding/json"
"github.com/go-acme/lego/v4/providers/dns/westcn"
"os"
"strings"
"time"
@ -85,6 +86,7 @@ const (
TencentCloud DnsType = "TencentCloud"
HuaweiCloud DnsType = "HuaweiCloud"
RainYun DnsType = "RainYun"
WestCN DnsType = "WestCN"
)
type DNSParam struct {
@ -103,6 +105,7 @@ type DNSParam struct {
AuthID string `json:"authID"`
SubAuthID string `json:"subAuthID"`
AuthPassword string `json:"authPassword"`
Username string `json:"username"`
}
var (
@ -233,6 +236,14 @@ func (c *AcmeClient) UseDns(dnsType DnsType, params string, websiteSSL model.Web
rainyunConfig.PollingInterval = pollingInterval
rainyunConfig.TTL = ttl
p, err = rainyun.NewDNSProviderConfig(rainyunConfig)
case WestCN:
westcnConfig := westcn.NewDefaultConfig()
westcnConfig.Username = param.Username
westcnConfig.Password = param.Password
westcnConfig.PropagationTimeout = propagationTimeout
westcnConfig.PollingInterval = pollingInterval
westcnConfig.TTL = ttl
p, err = westcn.NewDNSProviderConfig(westcnConfig)
}
if err != nil {
return err

View file

@ -212,6 +212,10 @@ export const DNSTypes = [
label: i18n.global.t('website.rainyun'),
value: 'RainYun',
},
{
label: i18n.global.t('website.westCN'),
value: 'WestCN',
},
];
export const Fields = [

View file

@ -2261,6 +2261,7 @@ const message = {
"When the reverse proxy backend is HTTPS, you might need to set the origin SNI. Please refer to the CDN service provider's documentation for details.",
huaweicloud: 'Huawei Cloud',
rainyun: 'Rain Yun',
westCN: 'West CN',
},
php: {
short_open_tag: 'Short tag support',

View file

@ -2233,6 +2233,8 @@ const message = {
sniHelper:
'逆プロキシバックエンドがHTTPSの場合Origin SNIを設定する必要がある場合があります詳細についてはCDNサービスプロバイダーのドキュメントを参照してください',
huaweicloud: 'huaweiCloud',
rainyun: 'Rain Yun',
westCN: 'West CN',
},
php: {
short_open_tag: '短いタグサポート',

View file

@ -2195,6 +2195,7 @@ const message = {
'역방향 프록시 백엔드가 HTTPS 경우 원본 SNI 설정해야 있습니다. 자세한 내용은 CDN 서비스 제공자의 문서를 참조하세요.',
huaweicloud: '화웨이 클라우드',
rainyun: '레인윤',
westCN: 'West CN',
},
php: {
short_open_tag: '짧은 태그 지원',

View file

@ -2284,6 +2284,7 @@ const message = {
'Apabila backend proksi terbalik adalah HTTPS, anda mungkin perlu menetapkan sumber SNI. Sila rujuk dokumentasi penyedia perkhidmatan CDN untuk butiran.',
huaweicloud: 'Huawei Cloud',
rainyun: 'Rain Yun',
westCN: 'West CN',
},
php: {
short_open_tag: 'Sokongan tag pendek',

View file

@ -2280,6 +2280,8 @@ const message = {
sniHelper:
'Quando o proxy reverso de backend for HTTPS, você pode precisar configurar o SNI de origem. Consulte a documentação do provedor de serviços CDN para mais detalhes.',
huaweicloud: 'Huawei Cloud',
rainyun: 'Rain Yun',
westCN: 'West CN',
},
php: {
short_open_tag: 'Suporte para short tags',

View file

@ -2281,6 +2281,7 @@ const message = {
'Когда бэкенд обратного прокси использует HTTPS, может потребоваться установить origin SNI. Подробности см. в документации провайдера CDN.',
huaweicloud: 'Huawei Cloud',
rainyun: 'Rain Yun',
westCN: 'West CN',
},
php: {
short_open_tag: 'Поддержка коротких тегов',

View file

@ -2116,6 +2116,7 @@ const message = {
sniHelper: '反代後端為 https 的時候可能需要設定回源 SNI具體需要看 CDN 服務商文件',
huaweicloud: '華為雲',
rainyun: '雨雲',
westCN: '西部數據',
},
php: {
short_open_tag: '短標籤支援',

View file

@ -2117,6 +2117,7 @@ const message = {
sniHelper: '反代后端为 https 的时候可能需要设置回源 SNI具体需要看 CDN 服务商文档',
huaweicloud: '华为云',
rainyun: '雨云',
westCN: '西部数码',
},
php: {
short_open_tag: '短标签支持',

View file

@ -130,6 +130,14 @@
<el-input v-model.trim="account.authorization['token']"></el-input>
</el-form-item>
</div>
<div v-if="account.type === 'WestCN'">
<el-form-item label="Username" prop="authorization.username">
<el-input v-model.trim="account.authorization['username']"></el-input>
</el-form-item>
<el-form-item label="Password" prop="authorization.password">
<el-input v-model.trim="account.authorization['password']"></el-input>
</el-form-item>
</div>
</el-form>
</el-col>
</el-row>
@ -181,6 +189,7 @@ const rules = ref<any>({
email: [Rules.email],
password: [Rules.requiredInput],
authPassword: [Rules.requiredInput],
username: [Rules.requiredInput],
},
});
const account = ref({
@ -230,7 +239,7 @@ const submit = async (formEl: FormInstance | undefined) => {
return;
}
if (account.value.type === 'ClouDNS') {
if (!account.value.authorization.authID && !account.value.authorization.subAuthID) {
if (!account.value.authorization['authID'] && !account.value.authorization['subAuthID']) {
MsgError('Please input Auth ID or Sub Auth ID');
return;
}

1
go.mod
View file

@ -198,6 +198,7 @@ require (
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/nrdcg/dnspod-go v0.4.0 // indirect
github.com/nrdcg/freemyip v0.3.0 // indirect
github.com/nrdcg/mailinabox v0.2.0 // indirect
github.com/nrdcg/namesilo v0.2.1 // indirect
github.com/nwaples/rardecode/v2 v2.0.0-beta.2 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect

2
go.sum
View file

@ -760,6 +760,8 @@ github.com/nrdcg/dnspod-go v0.4.0 h1:c/jn1mLZNKF3/osJ6mz3QPxTudvPArXTjpkmYj0uK6U
github.com/nrdcg/dnspod-go v0.4.0/go.mod h1:vZSoFSFeQVm2gWLMkyX61LZ8HI3BaqtHZWgPTGKr6KQ=
github.com/nrdcg/freemyip v0.3.0 h1:0D2rXgvLwe2RRaVIjyUcQ4S26+cIS2iFwnhzDsEuuwc=
github.com/nrdcg/freemyip v0.3.0/go.mod h1:c1PscDvA0ukBF0dwelU/IwOakNKnVxetpAQ863RMJoM=
github.com/nrdcg/mailinabox v0.2.0 h1:IKq8mfKiVwNW2hQii/ng1dJ4yYMMv3HAP3fMFIq2CFk=
github.com/nrdcg/mailinabox v0.2.0/go.mod h1:0yxqeYOiGyxAu7Sb94eMxHPIOsPYXAjTeA9ZhePhGnc=
github.com/nrdcg/namesilo v0.2.1 h1:kLjCjsufdW/IlC+iSfAqj0iQGgKjlbUUeDJio5Y6eMg=
github.com/nrdcg/namesilo v0.2.1/go.mod h1:lwMvfQTyYq+BbjJd30ylEG4GPSS6PII0Tia4rRpRiyw=
github.com/nwaples/rardecode/v2 v2.0.0-beta.2 h1:e3mzJFJs4k83GXBEiTaQ5HgSc/kOK8q0rDaRO0MPaOk=