Merge branch 'master' of gitlab.com:Hri7566/mpp-server

This commit is contained in:
Hri7566 2022-08-16 06:24:24 -04:00
commit 8eb7eb2f64
4 changed files with 12 additions and 4 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "mpp.hri7566.info"]
path = mpp.hri7566.info
url = git@gitlab.com:Hri7566/mpp.hri7566.info.git

View File

@ -13,6 +13,7 @@ module.exports = Object.seal({
defaultUsername: "Anonymous", defaultUsername: "Anonymous",
adminpass: process.env.ADMINPASS, adminpass: process.env.ADMINPASS,
ssl: process.env.SSL, ssl: process.env.SSL,
serveFiles: true,
defaultRoomSettings: { defaultRoomSettings: {
// color: "#3b5054", // color: "#3b5054",
// color2: "#001014", // color2: "#001014",

View File

@ -12,11 +12,13 @@ var logger = new Logger("Database");
mongoose.connect(process.env.MONGO_URL, { mongoose.connect(process.env.MONGO_URL, {
useNewUrlParser: true, useNewUrlParser: true,
useUnifiedTopology: true useUnifiedTopology: true,
connectTimeoutMS: 1000
}, err => { }, err => {
if (err) { if (err) {
console.error(err); console.error(err);
return; logger.error("Unable to connect to database service");
process.exit(1);
} }
logger.log("Connected"); logger.log("Connected");
}); });

View File

@ -25,7 +25,8 @@ class Server extends EventEmitter {
server: this.https_server, server: this.https_server,
backlog: 100, backlog: 100,
verifyClient: (info) => { 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; return true;
} }
}); });
@ -36,7 +37,8 @@ class Server extends EventEmitter {
port: config.port, port: config.port,
backlog: 100, backlog: 100,
verifyClient: (info) => { 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; return true;
} }
}); });