cert: only inform user if renewal fails and only 10 days left

This commit is contained in:
Girish Ramakrishnan
2021-06-01 09:09:16 -07:00
parent 380fe7c17a
commit e9ace613e2
2 changed files with 19 additions and 13 deletions

View File

@@ -247,6 +247,7 @@ async function onEvent(id, action, source, data) {
case eventlog.ACTION_CERTIFICATE_RENEWAL:
case eventlog.ACTION_CERTIFICATE_NEW:
if (!data.errorMessage) return;
if (!data.notAfter || (data.notAfter - new Date() >= (60 * 60 * 24 * 10 * 1000))) return; // more than 10 days left to expire
return await certificateRenewalError(id, data.domain, data.errorMessage);
case eventlog.ACTION_BACKUP_FINISH: