about summary refs log tree commit diff
path: root/config
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-03-25 14:12:24 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-03-25 14:12:24 +0100
commite24bfbde1acbef73cd3c58753a572da2bcb59200 (patch)
tree7d05e3b3ad634f63d1e94de6ebfd16f64cfb9789 /config
parent8eeec389c11298ad1be163dd65c5ae79e06867ca (diff)
Fixing FanOutOnWriteService, fixing Sidekiq not having enough DB connections
in the pool, adding a throttle of 60rpm per IP, adding mini profiler, adding
admin status to users
Diffstat (limited to 'config')
-rw-r--r--config/database.yml2
-rw-r--r--config/initializers/rack-attack.rb4
-rw-r--r--config/routes.rb2
3 files changed, 5 insertions, 3 deletions
diff --git a/config/database.yml b/config/database.yml
index 259244e6f..de67804d2 100644
--- a/config/database.yml
+++ b/config/database.yml
@@ -1,6 +1,6 @@
 default: &default
   adapter: postgresql
-  pool: 5
+  pool: 25
   timeout: 5000
   encoding: unicode
 
diff --git a/config/initializers/rack-attack.rb b/config/initializers/rack-attack.rb
index fc2b56c87..15fc6b351 100644
--- a/config/initializers/rack-attack.rb
+++ b/config/initializers/rack-attack.rb
@@ -1,3 +1,5 @@
 class Rack::Attack
-  # TODO
+  throttle('req/ip', limit: 300, period: 5.minutes) do |req|
+    req.ip
+  end
 end
diff --git a/config/routes.rb b/config/routes.rb
index 0dde9f111..e9e662ed0 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,7 +1,7 @@
 require 'sidekiq/web'
 
 Rails.application.routes.draw do
-  authenticate :user do
+  authenticate :user, lambda { |u| u.admin? } do
     mount Sidekiq::Web => '/sidekiq'
   end