diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2013-09-26 22:40:55 +0200 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2013-09-30 11:10:46 +0200 |
commit | 055b60d4200aeee0eeab762f162c05305e58c41d (patch) | |
tree | 46efa952dcd01e92fa6217bed2b0f990261253f9 /config | |
parent | c562d290eaab16f8e72e7e3e9ff188e172372226 (diff) | |
download | gitlab-ce-055b60d4200aeee0eeab762f162c05305e58c41d.tar.gz |
Add documentation to help section, rack_attack as example
Diffstat (limited to 'config')
-rw-r--r-- | config/application.rb | 4 | ||||
-rw-r--r-- | config/initializers/rack_attack.rb | 3 | ||||
-rw-r--r-- | config/initializers/rack_attack.rb.example | 16 | ||||
-rw-r--r-- | config/routes.rb | 1 |
4 files changed, 19 insertions, 5 deletions
diff --git a/config/application.rb b/config/application.rb index 6ddc87010b3..0ab3597e73c 100644 --- a/config/application.rb +++ b/config/application.rb @@ -78,7 +78,7 @@ module Gitlab # # config.relative_url_root = "/gitlab" - # Enable rack attack middleware - config.middleware.use Rack::Attack + # Uncomment to enable rack attack middleware + # config.middleware.use Rack::Attack end end diff --git a/config/initializers/rack_attack.rb b/config/initializers/rack_attack.rb deleted file mode 100644 index 88e638ba118..00000000000 --- a/config/initializers/rack_attack.rb +++ /dev/null @@ -1,3 +0,0 @@ -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 diff --git a/config/initializers/rack_attack.rb.example b/config/initializers/rack_attack.rb.example new file mode 100644 index 00000000000..76fa7ad282e --- /dev/null +++ b/config/initializers/rack_attack.rb.example @@ -0,0 +1,16 @@ +# To enable rack-attack for your GitLab instance do the following: +# 1. In config/application.rb find and uncomment the following line: +# config.middleware.use Rack::Attack +# 2. Rename this file to rack_attack.rb +# 3. Review the paths_to_be_protected and add any other path you need protecting +# 4. Restart GitLab instance +# + +paths_to_be_protected = [ + "#{Rails.application.config.relative_url_root}/users/password", + "#{Rails.application.config.relative_url_root}/users/sign_in", + "#{Rails.application.config.relative_url_root}/users" +] +Rack::Attack.throttle('protected paths', limit: 6, period: 60.seconds) do |req| + req.ip if paths_to_be_protected.include?(req.path) && req.post? +end diff --git a/config/routes.rb b/config/routes.rb index 2b444c2a296..b6efd44a509 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -39,6 +39,7 @@ Gitlab::Application.routes.draw do get 'help/web_hooks' => 'help#web_hooks' get 'help/workflow' => 'help#workflow' get 'help/shortcuts' + get 'help/security' # # Global snippets |