mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-18 16:58:27 -04:00
Add fail2ban to the dashboard
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import json
|
||||
import sqlite3
|
||||
|
||||
|
||||
con = sqlite3.connect("/config/fail2ban/fail2ban.sqlite3")
|
||||
cur = con.cursor()
|
||||
results = cur.execute("SELECT jails.name, COUNT(bans.ip) AS bans FROM jails LEFT JOIN bans ON jails.name=bans.jail GROUP BY jails.name").fetchall()
|
||||
con.close()
|
||||
output = json.dumps({k:v for (k,v) in results}, sort_keys=True)
|
||||
print(output)
|
||||
Reference in New Issue
Block a user