From 120c0e3b68c91422d10b1faa7fa1b29fea3910ba Mon Sep 17 00:00:00 2001 From: Sefinek Date: Mon, 10 Mar 2025 23:32:47 +0100 Subject: [PATCH] Add RUN_ON_START --- config.default.js | 5 +++-- index.js | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/config.default.js b/config.default.js index 437cdd3..11ecaae 100644 --- a/config.default.js +++ b/config.default.js @@ -1,9 +1,10 @@ exports.CONFIG = { MAIN: { NODE_ENV: 'production', // Environment mode: 'production' or 'development' - CLOUDFLARE_ZONE_ID: '00000000000000000000000000000000', // https://dash.cloudflare.com/profile/api-tokens - CLOUDFLARE_API_KEY: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', // API key for Cloudflare access + CLOUDFLARE_ZONE_ID: '00000000000000000000000000000000', // API key for Cloudflare access + CLOUDFLARE_API_KEY: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', // https://dash.cloudflare.com/profile/api-tokens ABUSEIPDB_API_KEY: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', // API key for reporting malicious IPs to AbuseIPDB + RUN_ON_START: true, // Should the reporting function run immediately after the script starts? }, CYCLES: { diff --git a/index.js b/index.js index 939b1d0..b1777da 100644 --- a/index.js +++ b/index.js @@ -168,7 +168,9 @@ const cron = async () => { // Ready process.send && process.send('ready'); + log(0, 'The integration is ready!'); + // AbuseIPDB new CronJob(CONFIG.CYCLES.REPORT_SCHEDULE, cron, null, true, 'UTC'); - await cron(); + if (CONFIG.MAIN.RUN_ON_START) await cron(); })(); \ No newline at end of file