This commit is contained in:
Sefinek 2024-08-29 14:03:21 +02:00
parent dd58b7729e
commit 340c05bf7d
4 changed files with 7 additions and 5 deletions

View file

@ -1,4 +1,5 @@
require('dotenv').config(); require('dotenv').config();
const axios = require('axios'); const axios = require('axios');
const PAYLOAD = require('./scripts/payload.js'); const PAYLOAD = require('./scripts/payload.js');
const generateComment = require('./scripts/generateComment.js'); const generateComment = require('./scripts/generateComment.js');
@ -7,6 +8,7 @@ const headers = require('./scripts/headers.js');
const { logToCSV, readReportedIPs, wasImageRequestLogged } = require('./scripts/csv.js'); const { logToCSV, readReportedIPs, wasImageRequestLogged } = require('./scripts/csv.js');
const formatDelay = require('./scripts/formatDelay.js'); const formatDelay = require('./scripts/formatDelay.js');
const log = require('./scripts/log.js'); const log = require('./scripts/log.js');
const { version } = require('./package.json');
const MAIN_DELAY = process.env.NODE_ENV === 'production' const MAIN_DELAY = process.env.NODE_ENV === 'production'
? 3 * 60 * 60 * 1000 ? 3 * 60 * 60 * 1000
@ -96,7 +98,7 @@ const reportIP = async (event, url, country, cycleErrorCounts) => {
let cycleId = 1; let cycleId = 1;
while (true) { while (true) {
log('info', '===================== New Reporting Cycle ====================='); log('info', `===================== New Reporting Cycle (v${version}) =====================`);
const blockedIPEvents = await fetchBlockedIPs(); const blockedIPEvents = await fetchBlockedIPs();
if (!blockedIPEvents) { if (!blockedIPEvents) {

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "cf-waf-abuseipdb", "name": "cf-waf-abuseipdb",
"version": "1.0.0", "version": "1.0.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "cf-waf-abuseipdb", "name": "cf-waf-abuseipdb",
"version": "1.0.0", "version": "1.0.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"axios": "^1.7.5", "axios": "^1.7.5",

View file

@ -1,6 +1,6 @@
{ {
"name": "cf-waf-abuseipdb", "name": "cf-waf-abuseipdb",
"version": "1.0.0", "version": "1.0.1",
"description": "A Node.js project that enables automatic reporting of incidents detected by Cloudflare WAF to the AbuseIPDB database.", "description": "A Node.js project that enables automatic reporting of incidents detected by Cloudflare WAF to the AbuseIPDB database.",
"keywords": [ "keywords": [
"abuseipdb", "abuseipdb",

View file

@ -3,7 +3,7 @@ const query = `query ListFirewallEvents($zoneTag: string, $filter: FirewallEvent
zones(filter: { zoneTag: $zoneTag }) { zones(filter: { zoneTag: $zoneTag }) {
firewallEventsAdaptive( firewallEventsAdaptive(
filter: $filter, filter: $filter,
limit: 800, limit: 1000,
orderBy: [datetime_DESC] orderBy: [datetime_DESC]
) { ) {
action action