modif notif
This commit is contained in:
@@ -14,7 +14,7 @@ SEE README.md to start
|
|||||||
const apxtri = {};
|
const apxtri = {};
|
||||||
|
|
||||||
apxtri.main = async () => {
|
apxtri.main = async () => {
|
||||||
if (!fs.existsSync("/etc/nginx/nginx.conf")) {
|
if (process.env.NODE_MODE !== 'dev' && !fs.existsSync("/etc/nginx/nginx.conf")) {
|
||||||
console.log(
|
console.log(
|
||||||
"\x1b[31m Check documentation, nginx have to be installed on this server first, no /etc/nginx/nginx.conf available, install then rerun yarn command."
|
"\x1b[31m Check documentation, nginx have to be installed on this server first, no /etc/nginx/nginx.conf available, install then rerun yarn command."
|
||||||
);
|
);
|
||||||
@@ -275,9 +275,7 @@ apxtri.runexpress = async (tribesdns, conf) => {
|
|||||||
app.disable("x-powered-by"); // for security
|
app.disable("x-powered-by"); // for security
|
||||||
app.locals.tribeids = tribeIds;
|
app.locals.tribeids = tribeIds;
|
||||||
const currentmod = "apxtri";
|
const currentmod = "apxtri";
|
||||||
const log = process.env.ACTIVELOG.split(',')
|
const log = process.env.ACTIVELOG ? process.env.ACTIVELOG.split(',').includes(currentmod) : false;
|
||||||
? process.env.ACTIVELOG.split(',').includes(currentmod)
|
|
||||||
: false;
|
|
||||||
console.log(
|
console.log(
|
||||||
currentmod,
|
currentmod,
|
||||||
" Allowed DOMs to access to this apxtri server:",
|
" Allowed DOMs to access to this apxtri server:",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
const path=require('path')
|
const path=require('path')
|
||||||
const conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
const conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
||||||
const currentmod='checkHeaders';
|
const currentmod='checkHeaders';
|
||||||
const log = process.env.ACTIVELOG.split(',').includes(currentmod)
|
const log = process.env.ACTIVELOG ? process.env.ACTIVELOG ? process.env.ACTIVELOG.split(',').includes(currentmod) : false : false
|
||||||
/**
|
/**
|
||||||
* @api {get} / - CheckHeaders
|
* @api {get} / - CheckHeaders
|
||||||
* @apiGroup Middlewares
|
* @apiGroup Middlewares
|
||||||
@@ -19,7 +19,7 @@ const log = process.env.ACTIVELOG.split(',').includes(currentmod)
|
|||||||
* @apiHeader {integer} xtrkversion a version number link to tracking system
|
* @apiHeader {integer} xtrkversion a version number link to tracking system
|
||||||
* @apiHeaderExample {json} Headeconst conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
* @apiHeaderExample {json} Headeconst conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
||||||
const currentmod='checkHeaders';
|
const currentmod='checkHeaders';
|
||||||
const log = process.env.ACTIVELOG.split(',').includes(currentmod)r-Example for anonymous:
|
const log = process.env.ACTIVELOG ? process.env.ACTIVELOG.split(',').includes(currentmod) : falser-Example for anonymous:
|
||||||
* {
|
* {
|
||||||
* "xtrkversion":1,
|
* "xtrkversion":1,
|
||||||
* "xtribe":"smatchit",
|
* "xtribe":"smatchit",
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const openpgp = require("openpgp");
|
|||||||
|
|
||||||
const conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
const conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
||||||
const currentmod='isAuthenticated';
|
const currentmod='isAuthenticated';
|
||||||
const log = process.env.ACTIVELOG.split(',').includes(currentmod)
|
const log = process.env.ACTIVELOG ? process.env.ACTIVELOG.split(',').includes(currentmod) : false
|
||||||
/**
|
/**
|
||||||
* @api {get} / - isAuthenticated
|
* @api {get} / - isAuthenticated
|
||||||
* @apiGroup Middlewares
|
* @apiGroup Middlewares
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const Odmdb = require(`./Odmdb.js`);
|
|||||||
const Checkjson = require(`./Checkjson`);
|
const Checkjson = require(`./Checkjson`);
|
||||||
const conf = require(`../../objects/tribes/itm/adminapi.json`);
|
const conf = require(`../../objects/tribes/itm/adminapi.json`);
|
||||||
const currentmod = "Articles";
|
const currentmod = "Articles";
|
||||||
const log = process.env.ACTIVELOG.split(',').includes(currentmod);
|
const log = process.env.ACTIVELOG ? process.env.ACTIVELOG.split(',').includes(currentmod) : false;
|
||||||
|
|
||||||
|
|
||||||
const Articles={}
|
const Articles={}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const Checkjson = require(`./Checkjson.js`);
|
|||||||
const nodemailer = require("nodemailer");
|
const nodemailer = require("nodemailer");
|
||||||
const conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
const conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
||||||
const currentmod = "Notifications";
|
const currentmod = "Notifications";
|
||||||
const log = process.env.ACTIVELOG.split(',').includes(currentmod);
|
const log = process.env.ACTIVELOG ? process.env.ACTIVELOG.split(',').includes(currentmod) : false;
|
||||||
/**
|
/**
|
||||||
* To manage any communication between Pagan
|
* To manage any communication between Pagan
|
||||||
* mayor druid emailing/sms/paper from tribe register smtp, simcard, mail api to Person(s) / Pagan(s)
|
* mayor druid emailing/sms/paper from tribe register smtp, simcard, mail api to Person(s) / Pagan(s)
|
||||||
@@ -440,21 +440,27 @@ Notifications.sendmail = async (data, tribe) => {
|
|||||||
//console.log(confsmtp);
|
//console.log(confsmtp);
|
||||||
const transporter = await nodemailer.createTransport(confsmtp);
|
const transporter = await nodemailer.createTransport(confsmtp);
|
||||||
if (data.filelist) {
|
if (data.filelist) {
|
||||||
data.attachments = [];
|
data.attachments = data.attachments || [];
|
||||||
let missingfile = [];
|
let missingfile = [];
|
||||||
data.filelist.forEach((fo) => {
|
data.filelist.forEach((fo) => {
|
||||||
if (fs.existsSync(fo.pathfile)) {
|
if (fs.existsSync(fo.pathfile)) {
|
||||||
|
data.attachments.push({
|
||||||
|
filename: fo.filename || path.basename(fo.pathfile),
|
||||||
|
path: fo.pathfile,
|
||||||
|
contentType: fo.contenttype || 'application/octet-stream'
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
missingfile.push(fo.pathfile);
|
missingfile.push(fo.pathfile);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (missingk.length > 0) {
|
if (missingfile.length > 0) {
|
||||||
return {
|
return {
|
||||||
status: 428,
|
status: 428,
|
||||||
ref: "Notifications",
|
ref: "Notifications",
|
||||||
msg: "missingdata",
|
msg: "missingfiles",
|
||||||
data: { missingk: missingk },
|
data: { missingfiles: missingfile },
|
||||||
};
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//console.log("data:", data);
|
//console.log("data:", data);
|
||||||
let res;
|
let res;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
|||||||
const Checkjson = require(`./Checkjson.js`);
|
const Checkjson = require(`./Checkjson.js`);
|
||||||
const { promiseHooks } = require("v8");
|
const { promiseHooks } = require("v8");
|
||||||
const currentmod = "Odmdb";
|
const currentmod = "Odmdb";
|
||||||
const log = process.env.ACTIVELOG.split(',').includes(currentmod);
|
const log = process.env.ACTIVELOG ? process.env.ACTIVELOG.split(',').includes(currentmod) : false;
|
||||||
/**
|
/**
|
||||||
* This manage Objects for indexing, searching, checking and act to CRUD
|
* This manage Objects for indexing, searching, checking and act to CRUD
|
||||||
* @objectPathName = objectpath/objectname
|
* @objectPathName = objectpath/objectname
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const Odmdb = require("./Odmdb.js");
|
|||||||
|
|
||||||
const conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
const conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
||||||
const currentmod = "Pagans";
|
const currentmod = "Pagans";
|
||||||
const log = process.env.ACTIVELOG.split(',').includes(currentmod);
|
const log = process.env.ACTIVELOG ? process.env.ACTIVELOG.split(',').includes(currentmod) : false;
|
||||||
/**
|
/**
|
||||||
* Pagan Management numeric Identity and Person (Person = Pagan Id + tribe)
|
* Pagan Management numeric Identity and Person (Person = Pagan Id + tribe)
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const Odmdb = require("./Odmdb.js");
|
|||||||
|
|
||||||
const conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
const conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
||||||
const currentmod = "Pagans";
|
const currentmod = "Pagans";
|
||||||
const log = process.env.ACTIVELOG.split(',').includes(currentmod);
|
const log = process.env.ACTIVELOG ? process.env.ACTIVELOG.split(',').includes(currentmod) : false;
|
||||||
/**
|
/**
|
||||||
* Pagan Management numeric Identity and Person (Person = Pagan Id + tribe)
|
* Pagan Management numeric Identity and Person (Person = Pagan Id + tribe)
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ const readlineSync = require("readline-sync");
|
|||||||
const Odmdb = require("./Odmdb.js");
|
const Odmdb = require("./Odmdb.js");
|
||||||
const conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
const conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
||||||
const currentmod = "Wwws";
|
const currentmod = "Wwws";
|
||||||
const log = process.env.ACTIVELOG.split(',').includes(currentmod);
|
const log = process.env.ACTIVELOG ? process.env.ACTIVELOG.split(',').includes(currentmod) : false;
|
||||||
const Wwws = {};
|
const Wwws = {};
|
||||||
|
|
||||||
Wwws.getwco = (wconame, ctx) => {
|
Wwws.getwco = (wconame, ctx) => {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const Articles = require(`../models/Articles`);
|
|||||||
|
|
||||||
const conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
const conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
||||||
const currentmod = "Articles";
|
const currentmod = "Articles";
|
||||||
const log = process.env.ACTIVELOG.split(',').includes(currentmod);
|
const log = process.env.ACTIVELOG ? process.env.ACTIVELOG.split(',').includes(currentmod) : false;
|
||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const isAuthenticated = require("../middlewares/isAuthenticated.js");
|
|||||||
|
|
||||||
const conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
const conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
||||||
const currentmod = "Pagans";
|
const currentmod = "Pagans";
|
||||||
const log = process.env.ACTIVELOG.split(',').includes(currentmod);
|
const log = process.env.ACTIVELOG ? process.env.ACTIVELOG.split(',').includes(currentmod) : false;
|
||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ const fs = require("fs-extra");
|
|||||||
const path = require("path");
|
const path = require("path");
|
||||||
const conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
const conf = require(`../../../adminapi/objects/tribes/itm/adminapi.json`);
|
||||||
const currentmod = "Trackings";
|
const currentmod = "Trackings";
|
||||||
const log = process.env.ACTIVELOG.split(',').includes(currentmod);
|
const log = process.env.ACTIVELOG ? process.env.ACTIVELOG.split(',').includes(currentmod) : false;
|
||||||
const Odmdb = require("../models/Odmdb.js");
|
const Odmdb = require("../models/Odmdb.js");
|
||||||
// Middlewares
|
// Middlewares
|
||||||
const checkHeaders = require("../middlewares/checkHeaders");
|
const checkHeaders = require("../middlewares/checkHeaders");
|
||||||
|
|||||||
Reference in New Issue
Block a user