diff --git a/.env.default b/.env.default index 7a6910a..7e89445 100644 --- a/.env.default +++ b/.env.default @@ -36,5 +36,5 @@ IP_REFRESH_INTERVAL=80 # Report IP addresses to api.sefinek.net to support the development of the repository at https://github.com/sefinek24/Malicious-IP-Addresses. SEFINEK_API_SECRET is required if true. REPORT_TO_SEFINEK_API=true -# How often should the log (reported_ips.csv) be analyzed and sent to the Sefinek API? In minutes. -SEFINEK_API_INTERVAL=60 \ No newline at end of file +# How often should the log (reported_ips.csv) be analyzed and sent to the Sefinek API? In hours. +SEFINEK_API_INTERVAL=1 \ No newline at end of file diff --git a/config.js b/config.js index 6c53327..aa1bcdd 100644 --- a/config.js +++ b/config.js @@ -1,18 +1,18 @@ const CYCLE_INTERVAL = process.env.NODE_ENV === 'production' ? - parseInt(process.env.CYCLE_INTERVAL) * 60 * 1000 : 8 * 1000; + parseInt(process.env.CYCLE_INTERVAL || '120') * 60 * 1000 : 8 * 1000; -const REPORTED_IP_COOLDOWN_MS = parseInt(process.env.REPORTED_IP_COOLDOWN_MS) * 60 * 60 * 1000; +const REPORTED_IP_COOLDOWN_MS = parseInt(process.env.REPORTED_IP_COOLDOWN_MS || '6') * 60 * 60 * 1000; -const MAX_URL_LENGTH = parseInt(process.env.MAX_URL_LENGTH); +const MAX_URL_LENGTH = parseInt(process.env.MAX_URL_LENGTH || '920'); -const SUCCESS_COOLDOWN_MS = parseInt(process.env.SUCCESS_COOLDOWN_MS); +const SUCCESS_COOLDOWN_MS = parseInt(process.env.SUCCESS_COOLDOWN_MS || '2') * 1000; -const IP_REFRESH_INTERVAL = parseInt(process.env.IP_REFRESH_INTERVAL) * 60 * 1000; +const IP_REFRESH_INTERVAL = parseInt(process.env.IP_REFRESH_INTERVAL || '80') * 60 * 1000; const REPORT_TO_SEFINEK_API = process.env.REPORT_TO_SEFINEK_API === 'true'; const SEFINEK_API_INTERVAL = process.env.NODE_ENV === 'production' ? - parseInt(process.env.SEFINEK_API_INTERVAL) * 60 * 1000 : 5 * 1000; + parseInt(process.env.SEFINEK_API_INTERVAL || '1') * 60 * 60 * 1000 : 5 * 1000; module.exports = { CYCLE_INTERVAL,