add separate route to get ipv4 and ipv6
This commit is contained in:
@@ -19,7 +19,8 @@ exports = module.exports = {
|
||||
updateDashboardDomain,
|
||||
prepareDashboardDomain,
|
||||
renewCerts,
|
||||
getServerIp,
|
||||
getServerIpv4,
|
||||
getServerIpv6,
|
||||
getLanguages,
|
||||
syncExternalLdap,
|
||||
syncDnsRecords
|
||||
@@ -293,13 +294,18 @@ async function syncExternalLdap(req, res, next) {
|
||||
next(new HttpSuccess(202, { taskId }));
|
||||
}
|
||||
|
||||
async function getServerIp(req, res, next) {
|
||||
const [ipv4Error, ipv4] = await safe(sysinfo.getServerIPv4());
|
||||
if (ipv4Error) return next(BoxError.toHttpError(ipv4Error));
|
||||
async function getServerIpv4(req, res, next) {
|
||||
const [error, ipv4] = await safe(sysinfo.getServerIPv4());
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
const [, ipv6] = await safe(sysinfo.getServerIPv6(), { debug }); // ignore any error
|
||||
next(new HttpSuccess(200, { ipv4 }));
|
||||
}
|
||||
|
||||
next(new HttpSuccess(200, { ipv4, ipv6 }));
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user