edit comments for the forward changes

main
Leo Chen 2024-11-15 20:45:08 +08:00
parent d1d7b44303
commit 3265dd76ab
1 changed files with 3 additions and 3 deletions

View File

@ -135,7 +135,7 @@ func deploy(ctx context.Context, record *models.Record) error {
} }
func isCertChanged(certificate string, record *models.Record) bool { func isCertChanged(certificate string, record *models.Record) bool {
// 如果证书为空,直接返回false // 如果证书为空,直接返回true
if certificate == "" { if certificate == "" {
return true return true
} }
@ -147,7 +147,7 @@ func isCertChanged(certificate string, record *models.Record) bool {
return true return true
} }
// 遍历域名列表,检查是否都在证书中,找到第一个不存在证书中域名时提前返回false // 遍历域名列表,检查是否都在证书中,找到第一个不存在证书中域名时提前返回true
for _, domain := range strings.Split(record.GetString("domain"), ";") { for _, domain := range strings.Split(record.GetString("domain"), ";") {
if !slices.Contains(cert.DNSNames, domain) && !slices.Contains(cert.DNSNames, "*."+removeLastSubdomain(domain)) { if !slices.Contains(cert.DNSNames, domain) && !slices.Contains(cert.DNSNames, "*."+removeLastSubdomain(domain)) {
return true return true
@ -159,7 +159,7 @@ func isCertChanged(certificate string, record *models.Record) bool {
record.UnmarshalJSONField("applyConfig", applyConfig) record.UnmarshalJSONField("applyConfig", applyConfig)
// 检查证书加密算法是否一致 // 检查证书加密算法是否变更
switch pubkey := cert.PublicKey.(type) { switch pubkey := cert.PublicKey.(type) {
case *rsa.PublicKey: case *rsa.PublicKey:
bitSize := pubkey.N.BitLen() bitSize := pubkey.N.BitLen()