security improvement (#190)

This commit is contained in:
prafull-opensignlabs
2023-11-16 11:02:38 +05:30
committed by GitHub
parent 0a36550907
commit dead3088d6
12 changed files with 177 additions and 69 deletions
+20 -2
View File
@@ -17,11 +17,11 @@ import S3Adapter from 'parse-server-s3-adapter';
import FSFilesAdapter from 'parse-server-fs-adapter';
import AWS from 'aws-sdk';
import { app as customRoute } from './cloud/customRoute/customApp.js';
import { createTransport } from 'nodemailer';
import { exec } from 'child_process';
const spacesEndpoint = new AWS.Endpoint(process.env.DO_ENDPOINT);
// console.log("configuration ", configuration);
if (process.env.USE_LOCAL !== 'TRUE') {
if (process.env.USE_LOCAL !== "TRUE") {
const s3Options = {
bucket: process.env.DO_SPACE, // globalConfig.S3FilesAdapter.bucket,
baseUrl: process.env.DO_BASEURL,
@@ -184,4 +184,22 @@ if (!process.env.TESTING) {
});
// This will enable the Live Query real-time server
await ParseServer.createLiveQueryServer(httpServer);
const migrate =
'APPLICATION_ID=legadranaxn SERVER_URL=http://localhost:8080/app MASTER_KEY=XnAwPDRQQyMr npx parse-dbtool migrate';
// `APPLICATION_ID=${process.env.APP_ID} SERVER_URL=${process.env.SERVER_URL} MASTER_KEY=${process.env.MASTER_KEY} npx parse-dbtool migrate`;
exec(migrate, (error, stdout, stderr) => {
if (error) {
console.error(`Error: ${error.message}`);
return;
}
if (stderr) {
console.error(`Error: ${stderr}`);
return;
}
console.log(`Command output: ${stdout}`);
});
}