Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
c562d290
Commit
c562d290
authored
Sep 24, 2013
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable rack attack and add a throttle.
parent
66c7eede
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
config/application.rb
config/application.rb
+3
-0
config/initializers/rack_attack.rb
config/initializers/rack_attack.rb
+3
-0
No files found.
config/application.rb
View file @
c562d290
...
@@ -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
config/initializers/rack_attack.rb
0 → 100644
View file @
c562d290
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment