diff --git a/src/cloudron.js b/src/cloudron.js index ddb81dcba..3578a619e 100644 --- a/src/cloudron.js +++ b/src/cloudron.js @@ -297,11 +297,10 @@ async function updateDashboardDomain(domain, auditSource) { safe(services.rebuildService('turn', auditSource), { debug }); // to update the realm variable } -async function renewCerts(options, auditSource) { - assert.strictEqual(typeof options, 'object'); +async function renewCerts(auditSource) { assert.strictEqual(typeof auditSource, 'object'); - const taskId = await tasks.add(tasks.TASK_CHECK_CERTS, [ options, auditSource ]); + const taskId = await tasks.add(tasks.TASK_CHECK_CERTS, [ auditSource ]); tasks.startTask(taskId, {}); return taskId; } diff --git a/src/cron.js b/src/cron.js index 3058551e0..60e17a80e 100644 --- a/src/cron.js +++ b/src/cron.js @@ -148,7 +148,7 @@ async function startJobs() { // randomized per Cloudron based on hourlySeed gJobs.certificateRenew = new CronJob({ cronTime: `00 10 ${hour} * * *`, - onTick: async () => await safe(cloudron.renewCerts({}, AuditSource.CRON), { debug }), + onTick: async () => await safe(cloudron.renewCerts(AuditSource.CRON), { debug }), start: true }); diff --git a/src/reverseproxy.js b/src/reverseproxy.js index 60e894fa8..d8f2cf74f 100644 --- a/src/reverseproxy.js +++ b/src/reverseproxy.js @@ -643,8 +643,7 @@ async function unconfigureApp(app) { await reload(); } -async function renewCerts(options, auditSource, progressCallback) { - assert.strictEqual(typeof options, 'object'); +async function renewCerts(auditSource, progressCallback) { assert.strictEqual(typeof auditSource, 'object'); assert.strictEqual(typeof progressCallback, 'function'); @@ -752,12 +751,11 @@ async function cleanupCerts(auditSource, progressCallback) { debug('cleanupCerts: done'); } -async function checkCerts(options, auditSource, progressCallback) { - assert.strictEqual(typeof options, 'object'); +async function checkCerts(auditSource, progressCallback) { assert.strictEqual(typeof auditSource, 'object'); assert.strictEqual(typeof progressCallback, 'function'); - await renewCerts(options, auditSource, progressCallback); + await renewCerts(auditSource, progressCallback); await cleanupCerts(auditSource, progressCallback); } diff --git a/src/routes/cloudron.js b/src/routes/cloudron.js index f85a55752..dc8573d5f 100644 --- a/src/routes/cloudron.js +++ b/src/routes/cloudron.js @@ -300,9 +300,7 @@ async function prepareDashboardDomain(req, res, next) { } async function renewCerts(req, res, next) { - if ('domain' in req.body && typeof req.body.domain !== 'string') return next(new HttpError(400, 'domain must be a string')); - - const [error, taskId] = await safe(cloudron.renewCerts({ domain: req.body.domain || null }, AuditSource.fromRequest(req))); + const [error, taskId] = await safe(cloudron.renewCerts(AuditSource.fromRequest(req))); if (error) return next(BoxError.toHttpError(error)); next(new HttpSuccess(202, { taskId }));