diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/application.rb | 6 | ||||
-rw-r--r-- | config/database.yml | 2 | ||||
-rw-r--r-- | config/environments/production.rb | 7 | ||||
-rw-r--r-- | config/initializers/session_store.rb | 2 | ||||
-rw-r--r-- | config/puma.rb | 8 |
5 files changed, 18 insertions, 7 deletions
diff --git a/config/application.rb b/config/application.rb index d6a3aab15..552f4ec11 100644 --- a/config/application.rb +++ b/config/application.rb @@ -36,5 +36,11 @@ module Mastodon config.to_prepare do Doorkeeper::AuthorizationsController.layout 'auth' end + + config.action_dispatch.default_headers = { + 'X-Frame-Options' => 'DENY', + 'X-Content-Type-Options' => 'nosniff', + 'X-XSS-Protection' => '1; mode=block' + } end end diff --git a/config/database.yml b/config/database.yml index e0df97ad2..52c26f599 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,6 +1,6 @@ default: &default adapter: postgresql - pool: 17 + pool: <%= ENV["DB_POOL"] || ENV['RAILS_MAX_THREADS'] || 5 %> timeout: 5000 encoding: unicode diff --git a/config/environments/production.rb b/config/environments/production.rb index b90505f68..f2071f7a2 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -45,7 +45,12 @@ Rails.application.configure do # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) # Use a different cache store in production. - config.cache_store = :memory_store, { size: 128.megabytes } + config.cache_store = :redis_store, { + host: ENV['REDIS_HOST'] || 'localhost', + port: ENV['REDIS_PORT'] || 6379, + db: 0, + namespace: 'cache' + } # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.action_controller.asset_host = 'http://assets.example.com' diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index 85983d259..ef61543a8 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,3 +1,3 @@ # Be sure to restart your server when you modify this file. -Rails.application.config.session_store :cookie_store, key: '_mastodon_session' +Rails.application.config.session_store :cookie_store, key: '_mastodon_session', secure: (ENV['LOCAL_HTTPS'] == 'true') diff --git a/config/puma.rb b/config/puma.rb index e8212125f..ad2dbfffd 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -30,7 +30,7 @@ workers ENV.fetch("WEB_CONCURRENCY") { 2 } # you need to make sure to reconnect any threads in the `on_worker_boot` # block. # -# preload_app! +preload_app! # The code in the `on_worker_boot` will be called if you are using # clustered mode by specifying a number of `workers`. After each worker @@ -39,9 +39,9 @@ workers ENV.fetch("WEB_CONCURRENCY") { 2 } # or connections that may have been created at application boot, Ruby # cannot share connections between processes. # -# on_worker_boot do -# ActiveRecord::Base.establish_connection if defined?(ActiveRecord) -# end +on_worker_boot do + ActiveRecord::Base.establish_connection if defined?(ActiveRecord) +end # Allow puma to be restarted by `rails restart` command. plugin :tmp_restart |