about summary refs log tree commit diff
path: root/config
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-03-12 16:09:46 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-03-12 16:21:53 +0100
commitaab9f57e369c492bad03bcf15411394897314b4d (patch)
treeae8cf704e2b2321993cabf326af82ae0f86b6697 /config
parent447cfef62d74a670ddd600c0240f41746ac2fe0a (diff)
Adding config for puma, dashboard layout, fixing some queries
Diffstat (limited to 'config')
-rw-r--r--config/application.rb5
-rw-r--r--config/initializers/redis.rb2
-rw-r--r--config/puma.rb13
-rw-r--r--config/routes.rb2
4 files changed, 19 insertions, 3 deletions
diff --git a/config/application.rb b/config/application.rb
index 3f23b0a94..e7634854a 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -29,8 +29,9 @@ module Mastodon
     config.autoload_paths += Dir[Rails.root.join('app', 'api', '*')]
 
     config.to_prepare do
-      Doorkeeper::AuthorizationsController.layout 'auth'
-      Doorkeeper::AuthorizedApplicationsController.layout 'auth'
+      Doorkeeper::ApplicationsController.layout           'dashboard'
+      Doorkeeper::AuthorizedApplicationsController.layout 'dashboard'
+      Doorkeeper::AuthorizationsController.layout         'auth'
     end
   end
 end
diff --git a/config/initializers/redis.rb b/config/initializers/redis.rb
index 14f3778c4..a4e4cfc48 100644
--- a/config/initializers/redis.rb
+++ b/config/initializers/redis.rb
@@ -1 +1 @@
-$redis = Redis.new(host: ENV['REDIS_HOST'] || 'localhost', port: ENV['REDIS_PORT'] || 6379)
+$redis = Redis.new(host: ENV['REDIS_HOST'] || 'localhost', port: ENV['REDIS_PORT'] || 6379, driver: :hiredis)
diff --git a/config/puma.rb b/config/puma.rb
new file mode 100644
index 000000000..49f4b974d
--- /dev/null
+++ b/config/puma.rb
@@ -0,0 +1,13 @@
+workers Integer(ENV['WEB_CONCURRENCY'] || 2)
+threads_count = Integer(ENV['MAX_THREADS'] || 5)
+threads threads_count, threads_count
+
+preload_app!
+
+rackup      DefaultRackup
+port        ENV['PORT']     || 3000
+environment ENV['RACK_ENV'] || 'development'
+
+on_worker_boot do
+  ActiveRecord::Base.establish_connection
+end
diff --git a/config/routes.rb b/config/routes.rb
index d63bdf981..70cd20a82 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -49,5 +49,7 @@ Rails.application.routes.draw do
     end
   end
 
+  get '/mentions', to: 'home#mentions', as: :mentions
+
   root 'home#index'
 end