From ff74b2ff15daf3ebfd27be42d33806ca06216cd6 Mon Sep 17 00:00:00 2001 From: philc Date: Fri, 15 Nov 2024 06:15:19 +0100 Subject: [PATCH] modif cors to allow mobile to access --- README.md | 4 ++++ apxtri/apxtri.js | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4affa27..9ca108a 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,8 @@ Install an ubuntu desktop machine https://ubuntu.com/desktop ``` $ sudo apt update && sudo apt upgrade $ sudo apt install git vim libcap2-bin p7zip-full p7zip-rar curl gnupg nginx +$ sudo snap install --classic certbot +$ sudo ln -s /snap/bin/certbot /usr/bin/certbot $ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - $ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list $ sudo apt update && sudo apt install yarn @@ -97,6 +99,8 @@ Until the web interface allow it here are usefull process to: ``` cd .. && . setup.sh smatchit https://testwall-ants.ndda.fr https://gitea.ndda.fr/smatchit/smatchit ``` +Then conf website test domain and use sudo certbot --nginx -d domainename to get ssl + If you want to contribute fixing bug, add new features in adminapi please push in your branch and send an email to support@need-data.com. diff --git a/apxtri/apxtri.js b/apxtri/apxtri.js index c5de21b..a5fc237 100755 --- a/apxtri/apxtri.js +++ b/apxtri/apxtri.js @@ -283,11 +283,13 @@ apxtri.runexpress = async (tribesdns, conf) => { // let cor = false; const regorigin = new RegExp(regtxt); app.use((req, res, next) => { - /*if (req.headers.origin == undefined) { + let cor=false + if (req.headers.origin == undefined) { + //used for mobile access cor = true; } else { cor = regorigin.test(req.headers.origin); - }*/ + } const cor=regorigin.test(req.headers.origin); if (!cor) console.log(