From bd95dd8ffdc0ba20606a3d5922b6d3d39ddf3c4c Mon Sep 17 00:00:00 2001 From: Urko Date: Sun, 23 Jul 2023 11:13:32 +0200 Subject: [PATCH] fix remove fail2ban --- cmd/http/views/index.hbs | 2 +- internal/api/handler/prosody_hdl.go | 6 +++--- internal/api/server.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/http/views/index.hbs b/cmd/http/views/index.hbs index 09547d9..b28d8d8 100644 --- a/cmd/http/views/index.hbs +++ b/cmd/http/views/index.hbs @@ -15,7 +15,7 @@

Change Password

- +
diff --git a/internal/api/handler/prosody_hdl.go b/internal/api/handler/prosody_hdl.go index 87e6b12..1345c76 100644 --- a/internal/api/handler/prosody_hdl.go +++ b/internal/api/handler/prosody_hdl.go @@ -33,9 +33,9 @@ func (handler ProsodyHandler) Post(c *fiber.Ctx) error { User: c.FormValue("user", ""), } if err := handler.prosodyService.ChangePassword(req.User, req.CurrentPassword, req.NewPassword); err != nil { - for _, ip := range c.IPs() { - handler.fail2banSrv.FailedAttempt(ip) - } + // for _, ip := range c.IPs() { + // handler.fail2banSrv.FailedAttempt(ip) + // } return RenderError(c, fmt.Errorf("ChangePassword: %w", err), defaultErrMessage) } diff --git a/internal/api/server.go b/internal/api/server.go index d3eda32..ef52c02 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -36,8 +36,8 @@ func (s *RestServer) Start(apiPort, views string) error { }) s.app.Use(limiter.New(limiter.Config{ - Max: 5, - Expiration: 1 * time.Hour, + Max: 8, + Expiration: 30 * time.Minute, LimiterMiddleware: limiter.SlidingWindow{}, }))