forked from Hri7566/mpp-server-dev2
Merge branch 'master' of gitlab.com:Hri7566/mpp-server
This commit is contained in:
commit
14ff6a54f9
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "mpp.hri7566.info"]
|
||||||
|
path = mpp.hri7566.info
|
||||||
|
url = git@gitlab.com:Hri7566/mpp.hri7566.info.git
|
|
@ -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",
|
||||||
|
|
|
@ -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");
|
||||||
});
|
});
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue