Skip to content

Commit 3fabd17

Browse files
authored
Merge pull request #10 from SubleXBle/development--improvements--0.3.2
🧱 New Blocklist Logic 🔁 Blocking an IP address now stores it in a jail-specific blocklist (blocklist["jailname"][]) instead of one global list. 🔍 Improves clarity and allows easier tracking of blocked IPs per jail as it is a step for better fail2ban integration. 📊 New Statistics 📅 The Fail2Ban stats panel now includes: ✅ Today’s bans & unbans (as before) 🕓 Yesterday 📈 Last 7 Days 📊 Last 30 Days 🧩 Per-Jail Blocklist Display 🧾 Each jail now displays its own blocklist section with: 🔒 Active bans ⏳ Pending entries 🔄 Auto-refresh every 60 seconds. for Jail-Stats
2 parents 620578a + 5fc765c commit 3fabd17

23 files changed

+814
-295
lines changed

README.md

Lines changed: 95 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Fail2Ban-Report
2-
> Beta 3.1 | Version 0.3.1
2+
> Beta 3.2 | Version 0.3.2
33
44
A simple and clean web-based dashboard to turn your daily Fail2Ban logs into searchable and filterable JSON reports — with optional IP blocklist management for UFW.
55

@@ -58,31 +58,83 @@ Fail2Ban-Report parses your fail2ban.log and generates JSON-based reports viewab
5858
5959
---
6060

61-
## 🆕 What's New in V 0.3.1
62-
63-
- **Protected access to JSON files**
64-
- Direct access to `/archive/*.json` is now blocked via `.htaccess`
65-
- Frontend scripts no longer request raw `.json` files directly
66-
- **New secure PHP endpoints**
67-
- `includes/get-json.php` and `includes/get-blocklist.php` act as controlled proxies to serve JSON data
68-
- Only PHP scripts will now expose required JSON content
69-
- **Hardened frontend behavior**
70-
- JavaScript files (`jsonreader.js`, `blocklist-overlay.js`) fetch data only via the new PHP proxies
71-
- **New Ministats in Header**
72-
- Shows today's **ban/unban statistics** in the page header:
73-
- 🚫 Bans
74-
- 🟢 Unbans
75-
- 📊 Total events
76-
- Adds quick insight into current Fail2Ban activity
77-
- **Mobile-Friendly**
78-
- Site is now more mobile friendly
79-
- added favicon (🕵️) to make browsers happy
80-
81-
82-
🧪 [as promised there is an highly experimental feature for using fail2ban instead of UFW.](using-Fail2Ban-firewall-update.md) (⚠️ not recommended)
61+
## 🆕 What's New in V 0.3.2
62+
63+
### 🧱 New Blocklist Logic
64+
- 🔁 Blocking an IP address now stores it in a **jail-specific blocklist** (`blocklist["jailname"][]`) instead of one global list.
65+
- 🔍 Improves clarity and allows easier tracking of blocked IPs **per jail** as it is a step for better fail2ban integration.
66+
67+
### 📊 New Statistics
68+
- 📅 The Fail2Ban stats panel now includes:
69+
-**Today’s** bans & unbans (as before)
70+
- 🕓 **Yesterday**
71+
- 📈 **Last 7 Days**
72+
- 📊 **Last 30 Days**
73+
74+
### 🧩 Per-Jail Blocklist Display
75+
- 🧾 Each jail now displays its own **blocklist section** with:
76+
- 🔒 Active bans
77+
- ⏳ Pending entries
78+
- 🔄 Auto-refresh every **60 seconds**. for Jail-Stats
8379

8480
---
8581

