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/
|
||||
# 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/
|
||||
$ git clone https://gitea.ndda.fr/apxtrib/apxtri.git
|
||||
$ yarn install
|
||||
@ -149,7 +149,7 @@ $ sudo snap refresh core
|
||||
$ sudo apt remove certbot
|
||||
$ sudo snap install --classic 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
|
||||
$ yarn restartapx # if IT IS NOT a first install
|
||||
# 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`));
|
||||
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();
|
||||
fs.ensureDirSync(`../tmp/tokens`);
|
||||
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) {
|
||||
// clean oldest
|
||||
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);
|
||||
});
|
||||
glob.sync(`../../../tmp/tokens/*.json`).forEach((f) => {
|
||||
glob.sync(`../../tmp/tokens/*.json`).forEach((f) => {
|
||||
const fsplit = f.split("_");
|
||||
const elapse = tsday - parseInt(fsplit[2]);
|
||||
//24h 86400000 milliseconde 15mn 900000
|
||||
@ -58,11 +58,11 @@ const isAuthenticated = async (req, res, next) => {
|
||||
}
|
||||
});
|
||||
//clean tmp
|
||||
glob.sync(`../../../tmp/*.txt`).forEach((f) => {
|
||||
glob.sync(`../../tmp/*.txt`).forEach((f) => {
|
||||
fs.remove(f);
|
||||
});
|
||||
fs.outputFile(
|
||||
`../../../tmp/tokens/menagedone${currentday}`,
|
||||
`../../tmp/tokens/menagedone${currentday}`,
|
||||
"done by middleware/isAUthenticated"
|
||||
);
|
||||
}
|
||||
@ -86,7 +86,7 @@ const isAuthenticated = async (req, res, next) => {
|
||||
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
|
||||
tmpfs += `_${req.session.header.xhash.substring(
|
||||
150,
|
||||
@ -97,7 +97,7 @@ const isAuthenticated = async (req, res, next) => {
|
||||
const sleep = (ms) => {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
};
|
||||
const failstamp = `../../../tmp/tokens/${alias}.json`;
|
||||
const failstamp = `../../tmp/tokens/${alias}.json`;
|
||||
if (action == "clean") {
|
||||
//to reinit bruteforce checker
|
||||
if (log) console.log(currentmod, "try to clean penalty file ", failstamp);
|
||||
|
@ -2,7 +2,7 @@
|
||||
"name": "apxtri",
|
||||
"version": "0.0.1",
|
||||
"logo": {
|
||||
"file": "../www/cdn/share/logo/logocarredark.png"
|
||||
"file": "../objects/wwws/cdn/share/logo/logocarredark.png"
|
||||
},
|
||||
"description": "apxtri Decentralized Autonomous Organization",
|
||||
"main": "apxtri.js",
|
||||
|
Loading…
x
Reference in New Issue
Block a user