diff --git a/src/cert.go b/src/cert.go index 2f70825..0480b3e 100644 --- a/src/cert.go +++ b/src/cert.go @@ -12,6 +12,7 @@ import ( "strings" "time" + "imuslab.com/zoraxy/mod/acme" "imuslab.com/zoraxy/mod/utils" ) @@ -46,6 +47,7 @@ func handleListCertificate(w http.ResponseWriter, r *http.Request) { LastModifiedDate string ExpireDate string RemainingDays int + DNS bool } results := []*CertInfo{} @@ -81,12 +83,16 @@ func handleListCertificate(w http.ResponseWriter, r *http.Request) { } } } + certInfoFilename := filepath.Join(tlsCertManager.CertStore, filename+".json") + certInfo, err := acme.LoadCertInfoJSON(certInfoFilename) + SystemWideLogger.PrintAndLog("Could not Load CertInfoJson", certFilepath, err) thisCertInfo := CertInfo{ Domain: filename, LastModifiedDate: modifiedTime, ExpireDate: certExpireTime, RemainingDays: expiredIn, + DNS: certInfo.DNS, } results = append(results, &thisCertInfo) diff --git a/src/mod/acme/acme.go b/src/mod/acme/acme.go index ded82e1..8ea52dc 100644 --- a/src/mod/acme/acme.go +++ b/src/mod/acme/acme.go @@ -470,7 +470,7 @@ func IsPortInUse(port int) bool { } // Load cert information from json file -func loadCertInfoJSON(filename string) (*CertificateInfoJSON, error) { +func LoadCertInfoJSON(filename string) (*CertificateInfoJSON, error) { certInfoBytes, err := os.ReadFile(filename) if err != nil { return nil, err diff --git a/src/mod/acme/autorenew.go b/src/mod/acme/autorenew.go index a5481a9..9db5dfc 100644 --- a/src/mod/acme/autorenew.go +++ b/src/mod/acme/autorenew.go @@ -344,7 +344,7 @@ func (a *AutoRenewer) renewExpiredDomains(certs []*ExpiredCerts) ([]string, erro // Load certificate info for ACME detail certInfoFilename := fmt.Sprintf("%s/%s.json", filepath.Dir(expiredCert.Filepath), certName) - certInfo, err := loadCertInfoJSON(certInfoFilename) + certInfo, err := LoadCertInfoJSON(certInfoFilename) if err != nil { log.Printf("Renew %s certificate error, can't get the ACME detail for cert: %v, trying org section as ca", certName, err) diff --git a/src/web/components/cert.html b/src/web/components/cert.html index cbfd982..c39251f 100644 --- a/src/web/components/cert.html +++ b/src/web/components/cert.html @@ -66,6 +66,7 @@