- Info sul Conto Collettivo
- HomePage
This commit is contained in:
@@ -135,6 +135,7 @@ const MyPageSchema = new Schema({
|
||||
|
||||
MyPageSchema.statics.getFieldsForSearch = function () {
|
||||
return [{ field: 'title', type: tools.FieldType.string },
|
||||
{ field: 'path', type: tools.FieldType.string },
|
||||
{ field: 'keywords', type: tools.FieldType.string },
|
||||
{ field: 'description', type: tools.FieldType.string },
|
||||
{ field: 'content', type: tools.FieldType.string }]
|
||||
|
||||
@@ -47,13 +47,6 @@ const newsletter = [
|
||||
listUniqueId: '',
|
||||
mailchimpApiKey: ''
|
||||
},
|
||||
{
|
||||
name: 'MandalaSolidale',
|
||||
mailchimpInstance: '',
|
||||
listUniqueId: '',
|
||||
mailchimpApiKey: ''
|
||||
}
|
||||
|
||||
];
|
||||
|
||||
async function AddMailingList(locale, idapp, user, settomailchimp, sendnews) {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
require('./config/config');
|
||||
require('./config/config');
|
||||
|
||||
// console.log(" lodash");
|
||||
|
||||
console.log(process.versions);
|
||||
|
||||
const _ = require('lodash');
|
||||
// console.log(" cors");
|
||||
const cors = require('cors');
|
||||
@@ -9,7 +12,7 @@ const cors = require('cors');
|
||||
// console.log(" 2) fs");
|
||||
const fs = require('fs');
|
||||
|
||||
const NUOVO_METODO_TEST = false;
|
||||
const NUOVO_METODO_TEST = true;
|
||||
|
||||
const server_constants = require('./tools/server_constants');
|
||||
|
||||
@@ -39,55 +42,19 @@ const { Settings } = require('./models/settings');
|
||||
|
||||
const i18n = require('i18n');
|
||||
|
||||
let credentials = null;
|
||||
|
||||
// OBTAIN
|
||||
// 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) {
|
||||
|
||||
} else {
|
||||
|
||||
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');
|
||||
}
|
||||
if ((process.env.NODE_ENV === 'production')) {
|
||||
console.log('*** AMBIENTE DI PRODUZIONE !!!!')
|
||||
} else if (process.env.NODE_ENV === 'test') {
|
||||
console.log('*** ### AMBIENTE DI TEST ')
|
||||
}
|
||||
|
||||
|
||||
console.log('DB: ' + process.env.DATABASE);
|
||||
// console.log("PORT: " + port);
|
||||
// console.log("MONGODB_URI: " + process.env.MONGODB_URI);
|
||||
@@ -265,6 +232,51 @@ myLoad().then(ris => {
|
||||
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') ||
|
||||
(process.env.NODE_ENV === 'test') || process.env.HTTPS_LOCALHOST === "true") {
|
||||
|
||||
@@ -279,6 +291,7 @@ myLoad().then(ris => {
|
||||
}) */
|
||||
} else {
|
||||
const httpsServer = https.createServer(credentials, app);
|
||||
|
||||
console.log('httpsServer: port ', port);
|
||||
httpsServer.listen(port);
|
||||
}
|
||||
@@ -484,7 +497,7 @@ async function inizia() {
|
||||
|
||||
*/
|
||||
|
||||
console.log(process.versions);
|
||||
|
||||
|
||||
} catch (e) {
|
||||
|
||||
|
||||
@@ -894,7 +894,7 @@ const MyTelegramBot = {
|
||||
} else if (myfunc === shared_consts.CallFunz.RICHIESTA_CIRCUIT) {
|
||||
|
||||
if (groupname) {
|
||||
domanda = i18n.__({ phrase: 'CIRCUIT_ACCEPT_NEWENTRY_BYGROUP', locale: langdest }, groupname) + '<br>' + struserinfomsg;
|
||||
domanda = i18n.__({ phrase: 'CIRCUIT_ACCEPT_NEWENTRY_BYGROUP', locale: langdest }, groupname) + '<br>' + struserinfomsg;
|
||||
|
||||
keyb = cl.getInlineKeyboard(myuser.lang, [
|
||||
{
|
||||
@@ -909,7 +909,7 @@ const MyTelegramBot = {
|
||||
},
|
||||
]);
|
||||
} else {
|
||||
domanda = i18n.__({ phrase: 'CIRCUIT_ACCEPT_NEWENTRY', locale: langdest }, name) + '<br>' + struserinfomsg;
|
||||
domanda = i18n.__({ phrase: 'CIRCUIT_ACCEPT_NEWENTRY', locale: langdest }, name) + '<br>' + struserinfomsg;
|
||||
|
||||
keyb = cl.getInlineKeyboard(myuser.lang, [
|
||||
{
|
||||
@@ -2179,7 +2179,7 @@ class Telegram {
|
||||
if (rec.user) {
|
||||
mystr += printf(
|
||||
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 +
|
||||
printf(tools.get__('INFO_LINK_ZOOM', this.getlang(msg)),
|
||||
tools.getlinkzoom(null));
|
||||
@@ -2338,8 +2338,13 @@ class Telegram {
|
||||
async menuRestartSrv(rec, msg, cmd2) {
|
||||
if (cmd2 === '6711') {
|
||||
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',
|
||||
this.chisono(rec) + ' Restart il Server (Node.Js)');
|
||||
let file = '~/batch/production_restart_server.sh';
|
||||
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 {
|
||||
this.nonAbilitato(msg);
|
||||
}
|
||||
@@ -4064,9 +4069,9 @@ if (true) {
|
||||
}
|
||||
if (!foundIfAlreadyCircuit) {
|
||||
// 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) {
|
||||
|
||||
if (circuit) {
|
||||
@@ -4080,7 +4085,7 @@ if (true) {
|
||||
|
||||
if (foundIfAlreadyCircuit) {
|
||||
// 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);
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user