🔥 disable rate limit for now -> wait till mongoose model exists
This commit is contained in:
parent
e49591a78e
commit
4a815d302a
4
package-lock.json
generated
4
package-lock.json
generated
@ -780,7 +780,7 @@
|
|||||||
},
|
},
|
||||||
"node_modules/fosscord-server-util": {
|
"node_modules/fosscord-server-util": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "git+ssh://git@github.com/fosscord/fosscord-server-util.git#775296d0048d290b959f07cde10a3ffc1430bad9",
|
"resolved": "git+ssh://git@github.com/fosscord/fosscord-server-util.git#637cfa6010dd00a399463f5a14869c169960d6e6",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
@ -2998,7 +2998,7 @@
|
|||||||
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
|
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
|
||||||
},
|
},
|
||||||
"fosscord-server-util": {
|
"fosscord-server-util": {
|
||||||
"version": "git+ssh://git@github.com/fosscord/fosscord-server-util.git#775296d0048d290b959f07cde10a3ffc1430bad9",
|
"version": "git+ssh://git@github.com/fosscord/fosscord-server-util.git#637cfa6010dd00a399463f5a14869c169960d6e6",
|
||||||
"from": "fosscord-server-util@github:fosscord/fosscord-server-util",
|
"from": "fosscord-server-util@github:fosscord/fosscord-server-util",
|
||||||
"requires": {
|
"requires": {
|
||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
process.on("uncaughtException", console.error);
|
process.on("uncaughtException", console.error);
|
||||||
process.on("unhandledRejection", console.error);
|
process.on("unhandledRejection", console.error);
|
||||||
setTimeout(() => {}, 100000000);
|
|
||||||
|
|
||||||
import { DiscordServer } from "./Server";
|
import { DiscordServer } from "./Server";
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ import { db } from "fosscord-server-util";
|
|||||||
export async function GlobalRateLimit(req: Request, res: Response, next: NextFunction) {
|
export async function GlobalRateLimit(req: Request, res: Response, next: NextFunction) {
|
||||||
return next();
|
return next();
|
||||||
// TODO: use new db mongoose models
|
// TODO: use new db mongoose models
|
||||||
|
/*
|
||||||
if (!Config.get().limits.rate.ip.enabled) return next();
|
if (!Config.get().limits.rate.ip.enabled) return next();
|
||||||
|
|
||||||
const ip = getIpAdress(req);
|
const ip = getIpAdress(req);
|
||||||
@ -39,6 +40,7 @@ export async function GlobalRateLimit(req: Request, res: Response, next: NextFun
|
|||||||
});
|
});
|
||||||
|
|
||||||
return next();
|
return next();
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getIpAdress(req: Request): string {
|
export function getIpAdress(req: Request): string {
|
||||||
|
@ -7,6 +7,7 @@ export function RateLimit({ count = 10, timespan = 1000 * 5, name = "/" }) {
|
|||||||
return async (req: Request, res: Response, next: NextFunction) => {
|
return async (req: Request, res: Response, next: NextFunction) => {
|
||||||
return next();
|
return next();
|
||||||
// TODO: use new db mongoose models
|
// TODO: use new db mongoose models
|
||||||
|
/*
|
||||||
|
|
||||||
let id = req.userid || getIpAdress(req);
|
let id = req.userid || getIpAdress(req);
|
||||||
|
|
||||||
@ -40,5 +41,6 @@ export function RateLimit({ count = 10, timespan = 1000 * 5, name = "/" }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return next();
|
return next();
|
||||||
|
*/
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user