Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions agent/app/dto/request/website_ssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ type WebsiteAcmeAccountCreate struct {
EabHmacKey string `json:"eabHmacKey"`
UseProxy bool `json:"useProxy"`
CaDirURL string `json:"caDirURL"`
UseEAB bool `json:"useEAB"`
}

type WebsiteAcmeAccountUpdate struct {
Expand Down
1 change: 1 addition & 0 deletions agent/app/model/website_acme_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type WebsiteAcmeAccount struct {
KeyType string `gorm:"not null;default:2048" json:"keyType"`
UseProxy bool `gorm:"default:false" json:"useProxy"`
CaDirURL string `json:"caDirURL"`
UseEAB bool `json:"useEAB"`
}

func (w WebsiteAcmeAccount) TableName() string {
Expand Down
3 changes: 2 additions & 1 deletion agent/app/service/website_acme_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ func (w WebsiteAcmeAccountService) Create(create request.WebsiteAcmeAccountCreat
Type: create.Type,
KeyType: create.KeyType,
UseProxy: create.UseProxy,
UseEAB: create.UseEAB,
}

if create.Type == "google" || create.Type == "freessl" {
if create.Type == "google" || create.Type == "freessl" || (create.Type == "custom" && create.UseEAB) {
if create.EabKid == "" || create.EabHmacKey == "" {
return nil, buserr.New("ErrEabKidOrEabHmacKeyCannotBlank")
}
Expand Down
1 change: 1 addition & 0 deletions agent/init/migration/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func InitAgentDB() {
migrations.InitPingStatus,
migrations.UpdateApp,
migrations.AddCronjobArgs,
migrations.AddWebsiteAcmeAccountColumn,
})
if err := m.Migrate(); err != nil {
global.LOG.Error(err)
Expand Down
7 changes: 7 additions & 0 deletions agent/init/migration/migrations/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -814,3 +814,10 @@ var AddCronjobArgs = &gormigrate.Migration{
return tx.AutoMigrate(&model.Cronjob{})
},
}

var AddWebsiteAcmeAccountColumn = &gormigrate.Migration{
ID: "20260110-add-website-acme-account",
Migrate: func(tx *gorm.DB) error {
return tx.AutoMigrate(&model.WebsiteAcmeAccount{})
},
}
3 changes: 2 additions & 1 deletion agent/utils/ssl/acme.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func NewRegisterClient(acmeAccount *model.WebsiteAcmeAccount, proxy *dto.SystemP
return nil, err
}
var reg *registration.Resource
if acmeAccount.Type == "zerossl" || acmeAccount.Type == "google" || acmeAccount.Type == "freessl" {
if acmeAccount.Type == "zerossl" || acmeAccount.Type == "google" || acmeAccount.Type == "freessl" || (acmeAccount.Type == "custom" && acmeAccount.UseEAB) {
if acmeAccount.Type == "zerossl" {
var res *zeroSSLRes
res, err = getZeroSSLEabCredentials(acmeAccount.Email)
Expand Down Expand Up @@ -182,6 +182,7 @@ func getCaDirURL(accountType, customCaURL string) string {
switch accountType {
case "letsencrypt":
caDirURL = "https://acme-v02.api.letsencrypt.org/directory"
caDirURL = "https://acme-staging-v02.api.letsencrypt.org/directory"
case "zerossl":
caDirURL = "https://acme.zerossl.com/v2/DV90"
case "buypass":
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 @@ -2944,6 +2944,7 @@ const message = {
fromMaster: 'Master Node Push',
hostedZoneID: 'Hosted Zone ID',
isIP: 'IP Certificate',
useEAB: 'Use EAB authentication',
},
firewall: {
create: 'Create rule',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/es-es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2932,6 +2932,7 @@ const message = {
fromMaster: 'Envío desde el nodo maestro',
hostedZoneID: 'Hosted Zone ID',
isIP: 'Certificado IP',
useEAB: 'Usar autenticación EAB',
},
firewall: {
create: 'Crear regla',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2865,6 +2865,7 @@ const message = {
fromMaster: 'マスターノードからのプッシュ',
hostedZoneID: 'Hosted Zone ID',
isIP: 'IP証明書',
useEAB: 'EAB認証を使用',
},
firewall: {
create: 'ルールを作成します',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2814,6 +2814,7 @@ const message = {
fromMaster: '마스터 노드에서 푸시',
hostedZoneID: 'Hosted Zone ID',
isIP: 'IP 인증서',
useEAB: 'EAB 인증 사용',
},
firewall: {
create: '규칙 만들기',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2926,6 +2926,7 @@ const message = {
fromMaster: 'Tolak dari Nod Utama',
hostedZoneID: 'Hosted Zone ID',
isIP: 'Sijil IP',
useEAB: 'Gunakan pengesahan EAB',
},
firewall: {
create: 'Buat peraturan',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2933,6 +2933,7 @@ const message = {
fromMaster: 'Envio do Nó Mestre',
hostedZoneID: 'Hosted Zone ID',
isIP: 'Certificado de IP',
useEAB: 'Usar autenticação EAB',
},
firewall: {
create: 'Criar regra',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2926,6 +2926,7 @@ const message = {
fromMaster: 'Отправка с главного узла',
hostedZoneID: 'Hosted Zone ID',
isIP: 'IP-сертификат',
useEAB: 'Использовать аутентификацию EAB',
},
firewall: {
create: 'Создать правило',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2982,6 +2982,7 @@ const message = {
fromMaster: 'Ana Düğümden Gönder',
hostedZoneID: 'Hosted Zone ID',
isIP: 'IP Sertifikası',
useEAB: 'EAB kimlik doğrulamasını kullan',
},
firewall: {
create: 'Kural oluştur',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/zh-Hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2738,6 +2738,7 @@ const message = {
fromMaster: '主節點推送',
hostedZoneID: '託管區域 ID',
isIP: 'IP 憑證',
useEAB: '使用 EAB 認證',
},
firewall: {
create: '建立規則',
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 @@ -2735,6 +2735,7 @@ const message = {
fromMaster: '主节点推送',
hostedZoneID: '托管区域 ID',
isIP: 'IP 证书',
useEAB: '使用 EAB 认证',
},
firewall: {
create: '创建规则',
Expand Down
21 changes: 17 additions & 4 deletions frontend/src/views/website/ssl/acme-account/create/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,22 @@
></el-option>
</el-select>
</el-form-item>
<div v-if="account.type == 'google' || account.type == 'freessl'">
<div v-if="account.type == 'custom'">
<el-form-item :label="$t('ssl.customAcmeURL')" prop="caDirURL">
<el-input v-model.trim="account.caDirURL"></el-input>
</el-form-item>
<el-form-item :label="$t('ssl.useEAB')" prop="useEAB">
<el-switch v-model="account.useEAB"></el-switch>
</el-form-item>
</div>

<div
v-if="
account.type == 'google' ||
account.type == 'freessl' ||
(account.type === 'custom' && account.useEAB)
"
>
<el-form-item label="EAB kid" prop="eabKid">
<el-input v-model.trim="account.eabKid"></el-input>
</el-form-item>
Expand All @@ -55,9 +70,6 @@
{{ $t('ssl.googleHelper') }}
</el-link>
</div>
<el-form-item v-if="account.type == 'custom'" :label="$t('ssl.customAcmeURL')" prop="caDirURL">
<el-input v-model.trim="account.caDirURL"></el-input>
</el-form-item>
</el-form>
</el-col>
</el-row>
Expand Down Expand Up @@ -102,6 +114,7 @@ const initData = () => ({
keyType: 'P256',
useProxy: false,
caDirURL: '',
useEAB: false,
});

const account = ref(initData());
Expand Down
Loading