Skip to content

Commit dfe71e3

Browse files
authored
Modify SQL query to use 'bips' table instead of bans for the count
Use bips as it has the list of all persisted banned IPs. This should fix the incorrect count of banned IPs in the dashboard Signed-off-by: Calvin Hobbes <[email protected]>
1 parent 84be9ea commit dfe71e3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

root/dashboard/swag-f2b.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ def _get_f2b_data(db_path):
99
con = sqlite3.connect(db_path)
1010
cur = con.cursor()
1111
results = cur.execute("""
12-
SELECT jails.name,
13-
COUNT(bans.ip) AS bans,
14-
(SELECT DISTINCT bans.ip from bans where jails.name = bans.jail ORDER BY timeofban DESC) as last_ban,
15-
(SELECT DISTINCT bans.data from bans where jails.name = bans.jail ORDER BY timeofban DESC) as data
16-
FROM jails
17-
LEFT JOIN bans ON jails.name=bans.jail
12+
SELECT jails.name,
13+
COUNT(bips.ip) AS bans,
14+
(SELECT DISTINCT bips.ip from bips where jails.name = bips.jail ORDER BY timeofban DESC) as last_ban,
15+
(SELECT DISTINCT bips.data from bips where jails.name = bips.jail ORDER BY timeofban DESC) as data
16+
FROM jails
17+
LEFT JOIN bips ON jails.name=bips.jail
1818
GROUP BY jails.name
1919
""").fetchall()
2020
con.close()

0 commit comments

Comments
 (0)