- sendcoins

- font
- catalogo
This commit is contained in:
Surya Paolo
2025-03-26 23:23:48 +01:00
parent 76bacf3f5a
commit 789dc1dcae
14 changed files with 118 additions and 27 deletions

View File

@@ -1,12 +1,12 @@
DATABASE=test_FreePlanet DATABASE=test_PiuCheBuono
UDB=paofreeplanet UDB=paofreeplanet
PDB=mypassword@1A PDB=mypassword@1A
SEND_EMAIL=0 SEND_EMAIL=0
SEND_EMAIL_ORDERS=1 SEND_EMAIL_ORDERS=1
PORT=3000 PORT=3000
appTelegram_TEST=["1","13"] appTelegram_TEST=["1","17"]
appTelegram=["1","13"] appTelegram=["1","17"]
appTelegram_DEVELOP=["13"] appTelegram_DEVELOP=["17"]
DOMAIN=mongodb://localhost:27017/ DOMAIN=mongodb://localhost:27017/
AUTH_MONGODB=0 AUTH_MONGODB=0
ENABLE_PUSHNOTIFICATION=1 ENABLE_PUSHNOTIFICATION=1
@@ -29,7 +29,7 @@ GCM_API_KEY=""
PROD=0 PROD=0
PROJECT_DESCR_MAIN='__PROJECTS' PROJECT_DESCR_MAIN='__PROJECTS'
SECRK=Askb38v23jjDFaoskBOWj92axXCQ SECRK=Askb38v23jjDFaoskBOWj92axXCQ
TOKEN_LIFE=1m TOKEN_LIFE=2h
REFRESH_TOKEN_LIFE=14d REFRESH_TOKEN_LIFE=14d
FTPSERVER_HOST=139.162.166.31 FTPSERVER_HOST=139.162.166.31
FTPSERVER_PORT=21 FTPSERVER_PORT=21
@@ -38,4 +38,9 @@ FTPSERVER_PWD=ftpmypwd@1A_
AUTH_NEW_SITES=123123123 AUTH_NEW_SITES=123123123
SCRIPTS_DIR=admin_scripts SCRIPTS_DIR=admin_scripts
CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}] CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}]
MIAB_HOST=box.lamiaposta.org
MIAB_ADMIN_EMAIL=admin@lamiaposta.org
MIAB_ADMIN_PASSWORD=passpao1pabox@1A
DS_API_KEY="sk-222e3addb3d8455d8b0516d93906eec7" DS_API_KEY="sk-222e3addb3d8455d8b0516d93906eec7"
API_KEY_MSSQL="m68yADSr123MIVIDA@154$DSAGVOK"
SERVER_A_URL="http://51.77.156.69:3000"

View File

@@ -34,12 +34,12 @@ TOKEN_LIFE=2h
REFRESH_TOKEN_LIFE=14d REFRESH_TOKEN_LIFE=14d
AUTH_NEW_SITES=B234HDSAOJ734ndcsdKWNVZZ AUTH_NEW_SITES=B234HDSAOJ734ndcsdKWNVZZ
DOMAINS=[{"hostname":"piuchebuono.app","port":"3030"},{"hostname":"gruppomacro.app","port":"3010"}] DOMAINS=[{"hostname":"piuchebuono.app","port":"3030"},{"hostname":"gruppomacro.app","port":"3010"}]
DOMAINS_ALLOWED=[]
SCRIPTS_DIR=admin_scripts SCRIPTS_DIR=admin_scripts
CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}] CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}]
MIAB_HOST=box.lamiaposta.org MIAB_HOST=box.lamiaposta.org
MIAB_ADMIN_EMAIL=admin@lamiaposta.org MIAB_ADMIN_EMAIL=admin@lamiaposta.org
MIAB_ADMIN_PASSWORD=passpao1pabox@1A MIAB_ADMIN_PASSWORD=passpao1pabox@1A
#DB_CONNECTION=sqlsrv #DB_CONNECTION=sqlsrv
DB_HOST_SQLSRVTEST=31.3.180.50 DB_HOST_SQLSRVTEST=31.3.180.50
DB_PORT_SQLSRVTEST=14338 DB_PORT_SQLSRVTEST=14338

View File

