chore: remove webhook, .env.example; comment out optional compose vars

- Remove WEBHOOK_URL from server.js and compose (too many untestable edge cases)
- Delete .env.example (config is now inline in docker-compose.yml)
- Comment out ABUSEIPDB_API_KEY, CF_EMAIL, CF_APIKEY in compose by default

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-20 15:25:02 +00:00
parent 1be79cbd3e
commit 9f7060b7fd
3 changed files with 3 additions and 61 deletions

View File

@@ -22,8 +22,6 @@ const SUBNETS = (process.env.SUBNETS_TO_IGNORE || '10.0.0.0/8,172.16.0.0/1
const DEFAULT_DAYS = 3;
const ABUSE_KEY = process.env.ABUSEIPDB_API_KEY;
const AUTOBAN_THR = 75;
// Optional: POST to this URL on every manual ban (Discord, Slack, n8n, etc.)
const WEBHOOK_URL = process.env.WEBHOOK_URL || '';
// ── In-memory state ───────────────────────────────────────────────────────────
const abuseCache = new Map(); // ip → { score, country, ts }
@@ -153,14 +151,6 @@ async function buildBanList() {
async function banIP(ip) {
await run(`fail2ban-client set ${MANUAL_JAIL} banip ${ip}`);
banCache = null;
// Optional webhook notification
if (WEBHOOK_URL) {
fetch(WEBHOOK_URL, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ action: 'ban', ip, jail: MANUAL_JAIL, ts: new Date().toISOString() }),
}).catch(() => {}); // fire and forget — never block on this
}
}
async function unbanIP(ip, jail) {