- Info sul Conto Collettivo
- HomePage
This commit is contained in:
@@ -135,6 +135,7 @@ const MyPageSchema = new Schema({
|
|||||||
|
|
||||||
MyPageSchema.statics.getFieldsForSearch = function () {
|
MyPageSchema.statics.getFieldsForSearch = function () {
|
||||||
return [{ field: 'title', type: tools.FieldType.string },
|
return [{ field: 'title', type: tools.FieldType.string },
|
||||||
|
{ field: 'path', type: tools.FieldType.string },
|
||||||
{ field: 'keywords', type: tools.FieldType.string },
|
{ field: 'keywords', type: tools.FieldType.string },
|
||||||
{ field: 'description', type: tools.FieldType.string },
|
{ field: 'description', type: tools.FieldType.string },
|
||||||
{ field: 'content', type: tools.FieldType.string }]
|
{ field: 'content', type: tools.FieldType.string }]
|
||||||
|
|||||||
@@ -47,13 +47,6 @@ const newsletter = [
|
|||||||
listUniqueId: '',
|
listUniqueId: '',
|
||||||
mailchimpApiKey: ''
|
mailchimpApiKey: ''
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'MandalaSolidale',
|
|
||||||
mailchimpInstance: '',
|
|
||||||
listUniqueId: '',
|
|
||||||
mailchimpApiKey: ''
|
|
||||||
}
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
async function AddMailingList(locale, idapp, user, settomailchimp, sendnews) {
|
async function AddMailingList(locale, idapp, user, settomailchimp, sendnews) {
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
require('./config/config');
|
require('./config/config');
|
||||||
|
require('./config/config');
|
||||||
|
|
||||||
// console.log(" lodash");
|
// console.log(" lodash");
|
||||||
|
|
||||||
|
console.log(process.versions);
|
||||||
|
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
// console.log(" cors");
|
// console.log(" cors");
|
||||||
const cors = require('cors');
|
const cors = require('cors');
|
||||||
@@ -9,7 +12,7 @@ const cors = require('cors');
|
|||||||
// console.log(" 2) fs");
|
// console.log(" 2) fs");
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
const NUOVO_METODO_TEST = false;
|
const NUOVO_METODO_TEST = true;
|
||||||
|
|
||||||
const server_constants = require('./tools/server_constants');
|
const server_constants = require('./tools/server_constants');
|
||||||
|
|
||||||
@@ -39,55 +42,19 @@ const { Settings } = require('./models/settings');
|
|||||||
|
|
||||||
const i18n = require('i18n');
|
const i18n = require('i18n');
|
||||||
|
|
||||||
|
let credentials = null;
|
||||||
|
|
||||||
// OBTAIN
|
// OBTAIN
|
||||||
// https://www.psclistens.com/insight/blog/enabling-a-nodejs-ssl-webserver-using-let-s-encrypt-pem-certificates/
|
// https://www.psclistens.com/insight/blog/enabling-a-nodejs-ssl-webserver-using-let-s-encrypt-pem-certificates/
|
||||||
|
|
||||||
if ((process.env.NODE_ENV === 'production') ||
|
|
||||||
(process.env.NODE_ENV === 'test')) {
|
|
||||||
|
|
||||||
if (false) {
|
if ((process.env.NODE_ENV === 'production')) {
|
||||||
|
console.log('*** AMBIENTE DI PRODUZIONE !!!!')
|
||||||
} else {
|
} else if (process.env.NODE_ENV === 'test') {
|
||||||
|
console.log('*** ### AMBIENTE DI TEST ')
|
||||||
var privateKey = fs.readFileSync(process.env.PATH_CERT_KEY, 'utf8');
|
|
||||||
var certificate = fs.readFileSync(process.env.PATH_SERVER_CRT, 'utf8');
|
|
||||||
let credentials = {};
|
|
||||||
|
|
||||||
if (NUOVO_METODO_TEST) {
|
|
||||||
credentials = {
|
|
||||||
key: privateKey,
|
|
||||||
cert: certificate,
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
credentials = {
|
|
||||||
key: privateKey,
|
|
||||||
cert: certificate,
|
|
||||||
ca: [
|
|
||||||
fs.readFileSync(process.env.PATH_SSL_ROOT_PEM, 'utf8'),
|
|
||||||
fs.readFileSync(process.env.PATH_SSL_CHAIN_PEM, 'utf8'),
|
|
||||||
],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var https = require('https');
|
|
||||||
} else {
|
|
||||||
if (process.env.HTTPS_LOCALHOST === "true") {
|
|
||||||
var privateKey = fs.readFileSync(process.env.PATH_CERT_KEY, 'utf8');
|
|
||||||
var certificate = fs.readFileSync(process.env.PATH_SERVER_CRT, 'utf8');
|
|
||||||
var credentials = {
|
|
||||||
key: privateKey,
|
|
||||||
cert: certificate,
|
|
||||||
ciphers: 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES256-SHA384',
|
|
||||||
honorCipherOrder: true,
|
|
||||||
secureProtocol: 'TLSv1_2_method',
|
|
||||||
};
|
|
||||||
var https = require('https');
|
|
||||||
|
|
||||||
} else {
|
|
||||||
var http = require('http');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
console.log('DB: ' + process.env.DATABASE);
|
console.log('DB: ' + process.env.DATABASE);
|
||||||
// console.log("PORT: " + port);
|
// console.log("PORT: " + port);
|
||||||
// console.log("MONGODB_URI: " + process.env.MONGODB_URI);
|
// console.log("MONGODB_URI: " + process.env.MONGODB_URI);
|
||||||
@@ -265,6 +232,51 @@ myLoad().then(ris => {
|
|||||||
console.log('*** PRODUCTION! ');
|
console.log('*** PRODUCTION! ');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((process.env.NODE_ENV === 'production') ||
|
||||||
|
(process.env.NODE_ENV === 'test')) {
|
||||||
|
|
||||||
|
const keyStream = path.resolve(`./${process.env.PATH_CERT_KEY}`);
|
||||||
|
const certificateStream = path.resolve(`./${process.env.PATH_SERVER_CRT}`);
|
||||||
|
|
||||||
|
const privateKey = fs.readFileSync(keyStream, "utf8");
|
||||||
|
const certificate = fs.readFileSync(certificateStream, "utf8");
|
||||||
|
|
||||||
|
|
||||||
|
if (NUOVO_METODO_TEST) {
|
||||||
|
credentials = {
|
||||||
|
key: privateKey,
|
||||||
|
cert: certificate,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
credentials = {
|
||||||
|
key: privateKey,
|
||||||
|
cert: certificate,
|
||||||
|
ca: [
|
||||||
|
fs.readFileSync(process.env.PATH_SSL_ROOT_PEM, 'utf8'),
|
||||||
|
fs.readFileSync(process.env.PATH_SSL_CHAIN_PEM, 'utf8'),
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
var https = require('https');
|
||||||
|
} else {
|
||||||
|
if (process.env.HTTPS_LOCALHOST === "true") {
|
||||||
|
var privateKey = fs.readFileSync(process.env.PATH_CERT_KEY, 'utf8');
|
||||||
|
var certificate = fs.readFileSync(process.env.PATH_SERVER_CRT, 'utf8');
|
||||||
|
credentials = {
|
||||||
|
key: privateKey,
|
||||||
|
cert: certificate,
|
||||||
|
ciphers: 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES256-SHA384',
|
||||||
|
honorCipherOrder: true,
|
||||||
|
secureProtocol: 'TLSv1_2_method',
|
||||||
|
};
|
||||||
|
var https = require('https');
|
||||||
|
|
||||||
|
} else {
|
||||||
|
var http = require('http');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((process.env.NODE_ENV === 'production') ||
|
if ((process.env.NODE_ENV === 'production') ||
|
||||||
(process.env.NODE_ENV === 'test') || process.env.HTTPS_LOCALHOST === "true") {
|
(process.env.NODE_ENV === 'test') || process.env.HTTPS_LOCALHOST === "true") {
|
||||||
|
|
||||||
@@ -279,6 +291,7 @@ myLoad().then(ris => {
|
|||||||
}) */
|
}) */
|
||||||
} else {
|
} else {
|
||||||
const httpsServer = https.createServer(credentials, app);
|
const httpsServer = https.createServer(credentials, app);
|
||||||
|
|
||||||
console.log('httpsServer: port ', port);
|
console.log('httpsServer: port ', port);
|
||||||
httpsServer.listen(port);
|
httpsServer.listen(port);
|
||||||
}
|
}
|
||||||
@@ -484,7 +497,7 @@ async function inizia() {
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
console.log(process.versions);
|
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
||||||
|
|||||||
@@ -2179,7 +2179,7 @@ class Telegram {
|
|||||||
if (rec.user) {
|
if (rec.user) {
|
||||||
mystr += printf(
|
mystr += printf(
|
||||||
tools.get__('INFO_LINK_DA_CONDIVIDERE', this.getlang(msg)),
|
tools.get__('INFO_LINK_DA_CONDIVIDERE', this.getlang(msg)),
|
||||||
tools.getHostByIdApp(this.idapp) + '/signup/' + rec.user.username);
|
tools.getHostByIdApp(this.idapp) + '/registrati/' + rec.user.username);
|
||||||
mystr += tools.ACAPO + tools.ACAPO +
|
mystr += tools.ACAPO + tools.ACAPO +
|
||||||
printf(tools.get__('INFO_LINK_ZOOM', this.getlang(msg)),
|
printf(tools.get__('INFO_LINK_ZOOM', this.getlang(msg)),
|
||||||
tools.getlinkzoom(null));
|
tools.getlinkzoom(null));
|
||||||
@@ -2338,8 +2338,13 @@ class Telegram {
|
|||||||
async menuRestartSrv(rec, msg, cmd2) {
|
async menuRestartSrv(rec, msg, cmd2) {
|
||||||
if (cmd2 === '6711') {
|
if (cmd2 === '6711') {
|
||||||
await MyTelegramBot.sendMsgTelegramToTheAdminAllSites(this.chisono(rec) + ' ha rilanciato il Server NODE.JS...');
|
await MyTelegramBot.sendMsgTelegramToTheAdminAllSites(this.chisono(rec) + ' ha rilanciato il Server NODE.JS...');
|
||||||
const ris = await tools.execScript(this.idapp, msg, '~/batch/production_restart_server.sh',
|
let file = '~/batch/production_restart_server.sh';
|
||||||
this.chisono(rec) + ' Restart il Server (Node.Js)');
|
if (process.env.NODE_ENV === 'test') {
|
||||||
|
file = '~/batch/test_restart_server.sh';
|
||||||
|
}
|
||||||
|
|
||||||
|
const ris = await tools.execScript(this.idapp, msg, file,
|
||||||
|
this.chisono(rec) + ' Restart il Server (Node.Js) : ' + process.version);
|
||||||
} else {
|
} else {
|
||||||
this.nonAbilitato(msg);
|
this.nonAbilitato(msg);
|
||||||
}
|
}
|
||||||
@@ -4064,7 +4069,7 @@ if (true) {
|
|||||||
}
|
}
|
||||||
if (!foundIfAlreadyCircuit) {
|
if (!foundIfAlreadyCircuit) {
|
||||||
// Aggiungilo nel Circuito
|
// Aggiungilo nel Circuito
|
||||||
await User.setCircuitCmd(user.idapp, data.username, circuit.name, cmd, 0, username_action, {groupname: data.groupname});
|
await User.setCircuitCmd(user.idapp, data.username, circuit.name, cmd, 0, username_action, { groupname: data.groupname });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (data.action === InlineConferma.RISPOSTA_NO + shared_consts.CallFunz.RICHIESTA_CIRCUIT) {
|
} else if (data.action === InlineConferma.RISPOSTA_NO + shared_consts.CallFunz.RICHIESTA_CIRCUIT) {
|
||||||
@@ -4080,7 +4085,7 @@ if (true) {
|
|||||||
|
|
||||||
if (foundIfAlreadyCircuit) {
|
if (foundIfAlreadyCircuit) {
|
||||||
// Rimuovilo nel Circuito
|
// Rimuovilo nel Circuito
|
||||||
await User.setCircuitCmd(user.idapp, data.username, circuit.name, cmd, 0, username_action, {groupname: data.groupname});
|
await User.setCircuitCmd(user.idapp, data.username, circuit.name, cmd, 0, username_action, { groupname: data.groupname });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1534,7 +1534,7 @@ module.exports = {
|
|||||||
|
|
||||||
let myapp = this.getHostByIdApp(idapp);
|
let myapp = this.getHostByIdApp(idapp);
|
||||||
if (myapp) {
|
if (myapp) {
|
||||||
myapp += '/signup/' + rec.aportador_solidario + '/' + msg.from.username + '/' + msg.from.id + '/' + rec.regexpire;
|
myapp += '/registrati/' + rec.aportador_solidario + '/' + msg.from.username + '/' + msg.from.id + '/' + rec.regexpire;
|
||||||
}
|
}
|
||||||
|
|
||||||
return myapp;
|
return myapp;
|
||||||
|
|||||||
Reference in New Issue
Block a user