process.env.NODE_ENV === 'development'
This commit is contained in:
parent
a6c7d26bd5
commit
d60272b62f
1 changed files with 2 additions and 4 deletions
|
|
@ -6,17 +6,15 @@ const clientIp = require('./clientIp.js');
|
|||
const API_URL = `${process.env.SEFINEK_API_URL}/cloudflare-waf-abuseipdb/post`;
|
||||
|
||||
module.exports = async () => {
|
||||
const userIp = clientIp.getAddress();
|
||||
const reportedIPs = readReportedIPs().filter(x =>
|
||||
x.status === 'REPORTED' &&
|
||||
x.ip !== userIp &&
|
||||
x.ip !== clientIp.getAddress() &&
|
||||
!['//video', '//js', '//images', '//imgs', 'favicon.ico'].some(endpoint => x.endpoint.includes(endpoint)) && // Endpoints
|
||||
x.hostname !== 'blocklist.sefinek.net' && // Domains
|
||||
!['Chrome/129', 'Chrome/130'].some(agent => x.useragent.includes(agent)) && // User-agents
|
||||
!x.sefinekAPI
|
||||
);
|
||||
|
||||
if (reportedIPs.length === 0) return;
|
||||
if (!reportedIPs.length) return;
|
||||
|
||||
const uniqueLogs = reportedIPs.reduce((acc, ip) => {
|
||||
if (acc.seen.has(ip.ip)) return acc;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue