diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..6ad8a50 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "mpp.hri7566.info"] + path = mpp.hri7566.info + url = git@gitlab.com:Hri7566/mpp.hri7566.info.git diff --git a/config.js b/config.js index 448a4c6..b149a8a 100644 --- a/config.js +++ b/config.js @@ -13,6 +13,7 @@ module.exports = Object.seal({ defaultUsername: "Anonymous", adminpass: process.env.ADMINPASS, ssl: process.env.SSL, + serveFiles: true, defaultRoomSettings: { // color: "#3b5054", // color2: "#001014", diff --git a/src/Database.js b/src/Database.js index 247aad6..762dbad 100644 --- a/src/Database.js +++ b/src/Database.js @@ -12,11 +12,13 @@ var logger = new Logger("Database"); mongoose.connect(process.env.MONGO_URL, { useNewUrlParser: true, - useUnifiedTopology: true + useUnifiedTopology: true, + connectTimeoutMS: 1000 }, err => { if (err) { console.error(err); - return; + logger.error("Unable to connect to database service"); + process.exit(1); } logger.log("Connected"); }); diff --git a/src/Server.js b/src/Server.js index 833fc0a..eabcfe8 100644 --- a/src/Server.js +++ b/src/Server.js @@ -25,7 +25,8 @@ class Server extends EventEmitter { server: this.https_server, backlog: 100, verifyClient: (info) => { - if (banned.includes((info.req.connection.remoteAddress).replace("::ffff:", ""))) return false; + const ip = (info.req.connection.remoteAddress).replace("::ffff:", ""); + if (banned.includes(ip)) return false; return true; } }); @@ -36,7 +37,8 @@ class Server extends EventEmitter { port: config.port, backlog: 100, verifyClient: (info) => { - if (banned.includes((info.req.connection.remoteAddress).replace("::ffff:", ""))) return false; + const ip = (info.req.connection.remoteAddress).replace("::ffff:", ""); + if (ip) return false; return true; } });