mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-07 11:16:37 +00:00
Fix expires at not updating
This commit is contained in:
@@ -790,32 +790,30 @@ export class TraefikConfigManager {
|
|||||||
"utf8"
|
"utf8"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Store the certificate expiry time
|
|
||||||
if (cert.expiresAt) {
|
|
||||||
const expiresAtPath = path.join(
|
|
||||||
domainDir,
|
|
||||||
".expires_at"
|
|
||||||
);
|
|
||||||
fs.writeFileSync(
|
|
||||||
expiresAtPath,
|
|
||||||
cert.expiresAt.toString(),
|
|
||||||
"utf8"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
`Certificate updated for domain: ${cert.domain}${cert.wildcard ? " (wildcard)" : ""}`
|
`Certificate updated for domain: ${cert.domain}${cert.wildcard ? " (wildcard)" : ""}`
|
||||||
);
|
);
|
||||||
|
|
||||||
// Update local state tracking
|
|
||||||
this.lastLocalCertificateState.set(cert.domain, {
|
|
||||||
exists: true,
|
|
||||||
lastModified: Math.floor(Date.now() / 1000),
|
|
||||||
expiresAt: cert.expiresAt,
|
|
||||||
wildcard: cert.wildcard
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Always update expiry tracking when we fetch a certificate,
|
||||||
|
// even if the cert content didn't change
|
||||||
|
if (cert.expiresAt) {
|
||||||
|
const expiresAtPath = path.join(domainDir, ".expires_at");
|
||||||
|
fs.writeFileSync(
|
||||||
|
expiresAtPath,
|
||||||
|
cert.expiresAt.toString(),
|
||||||
|
"utf8"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update local state tracking
|
||||||
|
this.lastLocalCertificateState.set(cert.domain, {
|
||||||
|
exists: true,
|
||||||
|
lastModified: Math.floor(Date.now() / 1000),
|
||||||
|
expiresAt: cert.expiresAt,
|
||||||
|
wildcard: cert.wildcard
|
||||||
|
});
|
||||||
|
|
||||||
// Always ensure the config entry exists and is up to date
|
// Always ensure the config entry exists and is up to date
|
||||||
const certEntry = {
|
const certEntry = {
|
||||||
certFile: certPath,
|
certFile: certPath,
|
||||||
|
|||||||
Reference in New Issue
Block a user