@@ -31,6 +31,7 @@ TOKEN_LIFE=2h
REFRESH_TOKEN_LIFE=14d REFRESH_TOKEN_LIFE=14d
AUTH_NEW_SITES=B234HDSAOJ734ndcsdKWNV AUTH_NEW_SITES=B234HDSAOJ734ndcsdKWNV
DOMAINS=[{"hostname":"riso.app","port":"3006"},{"hostname":"freeplanet.app","port":"3000"}] DOMAINS=[{"hostname":"riso.app","port":"3006"},{"hostname":"freeplanet.app","port":"3000"}]
DOMAINS_ALLOWED=["comunitanuovomondo.app","kolibrilab.it","artenergetica.org","freeplanet.app","www.freeplanet.app","freeplanet.app:3000","freeplanet.app:3001","www.freeplanet.app:3000","www.freeplanet.app:3001"]
#DOMAINS=[{"hostname":"abitaregliiblei.it","port":"3021"},{"hostname":"riso.app","port":"3005"}] #DOMAINS=[{"hostname":"abitaregliiblei.it","port":"3021"},{"hostname":"riso.app","port":"3005"}]
SCRIPTS_DIR=admin_scripts SCRIPTS_DIR=admin_scripts
CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}] CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}]

View File

@@ -35,6 +35,7 @@ TOKEN_LIFE=2h
REFRESH_TOKEN_LIFE=14d REFRESH_TOKEN_LIFE=14d
AUTH_NEW_SITES=B234HDSAOJ734ndcsdKWNV AUTH_NEW_SITES=B234HDSAOJ734ndcsdKWNV
DOMAINS=[{"hostname":"piuchebuono.app","port":"3031"},{"hostname":"gruppomacro.app","port":"3011"}] DOMAINS=[{"hostname":"piuchebuono.app","port":"3031"},{"hostname":"gruppomacro.app","port":"3011"}]
DOMAINS_ALLOWED=[]
SCRIPTS_DIR=admin_scripts SCRIPTS_DIR=admin_scripts
CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}] CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}]
MIAB_HOST=box.lamiaposta.org MIAB_HOST=box.lamiaposta.org

View File

@@ -32,6 +32,7 @@ TOKEN_LIFE=2h
REFRESH_TOKEN_LIFE=14d REFRESH_TOKEN_LIFE=14d
AUTH_NEW_SITES=B234HDSAOJ734ndcsdKWNV AUTH_NEW_SITES=B234HDSAOJ734ndcsdKWNV
DOMAINS=[{"hostname":"riso.app","port":"3005"}] DOMAINS=[{"hostname":"riso.app","port":"3005"}]
DOMAINS_ALLOWED=["comunitanuovomondo.app","kolibrilab.it","artenergetica.org","freeplanet.app","www.freeplanet.app","freeplanet.app:3000","freeplanet.app:3001","www.freeplanet.app:3000","www.freeplanet.app:3001"]
SCRIPTS_DIR=admin_scripts SCRIPTS_DIR=admin_scripts
CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}] CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}]
MIAB_HOST=box.lamiaposta.org MIAB_HOST=box.lamiaposta.org

38
docs/aaa.json Normal file
View File

