mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-05 07:26:36 +08:00
[新增] 添加转换上传的 TLS 证书为 ACME 管理证书的功能
This commit is contained in:
@@ -18,11 +18,24 @@ type TLSCertificateInput struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type TLSCertificateContent struct {
|
type TLSCertificateContent struct {
|
||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
CertPEM string `json:"cert_pem"`
|
CertPEM string `json:"cert_pem"`
|
||||||
KeyPEM string `json:"key_pem"`
|
KeyPEM string `json:"key_pem"`
|
||||||
Remark string `json:"remark"`
|
Remark string `json:"remark"`
|
||||||
|
Provider string `json:"provider"`
|
||||||
|
AcmeAccountID uint `json:"acme_account_id"`
|
||||||
|
DnsAccountID uint `json:"dns_account_id"`
|
||||||
|
KeyAlgorithm string `json:"key_algorithm"`
|
||||||
|
AutoRenew bool `json:"auto_renew"`
|
||||||
|
PrimaryDomain string `json:"primary_domain"`
|
||||||
|
OtherDomains string `json:"other_domains"`
|
||||||
|
DisableCNAME bool `json:"disable_cname"`
|
||||||
|
SkipDNS bool `json:"skip_dns"`
|
||||||
|
DNS1 string `json:"dns1"`
|
||||||
|
DNS2 string `json:"dns2"`
|
||||||
|
ApplyStatus string `json:"apply_status"`
|
||||||
|
ApplyMessage string `json:"apply_message"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TLSApplyInput struct {
|
type TLSApplyInput struct {
|
||||||
@@ -65,11 +78,24 @@ func GetTLSCertificateContent(id uint) (*TLSCertificateContent, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &TLSCertificateContent{
|
return &TLSCertificateContent{
|
||||||
ID: certificate.ID,
|
ID: certificate.ID,
|
||||||
Name: certificate.Name,
|
Name: certificate.Name,
|
||||||
CertPEM: certificate.CertPEM,
|
CertPEM: certificate.CertPEM,
|
||||||
KeyPEM: certificate.KeyPEM,
|
KeyPEM: certificate.KeyPEM,
|
||||||
Remark: certificate.Remark,
|
Remark: certificate.Remark,
|
||||||
|
Provider: certificate.Provider,
|
||||||
|
AcmeAccountID: certificate.AcmeAccountID,
|
||||||
|
DnsAccountID: certificate.DnsAccountID,
|
||||||
|
KeyAlgorithm: certificate.KeyAlgorithm,
|
||||||
|
AutoRenew: certificate.AutoRenew,
|
||||||
|
PrimaryDomain: certificate.PrimaryDomain,
|
||||||
|
OtherDomains: certificate.OtherDomains,
|
||||||
|
DisableCNAME: certificate.DisableCNAME,
|
||||||
|
SkipDNS: certificate.SkipDNS,
|
||||||
|
DNS1: certificate.DNS1,
|
||||||
|
DNS2: certificate.DNS2,
|
||||||
|
ApplyStatus: certificate.ApplyStatus,
|
||||||
|
ApplyMessage: certificate.ApplyMessage,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,8 @@ export function CertificateApplyModal({
|
|||||||
other_domains:
|
other_domains:
|
||||||
mode === 'convert-upload' ? '' : certificate.other_domains || '',
|
mode === 'convert-upload' ? '' : certificate.other_domains || '',
|
||||||
remark: certificate.remark || '',
|
remark: certificate.remark || '',
|
||||||
acme_account_id: certificate.acme_account_id,
|
acme_account_id:
|
||||||
|
mode === 'convert-upload' ? 0 : certificate.acme_account_id,
|
||||||
dns_account_id:
|
dns_account_id:
|
||||||
mode === 'convert-upload' ? 0 : certificate.dns_account_id,
|
mode === 'convert-upload' ? 0 : certificate.dns_account_id,
|
||||||
key_algorithm: certificate.key_algorithm || 'EC256',
|
key_algorithm: certificate.key_algorithm || 'EC256',
|
||||||
|
|||||||
Reference in New Issue
Block a user