Skip to content

Commit 9c54d1b

Browse files
committed
Provide the token model for certificate renewal
1 parent f7d1c49 commit 9c54d1b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

backend/internal/certificate.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const config = require('../lib/config');
88
const error = require('../lib/error');
99
const utils = require('../lib/utils');
1010
const certificateModel = require('../models/certificate');
11+
const tokenModel = require('../models/token');
1112
const dnsPlugins = require('../global/certbot-dns-plugins');
1213
const internalAuditLog = require('./audit-log');
1314
const internalNginx = require('./nginx');
@@ -45,11 +46,11 @@ const internalCertificate = {
4546
processExpiringHosts: () => {
4647
if (!internalCertificate.intervalProcessing) {
4748
internalCertificate.intervalProcessing = true;
48-
logger.info('Renewing SSL certs close to expiry...');
49+
logger.info('Renewing SSL certs expiring within ' + internalCertificate.renewBeforeExpirationBy[0] + ' ' + internalCertificate.renewBeforeExpirationBy[1] + ' ...');
4950

5051
const expirationThreshold = moment().add(internalCertificate.renewBeforeExpirationBy[0], internalCertificate.renewBeforeExpirationBy[1]).format('YYYY-MM-DD HH:mm:ss');
5152

52-
// Fetch all the letsencrypt certs from the db that will expire within N days
53+
// Fetch all the letsencrypt certs from the db that will expire within the configured threshold
5354
certificateModel
5455
.query()
5556
.where('is_deleted', 0)
@@ -75,6 +76,7 @@ const internalCertificate = {
7576
Promise.resolve({
7677
permission_visibility: 'all',
7778
}),
79+
token: new tokenModel(),
7880
},
7981
{ id: certificate.id },
8082
)
@@ -88,6 +90,7 @@ const internalCertificate = {
8890
return sequence;
8991
})
9092
.then(() => {
93+
logger.info('Completed SSL cert renew process');
9194
internalCertificate.intervalProcessing = false;
9295
})
9396
.catch((err) => {

0 commit comments

Comments
 (0)