mirror of
https://github.com/swissmakers/fail2ban-ui.git
synced 2026-04-19 06:53:14 +02:00
Implement geoIP and whois lookups directly from fail2ban-UI
This commit is contained in:
@@ -5,7 +5,9 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/text/cases"
|
||||
"golang.org/x/text/language"
|
||||
|
||||
"github.com/swissmakers/fail2ban-ui/internal/config"
|
||||
"github.com/swissmakers/fail2ban-ui/internal/integrations"
|
||||
@@ -84,7 +86,7 @@ func runAdvancedIntegrationAction(ctx context.Context, action, ip string, settin
|
||||
"unblock": "unblocked",
|
||||
}[action]
|
||||
|
||||
message := fmt.Sprintf("%s via %s", strings.Title(action), cfg.Integration)
|
||||
message := fmt.Sprintf("%s via %s", cases.Title(language.English).String(action), cfg.Integration)
|
||||
if err != nil && !skipLoggingIfAlreadyBlocked {
|
||||
status = "error"
|
||||
message = err.Error()
|
||||
|
||||
Reference in New Issue
Block a user