From d60272b62f8f66188eae9a04bbc4d05455befdc2 Mon Sep 17 00:00:00 2001 From: Sefinek Date: Thu, 10 Oct 2024 07:25:11 +0200 Subject: [PATCH] process.env.NODE_ENV === 'development' --- scripts/sefinekAPI.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/sefinekAPI.js b/scripts/sefinekAPI.js index fd343b7..7060f5c 100644 --- a/scripts/sefinekAPI.js +++ b/scripts/sefinekAPI.js @@ -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;