feat(smartacme): add forceRenew option to bypass cached certificate reuse during issuance
This commit is contained in:
@@ -11,6 +11,7 @@ interface ICertIssuanceInput {
|
||||
domainArg: string;
|
||||
isWildcardRequest: boolean;
|
||||
includeWildcard: boolean;
|
||||
forceRenew: boolean;
|
||||
}
|
||||
|
||||
const CERT_ISSUANCE_STEPS = [
|
||||
@@ -159,6 +160,7 @@ export class SmartAcme {
|
||||
},
|
||||
shouldExecute: async (_task, input?: ICertIssuanceInput) => {
|
||||
if (!input?.certDomainName || !this.certmanager) return true;
|
||||
if (input.forceRenew) return true;
|
||||
// Safety net: if a valid cert is already cached, skip re-issuance
|
||||
const existing = await this.certmanager.retrieveCertificate(input.certDomainName);
|
||||
if (existing && !existing.shouldBeRenewed()) {
|
||||
@@ -397,6 +399,7 @@ export class SmartAcme {
|
||||
domainArg,
|
||||
isWildcardRequest,
|
||||
includeWildcard: options?.includeWildcard ?? false,
|
||||
forceRenew,
|
||||
};
|
||||
|
||||
const result = await this.taskManager.triggerTaskConstrained(
|
||||
|
||||
Reference in New Issue
Block a user