modif cors to allow mobile to access

This commit is contained in:
philc 2024-11-15 06:15:19 +01:00
parent 21effdf5be
commit ff74b2ff15
2 changed files with 8 additions and 2 deletions

View File

@ -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.

View File

@ -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(