mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-22 12:00:41 +03:00
Deleted a not required module
This commit is contained in:
parent
f138276abf
commit
657e18773b
3 changed files with 3 additions and 15 deletions
6
index.js
6
index.js
|
@ -1,7 +1,6 @@
|
|||
const { urlencoded: BP } = require('body-parser'),
|
||||
{ mw: IP } = require('request-ip'),
|
||||
RL = require('express-rate-limit'),
|
||||
BAN = require('express-ip-block'),
|
||||
SES = require('express-session');
|
||||
|
||||
const
|
||||
|
@ -21,13 +20,14 @@ mongoose.connect(process.env.MONGO_DB_URL,
|
|||
|
||||
app.set("view engine", "ejs");
|
||||
|
||||
app.use(express.static("public"), express.json(), IP(), BAN(app.ips),
|
||||
app.use(express.static("public"), express.json(), IP(),
|
||||
SES({ secret: 'secret', resave: true, saveUninitialized: true }),
|
||||
async (req, res, next) => {
|
||||
if (app.ips.includes(req.clientIp)) return res.status(403).send("You are banned from this forum.");
|
||||
|
||||
req.user = req.session.userID ? await UserModel.findOneAndUpdate({ id: req.session.userID }, {
|
||||
lastSeen: Date.now(), $addToSet: { ips: req.clientIp }
|
||||
}) : null;
|
||||
|
||||
res.reply = (page, options = {}, status = 200) => res.status(status)
|
||||
.render(page, { user: req.user, theme: req.user?.theme || def_theme, forum_name, description, ...options });
|
||||
|
||||
|
|
11
package-lock.json
generated
11
package-lock.json
generated
|
@ -14,7 +14,6 @@
|
|||
"dotenv": "^16.0.1",
|
||||
"ejs": "^3.1.6",
|
||||
"express": "^4.18.1",
|
||||
"express-ip-block": "^0.1.2",
|
||||
"express-rate-limit": "^6.6.0",
|
||||
"express-session": "^1.17.2",
|
||||
"mongoose": "^6.6.0",
|
||||
|
@ -580,11 +579,6 @@
|
|||
"node": ">= 0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/express-ip-block": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/express-ip-block/-/express-ip-block-0.1.2.tgz",
|
||||
"integrity": "sha512-+GcEOAM6Voete7BmG9pU8b4XAmzsQGj37aIJKF/D4Sbk4q2INJ4D7FyZJq8hwfHZG8s5wuZxYSO7brIlB+0s5w=="
|
||||
},
|
||||
"node_modules/express-rate-limit": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-6.6.0.tgz",
|
||||
|
@ -2214,11 +2208,6 @@
|
|||
"vary": "~1.1.2"
|
||||
}
|
||||
},
|
||||
"express-ip-block": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/express-ip-block/-/express-ip-block-0.1.2.tgz",
|
||||
"integrity": "sha512-+GcEOAM6Voete7BmG9pU8b4XAmzsQGj37aIJKF/D4Sbk4q2INJ4D7FyZJq8hwfHZG8s5wuZxYSO7brIlB+0s5w=="
|
||||
},
|
||||
"express-rate-limit": {
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-6.6.0.tgz",
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
"dotenv": "^16.0.1",
|
||||
"ejs": "^3.1.6",
|
||||
"express": "^4.18.1",
|
||||
"express-ip-block": "^0.1.2",
|
||||
"express-rate-limit": "^6.6.0",
|
||||
"express-session": "^1.17.2",
|
||||
"mongoose": "^6.6.0",
|
||||
|
|
Loading…
Reference in a new issue