Added config security check.
This commit is contained in:
parent
3de4bff68d
commit
5a262725c7
3 changed files with 68 additions and 4 deletions
|
|
@ -30,6 +30,7 @@ globalThis.crypto = require('node:crypto').webcrypto;
|
|||
//Application
|
||||
const channelManager = require('./app/channel/channelManager');
|
||||
//Util
|
||||
const configCheck = require('./utils/configCheck');
|
||||
const scheduler = require('./utils/scheduler');
|
||||
//DB Model
|
||||
const statModel = require('./schemas/statSchema');
|
||||
|
|
@ -60,6 +61,9 @@ const config = require('../config.json');
|
|||
const port = config.port;
|
||||
const dbUrl = `mongodb://${config.db.user}:${config.db.pass}@${config.db.address}:${config.db.port}/${config.db.database}`;
|
||||
|
||||
//Check for insecure config
|
||||
configCheck.securityCheck();
|
||||
|
||||
//Define express
|
||||
const app = express();
|
||||
|
||||
|
|
@ -78,10 +82,6 @@ const sessionMiddleware = session({
|
|||
const httpServer = createServer(app);
|
||||
const io = new Server(httpServer, {});
|
||||
|
||||
if(config.protocol == 'http'){
|
||||
console.warn("Starting in HTTP mode. This server should be used for development purposes only!");
|
||||
}
|
||||
|
||||
//Connect mongoose to the database
|
||||
mongoose.set("sanitizeFilter", true).connect(dbUrl).then(() => {
|
||||
console.log("Connected to DB");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue