Skip to content

Commit 7d81114

Browse files
Fix not resetting expired at time
1 parent a1284c0 commit 7d81114

1 file changed

Lines changed: 18 additions & 17 deletions

File tree

server/lib/traefik/TraefikConfigManager.ts

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -763,31 +763,32 @@ export class TraefikConfigManager {
763763
"utf8"
764764
);
765765

766-
// Store the certificate expiry time
767-
if (cert.expiresAt) {
768-
const expiresAtPath = path.join(domainDir, ".expires_at");
769-
fs.writeFileSync(
770-
expiresAtPath,
771-
cert.expiresAt.toString(),
772-
"utf8"
773-
);
774-
}
775-
776766
logger.info(
777767
`Certificate updated for domain: ${cert.domain}${
778768
cert.wildcard ? " (wildcard)" : ""
779769
}`
780770
);
771+
}
781772

782-
// Update local state tracking
783-
this.lastLocalCertificateState.set(cert.domain, {
784-
exists: true,
785-
lastModified: Math.floor(Date.now() / 1000),
786-
expiresAt: cert.expiresAt,
787-
wildcard: cert.wildcard
788-
});
773+
// Always update expiry tracking when we fetch a certificate,
774+
// even if the cert content didn't change
775+
if (cert.expiresAt) {
776+
const expiresAtPath = path.join(domainDir, ".expires_at");
777+
fs.writeFileSync(
778+
expiresAtPath,
779+
cert.expiresAt.toString(),
780+
"utf8"
781+
);
789782
}
790783

784+
// Update local state tracking
785+
this.lastLocalCertificateState.set(cert.domain, {
786+
exists: true,
787+
lastModified: Math.floor(Date.now() / 1000),
788+
expiresAt: cert.expiresAt,
789+
wildcard: cert.wildcard
790+
});
791+
791792
// Always ensure the config entry exists and is up to date
792793
const certEntry = {
793794
certFile: certPath,

0 commit comments

Comments
 (0)