IP_REFRESH_INTERVAL

This commit is contained in:
Sefinek 2025-02-02 01:17:52 +01:00
parent 0fa4e36b9f
commit 981783d78b
2 changed files with 3 additions and 3 deletions

View file

@ -3,7 +3,7 @@ exports.MAIN = {
UFW_LOG_FILE: '/var/log/ufw.log', UFW_LOG_FILE: '/var/log/ufw.log',
CACHE_FILE: '/tmp/ufw-abuseipdb-reporter.cache', 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. 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.
REFRESHING_IP_ADDRESS: 5 * 60 * 1000, // How often should (every 5 minutes) the script check the server's IP address to avoid accidental self-reports? IP_REFRESH_INTERVAL: 5 * 60 * 1000, // How often should (every 5 minutes) the script check the server's IP address to avoid accidental self-reports?
// Reporting // Reporting
ABUSEIPDB_API_KEY: '', // Secret API key for AbuseIPDB. ABUSEIPDB_API_KEY: '', // Secret API key for AbuseIPDB.

View file

@ -1,7 +1,7 @@
const { networkInterfaces } = require('node:os'); const { networkInterfaces } = require('node:os');
const axios = require('./axios.js'); const axios = require('./axios.js');
const isLocalIP = require('../utils/isLocalIP.js'); const isLocalIP = require('../utils/isLocalIP.js');
const { REFRESHING_IP_ADDRESS } = require('../config.js').MAIN; const { IP_REFRESH_INTERVAL } = require('../config.js').MAIN;
const ipAddrList = new Set(); const ipAddrList = new Set();
@ -32,7 +32,7 @@ const fetchServerIPs = async () => {
(async () => { (async () => {
await fetchServerIPs(); await fetchServerIPs();
setInterval(fetchServerIPs, REFRESHING_IP_ADDRESS); setInterval(fetchServerIPs, IP_REFRESH_INTERVAL);
// console.debug(ipAddrList); // console.debug(ipAddrList);
})(); })();