Skip to content

Commit

Permalink
Try allow2ban again
Browse files Browse the repository at this point in the history
Somehow the admin stuff got blocked as well.
  • Loading branch information
ujh committed Jan 26, 2025
1 parent e99fcb3 commit 57483ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/initializers/rack_attack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
end

# Blocklist for misbehaving clients. The IP gets banned for 12 hours after 120 requests in 1 minute.
Rack::Attack.blocklist("blocklist for misbehaving clients") do |request|
Rack::Attack.blocklist("blocklist for misbehaving clients v2") do |request|
Rack::Attack::Allow2Ban.filter(
request.ip,
maxretry: 120,
findtime: 1.minute,
bantime: 12.hour
) { request.ip unless request.path.starts_with?("/admins") }
) { !request.path.starts_with?("/admins") }
end

# Block misbehaving bots
Expand Down

0 comments on commit 57483ec

Please sign in to comment.