fix: 解决创建 Google Cloud Acme 账号失败的问题 (#3205)

pull/3213/head
zhengkunwang 2023-12-06 22:24:40 +08:00 committed by GitHub
parent b6cbca36c2
commit 2fdca95255
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 9 deletions

View File

@ -39,19 +39,20 @@ func (w WebsiteAcmeAccountService) Create(create request.WebsiteAcmeAccountCreat
if exist != nil {
return nil, buserr.New(constant.ErrEmailIsExist)
}
if create.Type == "google" && (create.EabKid == "" || create.EabHmacKey == "") {
return nil, buserr.New(constant.ErrEabKidOrEabHmacKeyCannotBlank)
} else {
create.EabKid = ""
create.EabHmacKey = ""
}
acmeAccount := &model.WebsiteAcmeAccount{
Email: create.Email,
Type: create.Type,
KeyType: create.KeyType,
}
if create.Type == "google" {
if create.EabKid == "" || create.EabHmacKey == "" {
return nil, buserr.New(constant.ErrEabKidOrEabHmacKeyCannotBlank)
}
acmeAccount.EabKid = create.EabKid
acmeAccount.EabHmacKey = create.EabHmacKey
}
client, err := ssl.NewAcmeClient(acmeAccount)
if err != nil {
return nil, err

View File

@ -165,7 +165,7 @@ export const DNSTypes = [
value: 'NameCom',
},
{
label: 'Godaddy',
label: 'GoDaddy',
value: 'Godaddy',
},
];

View File

@ -1872,6 +1872,7 @@ const message = {
buypassHelper: 'Buypass ',
googleHelper:
"<a target=“_blank” href='https://cloud.google.com/certificate-manager/docs/public-ca-tutorial?hl=zh-cn'>如何取得EAB HmacKey 和EAB kid</a > ",
googleCloudHelper: 'Google Cloud API is not accessible in most parts of mainland China',
},
firewall: {
create: 'Create rule',

View File

@ -1756,6 +1756,7 @@ const message = {
buypassHelper: 'Buypass ',
googleHelper:
"<a target=“_blank” href='https://cloud.google.com/certificate-manager/docs/public-ca-tutorial?hl=zh-cn'>如何取得EAB HmacKey 和EAB kid</a > ",
googleCloudHelper: 'Google Cloud API ',
},
firewall: {
create: '',

View File

@ -1756,6 +1756,7 @@ const message = {
buypassHelper: 'Buypass 访',
googleHelper:
"<a target=“_blank” href='https://cloud.google.com/certificate-manager/docs/public-ca-tutorial?hl=zh-cn'>如何获取 EAB HmacKey 和 EAB kid</a> ",
googleCloudHelper: 'Google Cloud API 访',
},
firewall: {
create: '',

View File

@ -34,6 +34,7 @@
:value="keyType.value"
></el-option>
</el-select>
<span class="input-help">{{ $t('ssl.googleCloudHelper') }}</span>
</el-form-item>
<div v-if="account.type == 'google'">
<el-form-item label="EAB kid" prop="eabKid">