2023-09-14 13:37:09 +00:00
|
|
|
# typed: false
|
|
|
|
|
2022-07-06 14:01:46 +00:00
|
|
|
require "active_support/core_ext/integer/time"
|
|
|
|
|
2018-06-14 15:17:19 +00:00
|
|
|
Rails.application.configure do
|
2013-12-30 22:29:00 +00:00
|
|
|
# Settings specified here will take precedence over those in config/application.rb.
|
2012-06-17 01:15:46 +00:00
|
|
|
|
2013-12-30 22:29:00 +00:00
|
|
|
# Code is not reloaded between requests.
|
2023-12-24 04:41:35 +00:00
|
|
|
config.enable_reloading = false
|
2012-06-17 01:15:46 +00:00
|
|
|
|
2013-12-30 22:29:00 +00:00
|
|
|
# Eager load code on boot. This eager loads most of Rails and
|
2014-12-14 04:47:44 +00:00
|
|
|
# your application in memory, allowing both threaded web servers
|
2013-12-30 22:29:00 +00:00
|
|
|
# and those relying on copy on write to perform better.
|
|
|
|
# Rake tasks automatically ignore this option for performance.
|
|
|
|
config.eager_load = true
|
|
|
|
|
|
|
|
# Full error reports are disabled and caching is turned on.
|
2012-06-17 01:15:46 +00:00
|
|
|
config.consider_all_requests_local = false
|
2023-12-24 04:41:35 +00:00
|
|
|
config.action_controller.perform_caching = true
|
2012-06-17 01:15:46 +00:00
|
|
|
|
2023-12-24 04:41:35 +00:00
|
|
|
# Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment
|
|
|
|
# key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files).
|
2018-06-14 15:17:19 +00:00
|
|
|
# config.require_master_key = true
|
2013-12-30 22:29:00 +00:00
|
|
|
|
2023-12-24 04:41:35 +00:00
|
|
|
# Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
|
2018-06-14 15:17:19 +00:00
|
|
|
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
|
2012-06-17 01:15:46 +00:00
|
|
|
|
2020-08-19 01:24:25 +00:00
|
|
|
# Compress CSS using a preprocessor.
|
2013-12-30 22:29:00 +00:00
|
|
|
# config.assets.css_compressor = :sass
|
2012-06-17 01:15:46 +00:00
|
|
|
|
2013-12-30 22:29:00 +00:00
|
|
|
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
2012-07-08 00:20:57 +00:00
|
|
|
config.assets.compile = false
|
2012-06-17 01:15:46 +00:00
|
|
|
|
2020-06-01 03:21:09 +00:00
|
|
|
# Should default to true, but doesn't...
|
|
|
|
config.assets.digest = true
|
|
|
|
|
2018-06-14 15:17:19 +00:00
|
|
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
2022-07-06 14:01:46 +00:00
|
|
|
# config.asset_host = "http://assets.example.com"
|
2012-06-17 01:15:46 +00:00
|
|
|
|
2023-12-24 04:41:35 +00:00
|
|
|
# I updated sprockets and every page raised 'The asset "application.css" is not present in the
|
|
|
|
# asset pipeline.' And then I turned this on and everything was fine. The asset pipeline continues
|
|
|
|
# to be a fiddly, unreliable mystery.
|
|
|
|
config.assets.unknown_asset_fallback = true
|
|
|
|
|
2013-12-30 22:29:00 +00:00
|
|
|
# Specifies the header that your server uses for sending files.
|
2023-12-24 04:41:35 +00:00
|
|
|
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
|
|
|
|
# config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
|
2012-06-17 01:15:46 +00:00
|
|
|
|
2023-10-04 15:57:25 +00:00
|
|
|
# Force all access to the app over SSL, use Strict-Transport-Security (HSTS), and use secure cookies.
|
2012-07-03 18:35:30 +00:00
|
|
|
config.force_ssl = true
|
2023-10-04 15:57:25 +00:00
|
|
|
# expiration, preload, and subdomains for: https://hstspreload.org/
|
2023-10-04 16:06:23 +00:00
|
|
|
config.ssl_options = {hsts: {expires: 63072000, preload: true, subdomains: true}}
|
2012-06-17 01:15:46 +00:00
|
|
|
|
2023-12-24 04:41:35 +00:00
|
|
|
# Assume all access to the app is happening through a SSL-terminating reverse proxy.
|
|
|
|
# Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
|
|
|
|
config.assume_ssl = true
|
|
|
|
|
2022-07-06 14:01:46 +00:00
|
|
|
# Include generic and useful information about system operation, but avoid logging too much
|
|
|
|
# information to avoid inadvertent exposure of personally identifiable information (PII).
|
2013-12-30 22:29:00 +00:00
|
|
|
config.log_level = :info
|
2024-01-16 19:17:08 +00:00
|
|
|
config.logger = Logger.new("/srv/lobsters/lobsters/log/production.log")
|
2023-12-24 04:41:35 +00:00
|
|
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
|
|
|
.tap { |logger| logger.formatter = ::Logger::Formatter.new }
|
|
|
|
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }
|
2023-09-16 02:18:40 +00:00
|
|
|
|
2013-12-30 22:29:00 +00:00
|
|
|
# Prepend all log lines with the following tags.
|
2018-06-14 15:17:19 +00:00
|
|
|
config.log_tags = [:request_id]
|
2012-06-17 01:15:46 +00:00
|
|
|
|
2023-12-24 04:41:35 +00:00
|
|
|
# Info include generic and useful information about system operation, but avoids logging too much
|
|
|
|
# information to avoid inadvertent exposure of personally identifiable information (PII). If you
|
|
|
|
# want to log everything, set the level to "debug".
|
|
|
|
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
|
|
|
|
|
2013-12-30 22:29:00 +00:00
|
|
|
# Use a different cache store in production.
|
2012-06-17 01:15:46 +00:00
|
|
|
# config.cache_store = :mem_cache_store
|
|
|
|
|
2020-08-19 01:24:25 +00:00
|
|
|
# Use a real queuing backend for Active Job (and separate queues per environment).
|
2023-12-24 04:41:35 +00:00
|
|
|
# config.active_job.queue_adapter = :resque
|
2020-08-19 01:24:25 +00:00
|
|
|
# config.active_job.queue_name_prefix = "lobsters_production"
|
2018-06-14 15:17:19 +00:00
|
|
|
|
|
|
|
config.action_mailer.perform_caching = false
|
2021-07-23 21:32:03 +00:00
|
|
|
config.action_mailer.default_url_options = {
|
|
|
|
host: Rails.application.domain
|
|
|
|
}
|
2012-06-17 01:15:46 +00:00
|
|
|
|
2013-12-30 22:29:00 +00:00
|
|
|
# Ignore bad email addresses and do not raise email delivery errors.
|
|
|
|
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
2018-06-14 15:17:19 +00:00
|
|
|
# config.action_mailer.raise_delivery_errors = false
|
2012-06-17 01:15:46 +00:00
|
|
|
|
|
|
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
2014-12-14 04:47:44 +00:00
|
|
|
# the I18n.default_locale when a translation cannot be found).
|
2012-06-17 01:15:46 +00:00
|
|
|
config.i18n.fallbacks = true
|
|
|
|
|
2022-07-06 14:01:46 +00:00
|
|
|
# Don't log any deprecations.
|
|
|
|
config.active_support.report_deprecations = false
|
2012-06-17 01:15:46 +00:00
|
|
|
|
2014-12-14 04:47:44 +00:00
|
|
|
# Do not dump schema after migrations.
|
|
|
|
config.active_record.dump_schema_after_migration = false
|
2018-05-10 15:09:47 +00:00
|
|
|
|
2020-08-19 01:24:25 +00:00
|
|
|
# cache full pages for logged-out visitors without tag filters
|
2023-10-07 03:28:06 +00:00
|
|
|
config.action_controller.perform_caching = true
|
2023-12-29 00:35:30 +00:00
|
|
|
config.action_controller.page_cache_directory = Rails.public_path.join("cache").to_s
|
2020-08-19 01:24:25 +00:00
|
|
|
|
2023-10-04 15:57:25 +00:00
|
|
|
# why help timing attacks?
|
|
|
|
config.middleware.delete(Rack::Runtime)
|
2023-12-24 04:41:35 +00:00
|
|
|
|
|
|
|
# Enable DNS rebinding protection and other `Host` header attacks.
|
|
|
|
# config.hosts = [
|
|
|
|
# "example.com", # Allow requests from example.com
|
|
|
|
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
|
|
|
|
# ]
|
|
|
|
# Skip DNS rebinding protection for the default health check endpoint.
|
|
|
|
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
|
2012-06-17 01:15:46 +00:00
|
|
|
end
|
2017-03-24 21:20:16 +00:00
|
|
|
|
2020-08-19 01:24:25 +00:00
|
|
|
# disable some excessive logging in production
|
2017-03-24 21:20:16 +00:00
|
|
|
%w[render_template render_partial render_collection].each do |event|
|
|
|
|
ActiveSupport::Notifications.unsubscribe "#{event}.action_view"
|
|
|
|
end
|