Commit c562d290 authored by Marin Jankovski's avatar Marin Jankovski

Enable rack attack and add a throttle.

parent 66c7eede
...@@ -77,5 +77,8 @@ module Gitlab ...@@ -77,5 +77,8 @@ module Gitlab
# 3) In your unicorn.rb: ENV['RAILS_RELATIVE_URL_ROOT'] # 3) In your unicorn.rb: ENV['RAILS_RELATIVE_URL_ROOT']
# #
# config.relative_url_root = "/gitlab" # config.relative_url_root = "/gitlab"
# Enable rack attack middleware
config.middleware.use Rack::Attack
end end
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment