sysinfo: return the ipv4 and ipv6 address

This commit is contained in:
Girish Ramakrishnan
2022-01-06 12:49:56 -08:00
parent 91b1265833
commit 0654d549db
2 changed files with 33 additions and 33 deletions

View File

@@ -294,10 +294,12 @@ async function syncExternalLdap(req, res, next) {
}
async function getServerIp(req, res, next) {
const [error, ip] = await safe(sysinfo.getServerIPv4());
if (error) return next(BoxError.toHttpError(error));
const [ipv4Error, ipv4] = await safe(sysinfo.getServerIPv4());
if (ipv4Error) return next(BoxError.toHttpError(ipv4Error));
next(new HttpSuccess(200, { ip }));
const [, ipv6] = await safe(sysinfo.getServerIPv6(), { debug }); // ignore any error
next(new HttpSuccess(200, { ipv4, ipv6 }));
}
async function getLanguages(req, res, next) {