feat: add certificate expiration notifications #387

This commit is contained in:
Jacky 2025-04-09 14:04:52 +00:00
parent 7a0972495f
commit 1512e1de85
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
21 changed files with 1616 additions and 1235 deletions

View file

@ -1,13 +1,14 @@
package model
import (
"os"
"github.com/0xJacky/Nginx-UI/internal/helper"
"github.com/0xJacky/Nginx-UI/internal/nginx"
"github.com/go-acme/lego/v4/certcrypto"
"github.com/go-acme/lego/v4/certificate"
"github.com/lib/pq"
"gorm.io/gorm/clause"
"os"
)
const (
@ -128,3 +129,12 @@ func (c *CertificateResource) GetResource() certificate.Resource {
CSR: c.CSR,
}
}
// GetCertList returns all certificates
func GetCertList() (c []*Cert) {
if db == nil {
return
}
db.Find(&c)
return
}