# ── F2B Control Center — webhook action ────────────────────────────────────── # # Optional fail2ban action that POSTs a JSON payload to a webhook URL on # ban and unban events. Useful for Discord, Slack, n8n, or any HTTP endpoint. # # USAGE: # Set WEBHOOK_URL in your .env file. # Then add to any jail in jail.local: # # action = %(action_)s # webhook[url="%(webhook_url)s"] # # And in [DEFAULT]: # webhook_url = YOUR_WEBHOOK_URL # # This action is NOT enabled by default. The dashboard's ban webhook is # handled separately via the WEBHOOK_URL environment variable in server.js. # ───────────────────────────────────────────────────────────────────────────── [Definition] # Variable: webhook URL (set via jail.local or override) webhook_url = %(url)s actionban = curl -s -X POST \ -H "Content-Type: application/json" \ -d '{"action":"ban","ip":"","jail":"","failures":,"ts":"'$(date -u +%%Y-%%m-%%dT%%H:%%M:%%SZ)'"}' \ "%(webhook_url)s" || true actionunban = curl -s -X POST \ -H "Content-Type: application/json" \ -d '{"action":"unban","ip":"","jail":"","ts":"'$(date -u +%%Y-%%m-%%dT%%H:%%M:%%SZ)'"}' \ "%(webhook_url)s" || true [Init] name = default url =