2022-10-28 17:04:57 +08:00
|
|
|
package model
|
|
|
|
|
2023-11-23 11:00:08 +08:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/constant"
|
|
|
|
"path"
|
|
|
|
"time"
|
|
|
|
)
|
2022-11-11 17:41:39 +08:00
|
|
|
|
2022-12-13 17:20:13 +08:00
|
|
|
type WebsiteSSL struct {
|
2022-10-28 17:04:57 +08:00
|
|
|
BaseModel
|
2024-05-07 18:01:00 +08:00
|
|
|
PrimaryDomain string `json:"primaryDomain"`
|
|
|
|
PrivateKey string `json:"privateKey"`
|
|
|
|
Pem string `json:"pem"`
|
|
|
|
Domains string `json:"domains"`
|
|
|
|
CertURL string `json:"certURL"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
Provider string `json:"provider"`
|
|
|
|
Organization string `json:"organization"`
|
|
|
|
DnsAccountID uint `json:"dnsAccountId"`
|
|
|
|
AcmeAccountID uint `gorm:"column:acme_account_id" json:"acmeAccountId" `
|
|
|
|
CaID uint `json:"caId"`
|
|
|
|
AutoRenew bool `json:"autoRenew"`
|
2023-01-04 11:44:43 +08:00
|
|
|
ExpireDate time.Time `json:"expireDate"`
|
|
|
|
StartDate time.Time `json:"startDate"`
|
2024-05-07 18:01:00 +08:00
|
|
|
Status string `json:"status"`
|
2023-11-20 10:44:10 +08:00
|
|
|
Message string `json:"message"`
|
2024-05-07 18:01:00 +08:00
|
|
|
KeyType string `json:"keyType"`
|
|
|
|
PushDir bool `json:"pushDir"`
|
2023-11-27 14:00:09 +08:00
|
|
|
Dir string `json:"dir"`
|
2023-11-28 15:42:10 +08:00
|
|
|
Description string `json:"description"`
|
2024-05-07 18:26:34 +08:00
|
|
|
SkipDNS bool `json:"skipDNS"`
|
|
|
|
Nameserver1 string `json:"nameserver1"`
|
|
|
|
Nameserver2 string `json:"nameserver2"`
|
|
|
|
DisableCNAME bool `json:"disableCNAME"`
|
2023-01-04 11:44:43 +08:00
|
|
|
|
2023-02-27 17:22:14 +08:00
|
|
|
AcmeAccount WebsiteAcmeAccount `json:"acmeAccount" gorm:"-:migration"`
|
2023-11-27 14:00:09 +08:00
|
|
|
DnsAccount WebsiteDnsAccount `json:"dnsAccount" gorm:"-:migration"`
|
2023-02-27 17:22:14 +08:00
|
|
|
Websites []Website `json:"websites" gorm:"-:migration"`
|
2022-11-11 17:41:39 +08:00
|
|
|
}
|
|
|
|
|
2022-12-13 17:20:13 +08:00
|
|
|
func (w WebsiteSSL) TableName() string {
|
2022-11-11 17:41:39 +08:00
|
|
|
return "website_ssls"
|
2022-10-28 17:04:57 +08:00
|
|
|
}
|
2023-11-23 11:00:08 +08:00
|
|
|
|
|
|
|
func (w WebsiteSSL) GetLogPath() string {
|
|
|
|
return path.Join(constant.SSLLogDir, fmt.Sprintf("%s-ssl-%d.log", w.PrimaryDomain, w.ID))
|
|
|
|
}
|