diff --git a/backend/services/network.js b/backend/services/network.js index 34d7274..a3a4ba9 100644 --- a/backend/services/network.js +++ b/backend/services/network.js @@ -22,13 +22,21 @@ async function getNetworkAdditionalData(data) { delete data.remoteTraceLevel; delete data.remoteTraceTarget; - let ad = { ...additionalData.value() }; + //let ad = { ...additionalData.value() }; + let ad_ = additionalData.value(); + let ad = JSON.parse(JSON.stringify(ad_)); data.dns = { - domain: ad.dnsDomain, - servers: ["pippo"], + domain: ad_.dnsDomain, + servers: [], }; - if (ad.dnsIP) data.dns["servers"].push(ad.dnsIP); - console.log(`*** dns="${JSON.stringify(ad)}" -> ${JSON.stringify(data.dns)}`); + if (ad_.dnsIP) data.dns["servers"].push(ad_.dnsIP); + console.log( + `*** ad_="${JSON.stringify(ad_, null, 3)}" -> ad="${JSON.stringify( + ad, + null, + 3 + )}" -> ${JSON.stringify(data.dns, null, 3)}` + ); delete ad.dnsIP; delete ad.dnsDomain; delete ad.dnsEnable; diff --git a/backend/utils/zns.js b/backend/utils/zns.js index 731f167..65cc428 100644 --- a/backend/utils/zns.js +++ b/backend/utils/zns.js @@ -1,8 +1,8 @@ +const cp = require("child_process"); const path = require("path"); const fs = require("fs"); const db = require("../utils/db"); -const cp = require("child_process"); //TODO: does this kind of "optimization" make sense in Node.js? let token = null; @@ -61,7 +61,7 @@ function startDNS(token, nwid, conf) { opts.push("-E", e); return true; } catch (e) { - console.warn(` cannot execute (${e})`); + console.warn(" cannot execute"); return false; } }) @@ -70,7 +70,7 @@ function startDNS(token, nwid, conf) { return; } } - opts.push("start", "-v", "-v"); + opts.push("start"); if (conf.hasOwnProperty("dnsWildcard") && conf.dnsWildcard) { opts.push("-w"); } diff --git a/frontend/src/components/NetworkSettings/NetworkSettings.jsx b/frontend/src/components/NetworkSettings/NetworkSettings.jsx index 855a1be..860767d 100644 --- a/frontend/src/components/NetworkSettings/NetworkSettings.jsx +++ b/frontend/src/components/NetworkSettings/NetworkSettings.jsx @@ -120,7 +120,7 @@ function NetworkSettings({ network, setNetwork }) { />