mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-20 03:25:17 +01:00
Adding letter opener for development and Rack::Attack for future rate limiting implementations
This commit is contained in:
parent
5d72b92271
commit
e2b846f630
2
Gemfile
2
Gemfile
@ -35,6 +35,7 @@ gem 'htmlentities'
|
|||||||
gem 'onebox'
|
gem 'onebox'
|
||||||
gem 'simple_form'
|
gem 'simple_form'
|
||||||
gem 'will_paginate', '~> 3.0.6'
|
gem 'will_paginate', '~> 3.0.6'
|
||||||
|
gem 'rack-attack'
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem 'rspec-rails'
|
gem 'rspec-rails'
|
||||||
@ -55,6 +56,7 @@ group :development do
|
|||||||
gem 'better_errors'
|
gem 'better_errors'
|
||||||
gem 'binding_of_caller'
|
gem 'binding_of_caller'
|
||||||
gem 'rack-mini-profiler'
|
gem 'rack-mini-profiler'
|
||||||
|
gem 'letter_opener'
|
||||||
end
|
end
|
||||||
|
|
||||||
group :production do
|
group :production do
|
||||||
|
@ -129,6 +129,10 @@ GEM
|
|||||||
railties (>= 4.2.0)
|
railties (>= 4.2.0)
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
json (1.8.3)
|
json (1.8.3)
|
||||||
|
launchy (2.4.3)
|
||||||
|
addressable (~> 2.3)
|
||||||
|
letter_opener (1.4.1)
|
||||||
|
launchy (~> 2.2)
|
||||||
libv8 (3.16.14.13)
|
libv8 (3.16.14.13)
|
||||||
loofah (2.0.3)
|
loofah (2.0.3)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
@ -180,6 +184,8 @@ GEM
|
|||||||
rabl (0.12.0)
|
rabl (0.12.0)
|
||||||
activesupport (>= 2.3.14)
|
activesupport (>= 2.3.14)
|
||||||
rack (1.6.4)
|
rack (1.6.4)
|
||||||
|
rack-attack (4.4.1)
|
||||||
|
rack
|
||||||
rack-mini-profiler (0.9.9.2)
|
rack-mini-profiler (0.9.9.2)
|
||||||
rack (>= 1.2.0)
|
rack (>= 1.2.0)
|
||||||
rack-test (0.6.3)
|
rack-test (0.6.3)
|
||||||
@ -331,6 +337,7 @@ DEPENDENCIES
|
|||||||
http
|
http
|
||||||
jbuilder (~> 2.0)
|
jbuilder (~> 2.0)
|
||||||
jquery-rails
|
jquery-rails
|
||||||
|
letter_opener
|
||||||
nokogiri
|
nokogiri
|
||||||
oj
|
oj
|
||||||
onebox
|
onebox
|
||||||
@ -342,6 +349,7 @@ DEPENDENCIES
|
|||||||
puma
|
puma
|
||||||
quiet_assets
|
quiet_assets
|
||||||
rabl
|
rabl
|
||||||
|
rack-attack
|
||||||
rack-mini-profiler
|
rack-mini-profiler
|
||||||
rails (= 4.2.5.1)
|
rails (= 4.2.5.1)
|
||||||
rails_12factor
|
rails_12factor
|
||||||
|
@ -33,5 +33,7 @@ module Mastodon
|
|||||||
Doorkeeper::AuthorizedApplicationsController.layout 'dashboard'
|
Doorkeeper::AuthorizedApplicationsController.layout 'dashboard'
|
||||||
Doorkeeper::AuthorizationsController.layout 'auth'
|
Doorkeeper::AuthorizationsController.layout 'auth'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
config.middleware.use Rack::Attack
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -38,4 +38,6 @@ Rails.application.configure do
|
|||||||
|
|
||||||
# Raises error for missing translations
|
# Raises error for missing translations
|
||||||
# config.action_view.raise_on_missing_translations = true
|
# config.action_view.raise_on_missing_translations = true
|
||||||
|
|
||||||
|
config.action_mailer.delivery_method = :letter_opener
|
||||||
end
|
end
|
||||||
|
3
config/initializers/rack-attack.rb
Normal file
3
config/initializers/rack-attack.rb
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
class Rack::Attack
|
||||||
|
# TODO
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user