fix remove fail2ban

This commit is contained in:
Urko 2023-07-23 11:13:32 +02:00
parent 02c7c97f68
commit bd95dd8ffd
3 changed files with 6 additions and 6 deletions

View File

@ -15,7 +15,7 @@
<h2>Change Password</h2>
<form action="/changePassword" method="post">
<div class="form-field">
<label for="user">User: (without domain)</label>
<label for="user">User:</label>
<input type="text" id="user" name="user" required>
</div>
<div class="form-field">

View File

@ -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)
}

View File

@ -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{},
}))