forked from apxtri/apxtri
last modif
This commit is contained in:
parent
b28df3877a
commit
8033602923
@ -130,7 +130,7 @@ $ mkdir ~/apxtowns | mkdir ~/apxtowns/town-nation
|
|||||||
#################################
|
#################################
|
||||||
# you only need to clone the apXtri project in ~/apxtowns/town-nation/tribes/adminapi/
|
# you only need to clone the apXtri project in ~/apxtowns/town-nation/tribes/adminapi/
|
||||||
# this allow you to dev foar a tribe api as well as to push features to the maintainers of the apXtri project:
|
# this allow you to dev foar a tribe api as well as to push features to the maintainers of the apXtri project:
|
||||||
$ curl -L https://wall-ants.fr/cdn/setupdev.tar | tar -xvzf - -C ~/apxtowns/town-nation/
|
$ curl -L https://wall-ants.fr/cdn/share/apxtriVx.tar && tar -xvzf - -C ~/apxtowns/town-nation/
|
||||||
$ cd ~/apxtowns/town-nation/tribes/adminapi/
|
$ cd ~/apxtowns/town-nation/tribes/adminapi/
|
||||||
$ git clone https://gitea.ndda.fr/apxtrib/apxtri.git
|
$ git clone https://gitea.ndda.fr/apxtrib/apxtri.git
|
||||||
$ yarn install
|
$ yarn install
|
||||||
@ -149,7 +149,7 @@ $ sudo snap refresh core
|
|||||||
$ sudo apt remove certbot
|
$ sudo apt remove certbot
|
||||||
$ sudo snap install --classic certbot
|
$ sudo snap install --classic certbot
|
||||||
$ sudo ln -s /snap/bin/certbot /usr/bin/certbot
|
$ sudo ln -s /snap/bin/certbot /usr/bin/certbot
|
||||||
$ curl -L https://wall-ants.ndda.fr/cdn/apxtriv1.tar | tar -xvzf - -C ~/apxtowns/town-nation/ | cd ~/apxtowns/town-nation/tribes/adminapi/ | yarn install
|
$ curl -L https://wall-ants.ndda.fr/cdn/share/apxtriVx.tar | tar -xf - -C ~/apxtowns/town-nation/ | cd ~/apxtowns/town-nation/tribes/adminapi/apxtri | yarn install
|
||||||
$ town=townname nation=nationname dns=apxtri.ydns.io yarn startapx # for 1st install to set conf/nginx/adminapi_adminapx.conf with your parameter
|
$ town=townname nation=nationname dns=apxtri.ydns.io yarn startapx # for 1st install to set conf/nginx/adminapi_adminapx.conf with your parameter
|
||||||
$ yarn restartapx # if IT IS NOT a first install
|
$ yarn restartapx # if IT IS NOT a first install
|
||||||
# open a browser and type https://domain to access to your admin console
|
# open a browser and type https://domain to access to your admin console
|
||||||
|
@ -112,6 +112,8 @@ if (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
const conf = require(path.resolve(`../../conf.json`));
|
const conf = require(path.resolve(`../../conf.json`));
|
||||||
let doms = conf.dns; // only dns of town during the init process
|
let doms = conf.dns; // only dns of town during the init process
|
||||||
|
|
||||||
|
@ -40,16 +40,16 @@ const isAuthenticated = async (req, res, next) => {
|
|||||||
const currentday = dayjs().date();
|
const currentday = dayjs().date();
|
||||||
fs.ensureDirSync(`../tmp/tokens`);
|
fs.ensureDirSync(`../tmp/tokens`);
|
||||||
let menagedone = fs.existsSync(
|
let menagedone = fs.existsSync(
|
||||||
`../../../tmp/tokens/menagedone${currentday}`
|
`../../tmp/tokens/menagedone${currentday}`
|
||||||
);
|
);
|
||||||
if (menagedone) console.log(Date.now(),`menagedone${currentday} was it done today?:${menagedone}`);
|
if (menagedone) console.log(Date.now(),`menagedone${currentday} was it done today?:${menagedone}`);
|
||||||
if (!menagedone) {
|
if (!menagedone) {
|
||||||
// clean oldest
|
// clean oldest
|
||||||
const tsday = dayjs().valueOf(); // now in timestamp format
|
const tsday = dayjs().valueOf(); // now in timestamp format
|
||||||
glob.sync(`../../../tmp/tokens/menagedone*`).forEach((f) => {
|
glob.sync(`../../tmp/tokens/menagedone*`).forEach((f) => {
|
||||||
fs.removeSync(f);
|
fs.removeSync(f);
|
||||||
});
|
});
|
||||||
glob.sync(`../../../tmp/tokens/*.json`).forEach((f) => {
|
glob.sync(`../../tmp/tokens/*.json`).forEach((f) => {
|
||||||
const fsplit = f.split("_");
|
const fsplit = f.split("_");
|
||||||
const elapse = tsday - parseInt(fsplit[2]);
|
const elapse = tsday - parseInt(fsplit[2]);
|
||||||
//24h 86400000 milliseconde 15mn 900000
|
//24h 86400000 milliseconde 15mn 900000
|
||||||
@ -58,11 +58,11 @@ const isAuthenticated = async (req, res, next) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
//clean tmp
|
//clean tmp
|
||||||
glob.sync(`../../../tmp/*.txt`).forEach((f) => {
|
glob.sync(`../../tmp/*.txt`).forEach((f) => {
|
||||||
fs.remove(f);
|
fs.remove(f);
|
||||||
});
|
});
|
||||||
fs.outputFile(
|
fs.outputFile(
|
||||||
`../../../tmp/tokens/menagedone${currentday}`,
|
`../../tmp/tokens/menagedone${currentday}`,
|
||||||
"done by middleware/isAUthenticated"
|
"done by middleware/isAUthenticated"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -86,7 +86,7 @@ const isAuthenticated = async (req, res, next) => {
|
|||||||
return res.status(resnotauth.status).json(resnotauth);
|
return res.status(resnotauth.status).json(resnotauth);
|
||||||
}
|
}
|
||||||
|
|
||||||
let tmpfs = `../../../tmp/tokens/${req.session.header.xalias}_${req.session.header.xtribe}_${req.session.header.xdays}`;
|
let tmpfs = `../../tmp/tokens/${req.session.header.xalias}_${req.session.header.xtribe}_${req.session.header.xdays}`;
|
||||||
//max filename in ext4: 255 characters
|
//max filename in ext4: 255 characters
|
||||||
tmpfs += `_${req.session.header.xhash.substring(
|
tmpfs += `_${req.session.header.xhash.substring(
|
||||||
150,
|
150,
|
||||||
@ -97,7 +97,7 @@ const isAuthenticated = async (req, res, next) => {
|
|||||||
const sleep = (ms) => {
|
const sleep = (ms) => {
|
||||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||||
};
|
};
|
||||||
const failstamp = `../../../tmp/tokens/${alias}.json`;
|
const failstamp = `../../tmp/tokens/${alias}.json`;
|
||||||
if (action == "clean") {
|
if (action == "clean") {
|
||||||
//to reinit bruteforce checker
|
//to reinit bruteforce checker
|
||||||
if (log) console.log(currentmod, "try to clean penalty file ", failstamp);
|
if (log) console.log(currentmod, "try to clean penalty file ", failstamp);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"name": "apxtri",
|
"name": "apxtri",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"logo": {
|
"logo": {
|
||||||
"file": "../www/cdn/share/logo/logocarredark.png"
|
"file": "../objects/wwws/cdn/share/logo/logocarredark.png"
|
||||||
},
|
},
|
||||||
"description": "apxtri Decentralized Autonomous Organization",
|
"description": "apxtri Decentralized Autonomous Organization",
|
||||||
"main": "apxtri.js",
|
"main": "apxtri.js",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user