From 483029c75c4e9b6a1ca47ae98b8cd651dad69752 Mon Sep 17 00:00:00 2001 From: Sefinek Date: Tue, 18 Mar 2025 21:38:05 +0100 Subject: [PATCH] Fixes for `isLocalIP` --- config.default.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/config.default.js b/config.default.js index 78c0cad..71aa716 100644 --- a/config.default.js +++ b/config.default.js @@ -1,9 +1,9 @@ exports.MAIN = { - // This server + // My Server UFW_LOG_FILE: '/var/log/ufw.log', CACHE_FILE: '/tmp/ufw-abuseipdb-reporter.cache', SERVER_ID: null, // The server name that will be visible in the reports (e.g., 'homeserver1'). If you don't want to define it, leave the value as null. - IP_REFRESH_INTERVAL: 10 * 60 * 1000, // How often should (every 10 minutes) the script check the server's IP address to avoid accidental self-reports? + IP_REFRESH_SCHEDULE: '*/20 * * * *', // Cron: How often should the script check the IP address assigned by the ISP to prevent accidental self-reporting? Default: every 20 minutes // Reporting ABUSEIPDB_API_KEY: '', // Secret API key for AbuseIPDB. @@ -11,11 +11,11 @@ exports.MAIN = { // Automatic Updates AUTO_UPDATE_ENABLED: true, // Do you want the script to automatically update to the latest version using 'git pull'? (true = enabled, false = disabled) - AUTO_UPDATE_SCHEDULE: '0 18 * * *', // Schedule for automatic script updates (CRON format). Default: every day at 18:00 + AUTO_UPDATE_SCHEDULE: '0 18 * * *', // Cron: Schedule for automatic script updates. Default: every day at 18:00 // Discord Webhooks - DISCORD_WEBHOOKS_ENABLED: false, - DISCORD_WEBHOOKS_URL: '', + DISCORD_WEBHOOKS_ENABLED: false, // Should the script send webhooks? They will contain error reports, daily summaries related to reports, etc. + DISCORD_WEBHOOKS_URL: '', // Webhook URL. }; @@ -45,14 +45,14 @@ exports.MAIN = { * @returns {string} A formatted string report. */ exports.REPORT_COMMENT = ({ timestamp, In, Out, srcIp, dstIp, res, tos, prec, ttl, id, proto, spt, dpt, len, urgp, mac, window, syn }, fullLog, serverName) => - `Blocked by UFW ${serverName ? `on ${serverName} ` : ''}[${dpt}/${proto?.toLowerCase()}] + `Blocked by UFW ${serverName ? `on ${serverName} ` : ''}[${dpt || 'N/A'}/${proto?.toLowerCase() || 'N/A'}] Source port: ${spt || 'N/A'} TTL: ${ttl || 'N/A'} Packet length: ${len || 'N/A'} TOS: ${tos || 'N/A'} This report was generated by: -https://github.com/sefinek/UFW-AbuseIPDB-Reporter`; // Please do not remove this URL; I would be very grateful! Thank you. 💙 +https://github.com/sefinek/UFW-AbuseIPDB-Reporter`; // Please do not delete this URL. I would be very grateful, thank you! 💙 // Alternative version: // exports.REPORT_COMMENT = ({ timestamp, In, Out, srcIp, dstIp, res, tos, prec, ttl, id, proto, spt, dpt, len, urgp, mac, window, syn }, fullLog, serverName) =>