mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 13:47:15 +08:00
feat: 更准确的证书续签判断
This commit is contained in:
@@ -53,6 +53,7 @@ func (r *certRepo) List(page, limit uint) ([]*types.CertList, int64, error) {
|
||||
AutoRenew: cert.AutoRenew,
|
||||
Cert: cert.Cert,
|
||||
Key: cert.Key,
|
||||
CertURL: cert.CertURL,
|
||||
Script: cert.Script,
|
||||
CreatedAt: cert.CreatedAt,
|
||||
UpdatedAt: cert.UpdatedAt,
|
||||
@@ -290,7 +291,11 @@ func (r *certRepo) Renew(id uint) (*acme.Certificate, error) {
|
||||
|
||||
ssl, err := client.RenewCertificate(context.Background(), cert.CertURL, cert.Domains, acme.KeyType(cert.Type))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
// 续签失败,尝试重签
|
||||
ssl, err = client.ObtainCertificate(context.Background(), cert.Domains, acme.KeyType(cert.Type))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
cert.CertURL = ssl.URL
|
||||
|
||||
@@ -12,6 +12,7 @@ type CertList struct {
|
||||
AutoRenew bool `json:"auto_renew"`
|
||||
Cert string `json:"cert"`
|
||||
Key string `json:"key"`
|
||||
CertURL string `json:"cert_url"`
|
||||
Script string `json:"script"`
|
||||
NotBefore time.Time `json:"not_before"`
|
||||
NotAfter time.Time `json:"not_after"`
|
||||
|
||||
@@ -219,7 +219,7 @@ const columns: any = [
|
||||
}
|
||||
)
|
||||
: null,
|
||||
row.cert != '' && row.key != '' && row.type != 'upload'
|
||||
row.cert_url != '' && row.type != 'upload'
|
||||
? h(
|
||||
NButton,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user