-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bump gitlab-shell to v1.8.0 * Bump gitlab to 6.4.0 * Remove stale nginx config file * Default recipe changes - Update gitlab-shell config to point at /usr/local/bin/redis-cli - Fix permissions on .ssh/authorized_keys - Add rack_attack file - Add precompile assets execute - Add logrotate dependency and configuration
- Loading branch information
1 parent
eeea38c
commit 7b8e1a2
Showing
9 changed files
with
179 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# 1. Rename this file to rack_attack.rb | ||
# 2. Review the paths_to_be_protected and add any other path you need protecting | ||
# | ||
|
||
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}/api/#{API::API.version}/session.json", | ||
"#{Rails.application.config.relative_url_root}/api/#{API::API.version}/session", | ||
"#{Rails.application.config.relative_url_root}/users" | ||
] | ||
|
||
unless Rails.env.test? | ||
Rack::Attack.throttle('protected paths', limit: 10, period: 60.seconds) do |req| | ||
req.ip if paths_to_be_protected.include?(req.path) && req.post? | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.