mirror of
https://github.com/swissmakers/fail2ban-ui.git
synced 2026-04-17 05:53:15 +02:00
initial push
This commit is contained in:
24
pkg/web/routes.go
Normal file
24
pkg/web/routes.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// RegisterRoutes sets up the routes for the Fail2ban UI.
|
||||
func RegisterRoutes(r *gin.Engine) {
|
||||
// Render the dashboard
|
||||
r.GET("/", IndexHandler)
|
||||
|
||||
api := r.Group("/api")
|
||||
{
|
||||
api.GET("/summary", SummaryHandler)
|
||||
api.POST("/jails/:jail/unban/:ip", UnbanIPHandler)
|
||||
|
||||
// New config endpoints
|
||||
api.GET("/jails/:jail/config", GetJailConfigHandler)
|
||||
api.POST("/jails/:jail/config", SetJailConfigHandler)
|
||||
|
||||
// Reload endpoint
|
||||
api.POST("/fail2ban/reload", ReloadFail2banHandler)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user