From 5265d45da3d1a68b3d5a07c55b84f069de7c01a6 Mon Sep 17 00:00:00 2001 From: philc Date: Fri, 8 Nov 2024 11:29:47 +0100 Subject: [PATCH] setup and apxtri.js for setup --- apxtri/apxtri.js | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/apxtri/apxtri.js b/apxtri/apxtri.js index 6c5d111..86efc99 100755 --- a/apxtri/apxtri.js +++ b/apxtri/apxtri.js @@ -39,7 +39,7 @@ apxtri.main = async () => { .filter((f) => fs.lstatSync(f).isDirectory()) .forEach(async (t) => { const tribe = path.basename(t); - console.log(tribe); + //console.log(tribe); if (!tribesdns[tribe]) { await apxtri.setuptribe(tribe, conf); } @@ -223,7 +223,7 @@ apxtri.runexpress = async (tribesdns, conf) => { if (!doms.includes(dm)) doms.push(dm); //reindex database attention check dev-ants/.. a bug was fixed glob.sync(`../${t}/objects/*`).forEach((o) => { - console.log("reindex: ", o); + //console.log("reindex: ", o); Odmdb.runidx(o); }); }); @@ -324,21 +324,26 @@ apxtri.runexpress = async (tribesdns, conf) => { const ips = await apxtri.getip(); app.listen(conf.api.port, () => { let webaccess = `/api/ waits request on port:${conf.api.port} `; - let localhosts = "/etc/hosts for external machine\n" + let localnet = "/etc/hosts for your local network:\n" + let publicnet ="/etc/hosts for internet network:\n" conf.dns.forEach((u) => { - webaccess += `http://${u}/api/ `; - localhosts+= `${ips.WAN} ${u} \n`; + //webaccess += `http://${u}/api/ `; + Object.keys(ips).forEach(ik=>{ + if (ik=="WANIP"){ + publicnet+= `${ips.WANIP} ${u} \n`; + }else{ + localnet+= `${ips[ik]} ${u} \n` + } + }) }); - console.log(currentmod, webaccess); + console.log( + `\x1b[42m\x1b[37m${webaccess} \nOpen in your browser http(s):// ${conf.dns.join(" ")} to manage this apXtri town. \nCheck your network conf \n${localnet} ${publicnet}\nMore in README's project.\nTo get support ask \x1b[0m\x1b[32m in discord https://discord.gg/jF7cAkZn ` + ); + console.log( + "\x1b[42m\x1b[37m \n", + " Made with love for people's freedom, enjoy !!! ", + "\x1b[0m" + ); }); - const localhosts= - console.log( - `\x1b[42m\x1b[37mOpen in your browser http(s):// ${conf.dns.join(" ")} to manage this apXtri town. \nCheck that your local machine have in /etc/hosts \n${localhosts}\nCheck README's project to learn more.\nTo get support ask \x1b[0m\x1b[32m in discord https://discord.gg/jF7cAkZn ` - ); - console.log( - "\x1b[42m\x1b[37m \n", - " Made with love for people's freedom, enjoy !!! ", - "\x1b[0m" - ); }; apxtri.main();