process.env.NODE_ENV === 'development'

This commit is contained in:
Sefinek 2024-10-10 07:25:11 +02:00
parent a6c7d26bd5
commit d60272b62f

View file

@ -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;