@@ -0,0 +1,38 @@
{
"id": "70606",
"title": "Grande Libro dell'Autosufficienza - 50 anni - Nuovo",
"description": "<em><strong>\"Il Grande Libro dell\u2019Autosufficienza\"<\/strong><\/em> di John Seymour \u00e8 un manuale completo che celebra 50 anni di pratiche di <strong>autosufficienza<\/strong> e <strong>sostenibilit\u00e0<\/strong>. Il libro offre insegnamenti pratici su come creare e gestire un <strong>orto biologico<\/strong>, raccogliere e conservare i raccolti, produrre <strong>energia rinnovabile<\/strong>, allevare animali e ridurre i rifiuti. Seymour ci guida passo passo in un viaggio verso una vita in armonia con la natura, promuovendo l\u2019indipendenza e la sostenibilit\u00e0. Un testo imprescindibile per chi desidera riscoprire le tradizioni agricole e applicarle per vivere in modo pi\u00f9 <strong>sostenibile<\/strong> e <strong>autonomo<\/strong>.\r\n<h2><strong>Con questo libro scoprirai<\/strong>:<\/h2>\r\n<ul>\r\n \t<li>Come <strong>coltivare un orto biologico<\/strong> e ottenere cibo sano.<\/li>\r\n \t<li>Le tecniche per <strong>conservare il raccolto<\/strong> e ottimizzare le risorse naturali.<\/li>\r\n \t<li>Come allevare animali per ottenere cibo e altri prodotti.<\/li>\r\n \t<li>Come produrre <strong>energia rinnovabile<\/strong> e ridurre l\u2019impatto ambientale.<\/li>\r\n \t<li>L\u2019arte di <strong>ridurre e riciclare<\/strong> rifiuti, promuovendo uno stile di vita pi\u00f9 sostenibile.<\/li>\r\n<\/ul>\r\n<h2><strong>Domande cruciali a cui <em>\"Il Grande Libro dell\u2019Autosufficienza\"<\/em> risponde<\/strong>:<\/h2>\r\n<ul>\r\n \t<li>Come posso vivere in modo <strong>autosufficiente<\/strong> e ridurre la mia dipendenza dalle risorse esterne?<\/li>\r\n \t<li>Quali sono le migliori tecniche per <strong>coltivare un orto biologico<\/strong> e garantire un raccolto abbondante?<\/li>\r\n \t<li>Come posso <strong>conservare il raccolto<\/strong> in modo naturale e duraturo?<\/li>\r\n \t<li>In che modo posso <strong>produrre energia rinnovabile<\/strong> a casa mia?<\/li>\r\n \t<li>Come posso vivere in <strong>armonia con la natura<\/strong> e promuovere la <strong>sostenibilit\u00e0<\/strong>?<\/li>\r\n<\/ul>\r\n<h2><strong>Questo libro \u00e8 dedicato a<\/strong>:<\/h2>\r\n<ul>\r\n \t<li>Lettori appassionati di <strong>giardinaggio<\/strong>, <strong>agricoltura biologica<\/strong> e vita rurale.<\/li>\r\n \t<li>Chiunque desideri adottare uno <strong>stile di vita sostenibile<\/strong> e autosufficiente.<\/li>\r\n \t<li><strong>Famiglie eco-consapevoli<\/strong> che vogliono ridurre il proprio impatto ambientale.<\/li>\r\n \t<li><strong>Amanti della natura<\/strong> e sostenitori delle <strong>energie rinnovabili<\/strong>.<\/li>\r\n<\/ul>\r\n<h2><strong>Contenuti chiave <em>\"Il Grande Libro dell\u2019Autosufficienza\"<\/em><\/strong>:<\/h2>\r\n<em>Il Grande Libro dell\u2019Autosufficienza<\/em> offre una panoramica completa di tutte le tecniche per vivere in modo <strong>autonomo<\/strong> e <strong>sostenibile<\/strong>. Attraverso 10 capitoli, il libro esplora vari aspetti dell\u2019autosufficienza, dalla coltivazione di ortaggi e frutti alla produzione di cibo dagli animali, fino alla gestione dell'energia e dei rifiuti. La guida si focalizza sul valore delle <strong>tradizioni agricole<\/strong>, sulla cura dell\u2019ambiente e sul benessere che deriva dal vivere in sintonia con la natura.\r\n\r\n&nbsp;",
"link": "https:\/\/www.fioredellavita.it\/grande-libro-dellautosufficienza-50-anni\/?attribute_pa_versione=nuovo",
"image_link": "https:\/\/www.fioredellavita.it\/wp-content\/uploads\/2024\/09\/il-grande-libro-dell-autosufficienza-speciale-50-anni-copertina-web.jpg",
"price": "39,00",
"sale_price": "37,05",
"categories": "Informazione Libera",
"isbn": "",
"Autore": "John,Seymour",
"Editore": "Macro Edizioni",
"Tipologia": "Libri",
"Collezione": "Libri Informazione Libera,Informazione Libera",
"Quantita": "1821",
"Lunghezza": "",
"Stato": "publish",
"Pagine": "",
"Edizione": "",
"Traduzione": "",
"Versione": "Nuovo",
"StockStatus": "instock",
"downloadable": "no",
"img1": "https:\/\/www.fioredellavita.it\/wp-content\/uploads\/2024\/09\/quarta_nuovo_grande_libro_dell_autosufficienza_2024_17038.jpg",
"img2": "",
"img3": "",
"formato": "Cartonato",
"preOrderDate": "2025-02-25",
"short_descr": null,
"availability": "in stock",
"checkout_link": "https:\/\/www.fioredellavita.it\/carrello\/?productId=70606",
"seo_descr": "Versione: Nuovo",
"preord": "no",
"addtocart_link": "https:\/\/www.fioredellavita.it\/grande-libro-dellautosufficienza-50-anni\/?attribute_pa_versione=nuovo&variation_id=70606&add-to-cart=70606",
"eta": "",
"misure": "cm 22x28",
"sku": "22464"
},

