mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-08 02:20:24 +08:00
[SSL证书]实现基本的自动申请证书流程
This commit is contained in:
@@ -178,6 +178,7 @@ func (this *SSLCertDAO) ComposeCertConfig(certId int64) (*sslconfigs.SSLCertConf
|
||||
config.Id = int64(cert.Id)
|
||||
config.IsOn = cert.IsOn == 1
|
||||
config.IsCA = cert.IsCA == 1
|
||||
config.IsACME = cert.IsACME == 1
|
||||
config.Name = cert.Name
|
||||
config.Description = cert.Description
|
||||
config.CertData = []byte(cert.CertData)
|
||||
@@ -269,3 +270,16 @@ func (this *SSLCertDAO) ListCertIds(isCA bool, isAvailable bool, isExpired bool,
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// 设置证书的ACME信息
|
||||
func (this *SSLCertDAO) UpdateCertACME(certId int64, acmeTaskId int64) error {
|
||||
if certId <= 0 {
|
||||
return errors.New("invalid certId")
|
||||
}
|
||||
op := NewSSLCertOperator()
|
||||
op.Id = certId
|
||||
op.AcmeTaskId = acmeTaskId
|
||||
op.IsACME = true
|
||||
_, err := this.Save(op)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user