Skip to content
Snippets Groups Projects
Commit 468ce289 authored by Marin Jankovski's avatar Marin Jankovski Committed by Wes Gurney
Browse files

Enable rack attack and add a throttle.

parent 38c019cd
No related branches found
No related tags found
1 merge request!4954Add support to configure webhook_timeout in gitlab.yaml
This commit is part of merge request !4954. Comments created here will be created in the context of that merge request.
Loading
Loading
@@ -77,5 +77,8 @@ module Gitlab
# 3) In your unicorn.rb: ENV['RAILS_RELATIVE_URL_ROOT']
#
# config.relative_url_root = "/gitlab"
# Enable rack attack middleware
config.middleware.use Rack::Attack
end
end
Rack::Attack.throttle('user logins, registration and password reset', limit: 6, period: 60.seconds) do |req|
req.ip if ["/users/password", "/users/sign_in", "/users"].include?(req.path) && req.post?
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment