fold sysinfo into network

the backends are network backends
This commit is contained in:
Girish Ramakrishnan
2023-08-03 13:38:42 +05:30
parent a4d57e7b08
commit 47d57a3971
23 changed files with 143 additions and 161 deletions

View File

@@ -21,8 +21,6 @@ exports = module.exports = {
updateDashboardDomain,
prepareDashboardDomain,
renewCerts,
getServerIpv4,
getServerIpv6,
getLanguages,
syncDnsRecords,
getSystemGraphs,
@@ -43,7 +41,6 @@ const assert = require('assert'),
platform = require('../platform.js'),
safe = require('safetydance'),
speakeasy = require('speakeasy'),
sysinfo = require('../sysinfo.js'),
system = require('../system.js'),
tokens = require('../tokens.js'),
translation = require('../translation.js'),
@@ -309,20 +306,6 @@ async function renewCerts(req, res, next) {
next(new HttpSuccess(202, { taskId }));
}
async function getServerIpv4(req, res, next) {
const [error, ipv4] = await safe(sysinfo.getServerIPv4());
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, { ipv4 }));
}
async function getServerIpv6(req, res, next) {
const [error, ipv6] = await safe(sysinfo.getServerIPv6()); // ignore any error
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, { ipv6 }));
}
async function getLanguages(req, res, next) {
const [error, languages] = await safe(translation.getLanguages());
if (error) return next(new BoxError.toHttpError(error));