From 3412709f9bcb5734d5605e57f29141475b9ddd88 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 23:16:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20fail2ban=20IPv6=20?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E6=98=BE=E7=A4=BA=E5=92=8C=E8=A7=A3=E5=B0=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#1245)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Initial plan * fix: 修复 fail2ban IPv6 地址显示和解封问题 Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com> --- internal/apps/fail2ban/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/apps/fail2ban/app.go b/internal/apps/fail2ban/app.go index 09eadfef..1c910010 100644 --- a/internal/apps/fail2ban/app.go +++ b/internal/apps/fail2ban/app.go @@ -263,7 +263,7 @@ func (s *App) BanList(w http.ResponseWriter, r *http.Request) { service.Error(w, http.StatusInternalServerError, s.t.Get("failed to get total banned list")) return } - bannedIp, err := shell.Execf(`fail2ban-client status %s | grep "Banned IP list" | awk -F ":" '{print $2}'`, req.Name) + bannedIp, err := shell.Execf(`fail2ban-client status %s | grep "Banned IP list" | sed 's/.*Banned IP list:[[:space:]]*//'`, req.Name) if err != nil { service.Error(w, http.StatusInternalServerError, s.t.Get("failed to get banned ip list")) return