View File

@@ -295,7 +295,7 @@ const getTableContent = async (options) => {
// Se c'è un solo record, visualizza una lista di chiavi e valori // Se c'è un solo record, visualizza una lista di chiavi e valori
const record = records[0]; const record = records[0];
output += ` output += `
<table border='1' style="border-collapse: collapse; width: 50%;" > <table border='1' style="border-collapse: collapse;" >
<thead> <thead>
<tr> <tr>
<th style="padding: 8px; background-color: #f2f2f2;">Campo</th> <th style="padding: 8px; background-color: #f2f2f2;">Campo</th>
@@ -419,8 +419,11 @@ exports.viewTable = async (req, res) => {
if (options.outhtml) { if (options.outhtml) {
out = ` out = `
<h2>Tabella: ${options.nameTable}</h2> <h2 class="text-center">Tabella: ${options.nameTable}</h2>
<div class="text-h7 row justify-center text-blue">Query: ${options.where}<br></div>
<div class="row justify-center">
${tableContent} ${tableContent}
</div>
` `
} else { } else {
out = tableContent; out = tableContent;
@@ -445,6 +448,7 @@ exports.queryTable = async (req, res) => {
if (options.outhtml) { if (options.outhtml) {
out = ` out = `
<h2>Tabella: ${options.nameTable}</h2> <h2>Tabella: ${options.nameTable}</h2>
<div class="text-h7 row justify-center text-blue">Query: ${options.where}<br></div>
${tableContent} ${tableContent}
` `
} else { } else {

View File

@@ -764,6 +764,10 @@ router.post('/import', authenticate, async (req, res) => {
} }
} }
if (!myarr && ripopola) {
return res.status(400).send(data.arrdata);
}
// Rileggi tutti i record di ImportaDescr // Rileggi tutti i record di ImportaDescr
dataObjects = await ImportaDescr.find({ idapp }).lean(); dataObjects = await ImportaDescr.find({ idapp }).lean();
@@ -819,6 +823,11 @@ router.post('/import', authenticate, async (req, res) => {
let recisbn = {}; let recisbn = {};
const trovato = await ImportaIsbn.findOne({ isbn: product.code }).lean();
if (trovato) {
recisbn = trovato;
}
if (pagine && pagine !== '0') { if (pagine && pagine !== '0') {
recisbn.Pagine = pagine; recisbn.Pagine = pagine;
} }
@@ -827,6 +836,7 @@ router.post('/import', authenticate, async (req, res) => {
recisbn.descrizione_breve_macro = productInfo.descrizione_breve_macro; recisbn.descrizione_breve_macro = productInfo.descrizione_breve_macro;
recisbn.descrizione_completa_macro = productInfo.descrizione_completa_macro; recisbn.descrizione_completa_macro = productInfo.descrizione_completa_macro;
recisbn.sottotitolo = productInfo.sottotitolo; recisbn.sottotitolo = productInfo.sottotitolo;
// recisbn.idapp = idapp;
let risisbn = await ImportaIsbn.findOneAndUpdate({ isbn: product.code }, { $set: recisbn }, { new: true, upsert: true, strict: false }); let risisbn = await ImportaIsbn.findOneAndUpdate({ isbn: product.code }, { $set: recisbn }, { new: true, upsert: true, strict: false });
@@ -859,7 +869,6 @@ router.post('/import', authenticate, async (req, res) => {
dataObjects = null; dataObjects = null;
} }
if (dataObjects && dataObjects[0]) { if (dataObjects && dataObjects[0]) {
// Cancella la collection ImportaIsbn // Cancella la collection ImportaIsbn
await ImportaIsbn.deleteMany({ idapp }); await ImportaIsbn.deleteMany({ idapp });
@@ -883,6 +892,8 @@ router.post('/import', authenticate, async (req, res) => {
let queryprod = { idapp, sku: recmacro.sku }; let queryprod = { idapp, sku: recmacro.sku };
// 13872
try { try {
let risrec = await ImportaIsbn.findOneAndUpdate(queryprod, { $set: recmacro }, { new: true, upsert: true, strict: false }); let risrec = await ImportaIsbn.findOneAndUpdate(queryprod, { $set: recmacro }, { new: true, upsert: true, strict: false });
if (risrec) { if (risrec) {
@@ -1112,6 +1123,8 @@ router.post('/import', authenticate, async (req, res) => {
let numprod = dataObjects.length; let numprod = dataObjects.length;
let nontrovati = 0;
for (const product of dataObjects) { for (const product of dataObjects) {
let isnuovo = false let isnuovo = false
let setta = false let setta = false
@@ -1127,6 +1140,19 @@ router.post('/import', authenticate, async (req, res) => {
// split versioneGM in array with separated "," // split versioneGM in array with separated ","
let arrversGM = versGM.split(",").map(x => x.trim()); let arrversGM = versGM.split(",").map(x => x.trim());
// se non esiste l'ISBN, allora me lo cerco in base a sku !
if (!product.isbn) {
const rectrovare = await ImportaIsbn.findOne({ sku: product.sku }).lean();
if (rectrovare) {
product.isbn = rectrovare.isbn;
} else {
nontrovati++;
console.log(`${nontrovati} - ISBN non trovato [sku=${product.sku} title=${product.title}]`)
}
}
let productInfo = { let productInfo = {
idapp: product.idapp, idapp: product.idapp,
code: product.isbn, code: product.isbn,

View File

@@ -2031,8 +2031,8 @@ async function load(req, res, version = '0') {
const { data, totalTime, slowCalls } = await measurePromises(promises); const { data, totalTime, slowCalls } = await measurePromises(promises);
// console.log('Risultati delle promise:', data); // console.log('Risultati delle promise:', data);
console.log('Tempo totale di esecuzione:', totalTime, 'secondi'); // console.log('Tempo totale di esecuzione:', totalTime, 'secondi');
console.log('Le 5 chiamate più lente:', slowCalls); // console.log('Le 5 chiamate più lente:', slowCalls);
// Aggiornamento delle informazioni dell'utente, se presente // Aggiornamento delle informazioni dell'utente, se presente
let myuser = req.user; let myuser = req.user;

View File

@@ -682,6 +682,8 @@ router.post('/newtok', async (req, res) => {
try { try {
const refreshToken = req.body.refreshToken; const refreshToken = req.body.refreshToken;
// return res.status(403).send({ error: 'Refresh token non valido' });
if (!refreshToken) { if (!refreshToken) {
return res.status(400).send({ error: 'Refresh token mancante' }); return res.status(400).send({ error: 'Refresh token mancante' });
} }
@@ -689,7 +691,7 @@ router.post('/newtok', async (req, res) => {
const recFound = await User.findOne({ 'tokens.refreshToken': refreshToken }); const recFound = await User.findOne({ 'tokens.refreshToken': refreshToken });
if (!recFound) { if (!recFound) {
return res.status(404).send({ error: 'Refresh token non valido' }); return res.status(403).send({ error: 'Refresh token non valido' });
} }
const { token, refreshToken: newRefreshToken } = await recFound.generateAuthToken(req); const { token, refreshToken: newRefreshToken } = await recFound.generateAuthToken(req);

View File

@@ -763,10 +763,13 @@ connectToDatabase(connectionUrl, options)
const isProduction = ['production', 'test'].includes(process.env.NODE_ENV); const isProduction = ['production', 'test'].includes(process.env.NODE_ENV);
let domains = []; let domains = [];
let domains_allowed = [];
try { try {
if (process.env.DOMAINS) if (process.env.DOMAINS)
domains = JSON.parse(process.env.DOMAINS); domains = JSON.parse(process.env.DOMAINS);
if (process.env.DOMAINS_ALLOWED)
domains_allowed = JSON.parse(process.env.DOMAINS_ALLOWED);
} catch (error) { } catch (error) {
console.error("Errore durante la conversione della stringa DOMAINS:", error); console.error("Errore durante la conversione della stringa DOMAINS:", error);
} }
@@ -805,17 +808,23 @@ connectToDatabase(connectionUrl, options)
`https://api.${domain.hostname}`, `https://api.${domain.hostname}`,
`https://test.${domain.hostname}`, `https://test.${domain.hostname}`,
`https://testapi.${domain.hostname}`, `https://testapi.${domain.hostname}`,
`https://comunitanuovomondo.app`,
`https://kolibrilab.it`,
`https://artenergetica.org`,
`https://freeplanet.app:3001`,
`http://${domain.hostname}`, `http://${domain.hostname}`,
`http://api.${domain.hostname}`, `http://api.${domain.hostname}`,
`http://test.${domain.hostname}`, `http://test.${domain.hostname}`,
`http://testapi.${domain.hostname}` `http://testapi.${domain.hostname}`
]); ]);
// Aggiungi i domini da DOMAINS_ALLOWED
allowedOrigins = allowedOrigins.concat(
domains_allowed.map(domain => [
`https://${domain}`,
`http://${domain}`
]).flat()
);
} }
console.log('allowedOrigins', allowedOrigins)
let myorigin = '*'; let myorigin = '*';
@@ -823,6 +832,10 @@ connectToDatabase(connectionUrl, options)
myorigin = (origin, callback) => { myorigin = (origin, callback) => {
try { try {
// Validazione dell'input // Validazione dell'input
if (origin === undefined) {
console.log('✅ Origin UNDEFINED... vado avanti lo stesso !');
return callback(null, true);
}
if (!origin || typeof origin !== 'string' || !/^https?:\/\/[^\s/$.?#].[^\s]*$/.test(origin)) { if (!origin || typeof origin !== 'string' || !/^https?:\/\/[^\s/$.?#].[^\s]*$/.test(origin)) {
console.error('❌ Origine non valida:', origin); console.error('❌ Origine non valida:', origin);
return callback(new Error('Origine non valida'), false); return callback(new Error('Origine non valida'), false);
@@ -830,7 +843,7 @@ connectToDatabase(connectionUrl, options)
// Controllo delle origini consentite // Controllo delle origini consentite
if (allowedOrigins.includes(origin)) { if (allowedOrigins.includes(origin)) {
console.log('✅ Origine consentita:', origin); // console.log('✅ Origine consentita:', origin);
return callback(null, true); return callback(null, true);
} }

View File

@@ -5831,7 +5831,7 @@ module.exports = {
} }
if (mov.groupfrom) { if (mov.groupfrom) {
userfrom += mov.groupfrom.groupname userfrom += mov.groupfrom.groupname
tipocontofrom = shared_consts.AccountType.COLLECTIVE_ACCOUNT tipocontofrom = shared_consts.AccountType.CONTO_DI_GRUPPO
} }
if (mov.userfrom) { if (mov.userfrom) {
userfrom += mov.userfrom.username userfrom += mov.userfrom.username
@@ -5844,7 +5844,7 @@ module.exports = {
} }
if (mov.groupto) { if (mov.groupto) {
userto += mov.groupto.groupname userto += mov.groupto.groupname
tipocontoto = shared_consts.AccountType.COLLECTIVE_ACCOUNT tipocontoto = shared_consts.AccountType.CONTO_DI_GRUPPO
} }
if (mov.userto) { if (mov.userto) {
userto += mov.userto.username userto += mov.userto.username

View File

@@ -1180,7 +1180,7 @@ module.exports = {
AccountType: { AccountType: {
USER: 0, USER: 0,
COLLECTIVE_ACCOUNT: 1, CONTO_DI_GRUPPO: 1,
COMMUNITY_ACCOUNT: 2, COMMUNITY_ACCOUNT: 2,
}, },

View File

@@ -1 +1 @@
1.2.29 1.2.32