- Le immagini uploadate non vengono visualizzate subito... cache... aggiungere la versione dell'immagine: vers_img

- Aggiunto il Server TESTRISO e TEST_PCB.
This commit is contained in:
Surya Paolo
2024-09-17 17:38:47 +02:00
parent dcc2a0ec08
commit 9985793fcc
39 changed files with 1259 additions and 162 deletions

View File

@@ -1229,7 +1229,7 @@ router.post('/cloudflare', authenticate, async (req, res) => {
} else if (cmd === "setCorrectIpsOnDNS") {
result = await cf.setCorrectIpsOnDNS(record);
} else if (cmd === "gettok") {
result = JSON.parse(process.env.CLOUDFLARE_TOKENS);
result = process.env.CLOUDFLARE_TOKENS ? JSON.parse(process.env.CLOUDFLARE_TOKENS) : '';
}
return res.send(result);

View File

@@ -1917,7 +1917,7 @@ function uploadFile(req, res, version) {
// allora mi conviene che lo faccio dopo, manualmente.
console.log('Dovresti copiare fromfile', fromfile, 'tofile', tofile);
'sudo cp -R ' + fromfile + ' ' + tofile
console.log('sudo cp -R ' + fromfile + ' ' + tofile);
// await tools.execScriptNoOutput('sudo cp -R ' + fromfile + ' ' + tofile)
res.end();
return;

View File

@@ -636,7 +636,7 @@ router.post('/newtok', async (req, res) => {
// Ottieni l'utente in base al refreshtoken
const recFound = await User.findOne({ 'tokens.refreshToken': refreshToken });
console.log('recFound', recFound ? recFound.name : 'NOTFOUND', 'Token=', refreshToken);
// console.log('recFound', recFound ? recFound.name : 'NOTFOUND', 'Token=', refreshToken);
if (recFound) {
return recFound.generateAuthToken(req)
@@ -1429,6 +1429,9 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
await Province.setCoordinatesOnDB();
} else if (mydata.dbop === 'insertGeojsonToMongoDB') {
await City.insertGeojsonToMongoDB('comuni_italia.geojson');
} else if (mydata.dbop === 'listCollectionsBySize') {
mystr = await tools.listCollectionsBySize();
ris = { mystr };
} else if (mydata.dbop === 'AbilitaNewsletterALL') {
await User.updateMany({
$or: [
@@ -1856,15 +1859,11 @@ router.post('/dbop', authenticate, async (req, res) => {
}
try {
let ris = await eseguiDbOp(idapp, mydata, locale, req, res);
let risOp = await eseguiDbOp(idapp, mydata, locale, req, res);
if (!ris) {
ris = {};
}
// ris = await User.updateMyData(ris, idapp, req.user.username);
ris = await User.updateMyData(ris, idapp, req.user.username);
res.send({ code: server_constants.RIS_CODE_OK, data: ris.data });
res.send({ code: server_constants.RIS_CODE_OK, data: risOp });
} catch (e) {
res.status(400).send({ code: server_constants.RIS_CODE_ERR, msg: e });