reverseproxy: move renew and trusted ip routes

This commit is contained in:
Girish Ramakrishnan
2023-08-04 13:19:48 +05:30
parent a49cb0b080
commit 1264cd1dd7
8 changed files with 64 additions and 47 deletions

View File

@@ -17,7 +17,6 @@ exports = module.exports = {
getLogStream,
updateDashboardDomain,
prepareDashboardDomain,
renewCerts,
getLanguages,
getSystemGraphs,
getPlatformStatus,
@@ -272,15 +271,6 @@ async function prepareDashboardDomain(req, res, next) {
next(new HttpSuccess(202, { taskId }));
}
async function renewCerts(req, res, next) {
if ('rebuild' in req.body && typeof req.body.rebuild !== 'boolean') return next(new HttpError(400, 'rebuild must be a boolean'));
const [error, taskId] = await safe(cloudron.renewCerts(req.body, AuditSource.fromRequest(req)));
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(202, { taskId }));
}
async function getLanguages(req, res, next) {
const [error, languages] = await safe(translation.getLanguages());
if (error) return next(new BoxError.toHttpError(error));