sysinfo: return the ipv4 and ipv6 address
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user