What's Changed
- Added manual block section and BanIP method for all connectors, like the UnbanIP functionality by @swissmakers in #45
Backend Changes
- Added
BanIPmethod to the Connector interface ininternal/fail2ban/manager.go - Implemented
BanIPin all connectors:LocalConnector- usesfail2ban-client set <jail> banip <ip>SSHConnector- usesrunFail2banCommandwith banip- (
AgentConnector- uses POST to/v1/jails/{jail}/ban) - experimental
- Added API route
/api/jails/:jail/ban/:ipinpkg/web/routes.go - Added
BanIPHandlerinpkg/web/handlers.go(mirrorsUnbanIPHandler)
Frontend Changes
- Added manual block section in
dashboard.jsbetween "Overview active Jails and Blocks" and "Internal Log Overview" - Added
banIP(jail, ip)function (mirrorsunbanIP) - Added
handleManualBlock()function with form validation - Section includes:
- Jail dropdown (populated from enabled jails)
- IP address input field
- Block IP button
- Form validation (jail selection, IP format)
Full Changelog: v1.2.7...v1.2.8