mirror of
https://github.com/swissmakers/fail2ban-ui.git
synced 2026-04-11 13:47:05 +02:00
initial push
This commit is contained in:
23
cmd/server/main.go
Normal file
23
cmd/server/main.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/swissmakers/fail2ban-ui/pkg/web"
|
||||
)
|
||||
|
||||
func main() {
|
||||
r := gin.Default()
|
||||
|
||||
// Load HTML templates from pkg/web/templates
|
||||
r.LoadHTMLGlob("pkg/web/templates/*")
|
||||
|
||||
// Register our routes (IndexHandler, /api/summary, /api/jails/:jail/unban/:ip)
|
||||
web.RegisterRoutes(r)
|
||||
|
||||
log.Println("Starting Fail2ban UI on :8080. Run with 'sudo' if fail2ban-client requires it.")
|
||||
if err := r.Run(":8080"); err != nil {
|
||||
log.Fatalf("Server crashed: %v", err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user