fix(certs): Populate certificate status for cert-store-loaded certificates after SmartProxy startup and check proxy-certs in opsserver certificate handler

This commit is contained in:
2026-02-16 01:58:39 +00:00
parent cd957526e2
commit 121573de2f
7 changed files with 62 additions and 12 deletions

View File

@@ -156,13 +156,21 @@ export class CertificateHandler {
// Check persisted cert data from StorageManager
if (status === 'unknown') {
const cleanDomain = domain.replace(/^\*\.?/, '');
const certData = await dcRouter.storageManager.getJSON(`/certs/${cleanDomain}`);
let certData = await dcRouter.storageManager.getJSON(`/certs/${cleanDomain}`);
if (!certData) {
// Also check certStore path (proxy-certs)
certData = await dcRouter.storageManager.getJSON(`/proxy-certs/${domain}`);
}
if (certData?.validUntil) {
expiryDate = new Date(certData.validUntil).toISOString();
if (certData.created) {
issuedAt = new Date(certData.created).toISOString();
}
issuer = 'smartacme-dns-01';
} else if (certData) {
// certStore has the cert (no expiry metadata) — it's loaded and serving
status = 'valid';
issuer = 'cert-store';
}
}