1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 16:29:17 +08:00

fix: 解决自签证书开启自动续签报错的问题 (#5335)

This commit is contained in:
zhengkunwang 2024-06-07 11:02:03 +08:00 committed by GitHub
parent c394efa2ec
commit 63305e7316
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 6 deletions

View File

@ -77,7 +77,7 @@ type WebsiteSSLUpdate struct {
PrimaryDomain string `json:"primaryDomain" validate:"required"`
OtherDomains string `json:"otherDomains"`
Provider string `json:"provider" validate:"required"`
AcmeAccountID uint `json:"acmeAccountId" validate:"required"`
AcmeAccountID uint `json:"acmeAccountId"`
DnsAccountID uint `json:"dnsAccountId"`
KeyType string `json:"keyType"`
Apply bool `json:"apply"`

View File

@ -389,11 +389,13 @@ func (w WebsiteSSLService) Update(update request.WebsiteSSLUpdate) error {
updateParams["nameserver1"] = update.Nameserver1
updateParams["nameserver2"] = update.Nameserver2
acmeAccount, err := websiteAcmeRepo.GetFirst(commonRepo.WithByID(update.AcmeAccountID))
if err != nil {
return err
if websiteSSL.Provider != constant.SelfSigned {
acmeAccount, err := websiteAcmeRepo.GetFirst(commonRepo.WithByID(update.AcmeAccountID))
if err != nil {
return err
}
updateParams["acme_account_id"] = acmeAccount.ID
}
updateParams["acme_account_id"] = acmeAccount.ID
if update.PushDir {
if !files.NewFileOp().Stat(update.Dir) {
@ -412,7 +414,7 @@ func (w WebsiteSSLService) Update(update request.WebsiteSSLUpdate) error {
}
}
updateParams["domains"] = strings.Join(domains, ",")
if update.Provider == constant.DNSAccount || update.Provider == constant.Http {
if update.Provider == constant.DNSAccount || update.Provider == constant.Http || update.Provider == constant.SelfSigned {
updateParams["auto_renew"] = update.AutoRenew
} else {
updateParams["auto_renew"] = false