|
|
|
@ -4,7 +4,7 @@ Rails.application.configure do
|
|
|
|
|
# Settings specified here will take precedence over those in config/application.rb. |
|
|
|
|
|
|
|
|
|
# Code is not reloaded between requests. |
|
|
|
|
config.cache_classes = true |
|
|
|
|
config.enable_reloading = false |
|
|
|
|
|
|
|
|
|
# Eager load code on boot. This eager loads most of Rails and |
|
|
|
|
# your application in memory, allowing both threaded web servers |
|
|
|
@ -13,15 +13,14 @@ Rails.application.configure do
|
|
|
|
|
config.eager_load = true |
|
|
|
|
|
|
|
|
|
# Full error reports are disabled and caching is turned on. |
|
|
|
|
config.consider_all_requests_local = false |
|
|
|
|
config.consider_all_requests_local = false |
|
|
|
|
config.action_controller.perform_caching = true |
|
|
|
|
|
|
|
|
|
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] |
|
|
|
|
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files). |
|
|
|
|
# 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). |
|
|
|
|
# config.require_master_key = true |
|
|
|
|
|
|
|
|
|
# Disable serving static files from the `/public` folder by default since |
|
|
|
|
# Apache or NGINX already handles this. |
|
|
|
|
# Disable serving static files from `public/`, relying on NGINX/Apache to do so instead. |
|
|
|
|
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? |
|
|
|
|
|
|
|
|
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server. |
|
|
|
@ -34,28 +33,38 @@ Rails.application.configure do
|
|
|
|
|
# Store uploaded files on the local file system (see config/storage.yml for options). |
|
|
|
|
config.active_storage.service = :local |
|
|
|
|
|
|
|
|
|
# Mount Action Cable outside main process or domain. |
|
|
|
|
# config.action_cable.mount_path = nil |
|
|
|
|
# config.action_cable.url = "wss://example.com/cable" |
|
|
|
|
# config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] |
|
|
|
|
# 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 |
|
|
|
|
|
|
|
|
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. |
|
|
|
|
# config.force_ssl = true |
|
|
|
|
config.force_ssl = true |
|
|
|
|
|
|
|
|
|
# Include generic and useful information about system operation, but avoid logging too much |
|
|
|
|
# information to avoid inadvertent exposure of personally identifiable information (PII). |
|
|
|
|
config.log_level = :info |
|
|
|
|
# Skip http-to-https redirect for the default health check endpoint. |
|
|
|
|
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } } |
|
|
|
|
|
|
|
|
|
# Log to STDOUT by default |
|
|
|
|
config.logger = ActiveSupport::Logger.new(STDOUT) |
|
|
|
|
.tap { |logger| logger.formatter = ::Logger::Formatter.new } |
|
|
|
|
.then { |logger| ActiveSupport::TaggedLogging.new(logger) } |
|
|
|
|
|
|
|
|
|
# Prepend all log lines with the following tags. |
|
|
|
|
config.log_tags = [:request_id] |
|
|
|
|
|
|
|
|
|
# "info" includes 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 = :info |
|
|
|
|
|
|
|
|
|
# Use a different cache store in production. |
|
|
|
|
# config.cache_store = :mem_cache_store |
|
|
|
|
|
|
|
|
|
# Use a real queuing backend for Active Job (and separate queues per environment). |
|
|
|
|
# config.active_job.queue_adapter = :resque |
|
|
|
|
# config.active_job.queue_adapter = :resque |
|
|
|
|
# config.active_job.queue_name_prefix = "data_collector_production" |
|
|
|
|
|
|
|
|
|
# Disable caching for Action Mailer templates even if Action Controller |
|
|
|
|
# caching is enabled. |
|
|
|
|
config.action_mailer.perform_caching = false |
|
|
|
|
|
|
|
|
|
config.action_mailer.default_url_options = { host: ENV["APP_HOST"] } |
|
|
|
@ -98,37 +107,16 @@ Rails.application.configure do
|
|
|
|
|
# Do not dump schema after migrations. |
|
|
|
|
config.active_record.dump_schema_after_migration = false |
|
|
|
|
|
|
|
|
|
# Inserts middleware to perform automatic connection switching. |
|
|
|
|
# The `database_selector` hash is used to pass options to the DatabaseSelector |
|
|
|
|
# middleware. The `delay` is used to determine how long to wait after a write |
|
|
|
|
# to send a subsequent read to the primary. |
|
|
|
|
# |
|
|
|
|
# The `database_resolver` class is used by the middleware to determine which |
|
|
|
|
# database is appropriate to use based on the time delay. |
|
|
|
|
# |
|
|
|
|
# The `database_resolver_context` class is used by the middleware to set |
|
|
|
|
# timestamps for the last write to the primary. The resolver uses the context |
|
|
|
|
# class timestamps to determine how long to wait before reading from the |
|
|
|
|
# replica. |
|
|
|
|
# |
|
|
|
|
# By default Rails will store a last write timestamp in the session. The |
|
|
|
|
# DatabaseSelector middleware is designed as such you can define your own |
|
|
|
|
# strategy for connection switching and pass that into the middleware through |
|
|
|
|
# these configuration options. |
|
|
|
|
# config.active_record.database_selector = { delay: 2.seconds } |
|
|
|
|
# config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver |
|
|
|
|
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session |
|
|
|
|
|
|
|
|
|
# Inserts middleware to perform automatic shard swapping. The `shard_selector` hash |
|
|
|
|
# can be used to pass options to the `ShardSelector` middleware. The `lock` option is |
|
|
|
|
# used to determine whether shard swapping should be prohibited for the request. |
|
|
|
|
# |
|
|
|
|
# The `shard_resolver` option is used by the middleware to determine which shard |
|
|
|
|
# to switch to. The application must provide a mechanism for finding the shard name |
|
|
|
|
# in a proc. See guides for an example. |
|
|
|
|
# config.active_record.shard_selector = { lock: true } |
|
|
|
|
# config.active_record.shard_resolver = ->(request) { Tenant.find_by!(host: request.host).shard } |
|
|
|
|
# Only use :id for inspections in production. |
|
|
|
|
config.active_record.attributes_for_inspect = [:id] |
|
|
|
|
|
|
|
|
|
# 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" } } |
|
|
|
|
# see https://discuss.rubyonrails.org/t/cve-2022-32224-possible-rce-escalation-bug-with-serialized-columns-in-active-record/81017 |
|
|
|
|
config.active_record.yaml_column_permitted_classes = [Time, BigDecimal] |
|
|
|
|
|
|
|
|
|