reverseproxy: remove options from renewCerts

This commit is contained in:
Girish Ramakrishnan
2022-11-14 08:13:47 +01:00
parent 5e2a55ecad
commit 0843baad8b
4 changed files with 7 additions and 12 deletions
+2 -3
View File
@@ -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;
}
+1 -1
View File
@@ -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
});
+3 -5
View File
@@ -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);
}
+1 -3
View File
@@ -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 }));