Merge pull request #1014 from lbryio/lenientPublishLimits
changes max publishes to 20
This commit is contained in:
commit
a66511caaf
1 changed files with 2 additions and 2 deletions
|
@ -7,7 +7,7 @@ const {
|
||||||
const ipBanFile = './site/config/ipBan.txt';
|
const ipBanFile = './site/config/ipBan.txt';
|
||||||
const forbiddenMessage =
|
const forbiddenMessage =
|
||||||
'<h1>Forbidden</h1>If you are seeing this by mistake, please contact us using <a href="https://chat.lbry.com/">https://chat.lbry.com/</a>';
|
'<h1>Forbidden</h1>If you are seeing this by mistake, please contact us using <a href="https://chat.lbry.com/">https://chat.lbry.com/</a>';
|
||||||
|
const maxPublishesInTenMinutes = 20;
|
||||||
let ipCounts = {};
|
let ipCounts = {};
|
||||||
let blockedAddresses = [];
|
let blockedAddresses = [];
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ const autoblockPublishMiddleware = (req, res, next) => {
|
||||||
}
|
}
|
||||||
}, 600000 /* 10 minute retainer */);
|
}, 600000 /* 10 minute retainer */);
|
||||||
|
|
||||||
if (count === 10) {
|
if (count === maxPublishesInTenMinutes) {
|
||||||
logger.error(`Banning IP: ${ip}`);
|
logger.error(`Banning IP: ${ip}`);
|
||||||
blockedAddresses.push(ip);
|
blockedAddresses.push(ip);
|
||||||
res.status(403).send(forbiddenMessage);
|
res.status(403).send(forbiddenMessage);
|
||||||
|
|
Loading…
Reference in a new issue