82+
### ⚠️ Upgrade Notice
83+
84+
If you're upgrading from an existing installation:
85+
86+
- ⚠️ **The new blocklist format is not compatible with the old `blocklist.json`.**
87+
- 🧹 To ensure a clean transition and avoid orphaned firewall entries, follow these steps:
88+
89+
1. **Empty your current blocklist** via the **Unblock** buttons in the UI.
90+
2. 🔄 Trigger a **sync** using the `firewall-update.sh` to remove all Fail2Ban-Report-related rules from the firewall.
91+
3. 🗑️ Delete the old `blocklist.json`.
92+
4. 📦 Replace all files with the new version (overwrite).
93+
5. ✅ Done! The new system will now build jail-specific blocklists automatically.
94+
95+
- 🛠️ _Optional_ : Run the `installer.sh` again to get a fresh setup.
96+
97+
> This ensures no leftover blocks remain in your firewall from the previous system.
98+
99+
100+
### 🔄 Updated and Added Files in v0.3.2
101+
102+
#### 🗂️ Backend (PHP / Shell)
103+
104+
- `includes/block-ip.php`
105+
→ Refactored to support jail-specific blocklists
106+
107+
- `includes/unblock-ip.php`
108+
→ Now handles unblocking from jail-based lists
109+
110+
- `includes/list-files.php`
111+
→ Modified to read multiple jail-specific blocklists
112+
113+
- `includes/footer.php`
114+
→ Includes references to new JS files
115+
116+
- `includes/fail2ban-logstats.php`
117+
→ Extended to calculate aggregate statistics (Today, Yesterday, Last 7/30 Days)
118+
119+
- `firewall-update.sh`
120+
→ Now processes `blocklist.json` with jail-based structure:
121+
`{ "sshd": [...], "apache-auth": [...] }`
122+
123+
- `assets/css/style.css`
124+
→ added the new stuff (i know it is still a mess)
125+
126+
127+
#### 🆕 New Files (JS)
128+
129+
- `assets/js/blocklist-stats.js`
130+
→ Displays per-jail "Active" and "Pending" IP statistics
131+
132+
- `assets/js/fail2ban-logstats.js`
133+
→ Displays time-based event statistics
134+
135+
---
136+
137+
86138
## 📄 Changelog
87139

88140
Details about all new features, improvements, and changed files can be found in the [Changelog](changelog.md).
@@ -99,8 +151,9 @@ This is especially useful if you want to manually patch or update individual fil
99151
-**Date filter** now correctly limits displayed events
100152
-**Jail filter** now correctly shows only the jails present in the displayed event list.
101153
-**File date filtering** fix to include today's JSON logs and ensure latest files are listed correctly.
102-
-**Blocklist Path on unblocking** fixed a possible bug that could lead to not finding the blocklist.json.
103-
→ Hotfixed on 05.08.2025 at 13:10 (UTC+2) directly in main
154+
-**Blocklist Path on unblocking** fixed a possible bug that could lead to not finding the blocklist.json when unblocking from the Blocklist view.
155+
→ Hotfixed on 05.08.2025 at 13:10 (UTC+2) directly in latest
156+
=======
104157

105158
---
106159

@@ -131,16 +184,23 @@ This is especially useful if you want to manually patch or update individual fil
131184
- ⏳ Improve CSS and styling
132185

133186
## 👀 Outlook
134-
- 🔭 next major version will focus on security by mooving archive/ out of webdirectory.
187+
- 📦 The next major version will focus on security by mooving and restructuring the `archive/` folder layout.
188+
- 🐳 A Docker image is expected probably around version v0.5.x, following the restructuring.
135189

136190
---
137191

138192
## 🖼️ Screenshots
139193

140-
![Main interface with log overview](assets/images/Main-List-031.png)
141-
![Blocklist interface with unblock actions](assets/images/Blocklist-Overlay.png)
142-
![Result after banning an IP](assets/images/banip.png)
143-
![Result after "report" an IP](assets/images/reportip.png)
194+
![Main interface with log overview](assets/images/Main-List-032.png)
195+
![Blocklist interface with unblock actions](assets/images/Block-List-032.png)
196+
![Result after banning an IP](assets/images/Message-Toast-032.png)
197+
198+
---
199+
200+
## 🖥️ Demo
201+
👀 Want to try out the look & feel?
202+
There's a simple demo version available here – no backend, no real data:
203+
👉 https://suble.net/ 🔗
144204

145205
---
146206

@@ -157,6 +217,11 @@ Pull requests, feature ideas and bug reports are very welcome!
157217
158218
---
159219

220+
## 🧪 Experimental
221+
- 🧪 [there is an highly experimental feature for using fail2ban instead of UFW.](using-Fail2Ban-firewall-update.md) (⚠️ not recommended)
222+
223+
---
224+
160225
## 📄 License
161226

162227
This project is licensed under the **GPLv3**.

0 commit comments

Comments
 (0)