|
6 | 6 | # Settings specified here will take precedence over those in config/application.rb. |
7 | 7 |
|
8 | 8 | # Code is not reloaded between requests. |
9 | | - config.cache_classes = true |
| 9 | + config.enable_reloading = false |
10 | 10 |
|
11 | | - # Eager load code on boot. This eager loads most of Rails and |
12 | | - # your application in memory, allowing both threaded web servers |
13 | | - # and those relying on copy on write to perform better. |
14 | | - # Rake tasks automatically ignore this option for performance. |
| 11 | + # Eager load code on boot for better performance and memory savings (ignored by Rake tasks). |
15 | 12 | config.eager_load = true |
16 | 13 |
|
17 | | - # Full error reports are disabled and caching is turned on. |
18 | | - config.consider_all_requests_local = false |
19 | | - config.action_controller.perform_caching = true |
| 14 | + # Full error reports are disabled. |
| 15 | + config.consider_all_requests_local = false |
20 | 16 |
|
21 | | - # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] |
22 | | - # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). |
23 | | - # config.require_master_key = true |
| 17 | + # Cache assets for far-future expiry since they are all digest stamped. |
| 18 | + config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" } |
24 | 19 |
|
25 | | - # Disable serving static files from the `/public` folder by default since |
26 | | - # Apache or NGINX already handles this. |
27 | | - config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? |
28 | | - |
29 | | - # Specifies the header that your server uses for sending files. |
30 | | - # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache |
31 | | - # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX |
| 20 | + # Enable serving of images, stylesheets, and JavaScripts from an asset server. |
| 21 | + # config.asset_host = "http://assets.example.com" |
32 | 22 |
|
33 | 23 | # Store uploaded files on the local file system (see config/storage.yml for options). |
34 | 24 | config.active_storage.service = :local |
35 | 25 |
|
36 | | - # Mount Action Cable outside main process or domain. |
37 | | - # config.action_cable.mount_path = nil |
38 | | - # config.action_cable.url = "wss://example.com/cable" |
39 | | - # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] |
| 26 | + # Assume all access to the app is happening through a SSL-terminating reverse proxy. |
| 27 | + # config.assume_ssl = true |
40 | 28 |
|
41 | 29 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. |
42 | 30 | # config.force_ssl = true |
43 | 31 |
|
44 | | - # Include generic and useful information about system operation, but avoid logging too much |
45 | | - # information to avoid inadvertent exposure of personally identifiable information (PII). |
46 | | - config.log_level = :info |
| 32 | + # Skip http-to-https redirect for the default health check endpoint. |
| 33 | + # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } } |
47 | 34 |
|
48 | | - # Prepend all log lines with the following tags. |
| 35 | + # Log to STDOUT with the current request id as a default log tag. |
49 | 36 | config.log_tags = [:request_id] |
| 37 | + config.logger = ActiveSupport::TaggedLogging.logger($stdout) |
50 | 38 |
|
51 | | - # Use a different cache store in production. |
52 | | - # config.cache_store = :mem_cache_store |
53 | | - |
54 | | - # Use a real queuing backend for Active Job (and separate queues per environment). |
55 | | - # config.active_job.queue_adapter = :resque |
56 | | - # config.active_job.queue_name_prefix = "local_office_search_api_production" |
57 | | - |
58 | | - config.action_mailer.perform_caching = false |
| 39 | + # Change to "debug" to log everything (including potentially personally-identifiable information!). |
| 40 | + config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") |
59 | 41 |
|
60 | | - # Ignore bad email addresses and do not raise email delivery errors. |
61 | | - # Set this to true and configure the email server for immediate delivery to raise delivery errors. |
62 | | - # config.action_mailer.raise_delivery_errors = false |
63 | | - |
64 | | - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to |
65 | | - # the I18n.default_locale when a translation cannot be found). |
66 | | - config.i18n.fallbacks = true |
| 42 | + # Prevent health checks from clogging up the logs. |
| 43 | + config.silence_healthcheck_path = "/up" |
67 | 44 |
|
68 | 45 | # Don't log any deprecations. |
69 | 46 | config.active_support.report_deprecations = false |
|
81 | 58 | config.logger = ActiveSupport::TaggedLogging.new(logger) |
82 | 59 | end |
83 | 60 |
|
| 61 | + # Replace the default in-process memory cache store with a durable alternative. |
| 62 | + # config.cache_store = :mem_cache_store |
| 63 | + |
| 64 | + # Replace the default in-process and non-durable queuing backend for Active Job. |
| 65 | + # config.active_job.queue_adapter = :resque |
| 66 | + |
| 67 | + # Ignore bad email addresses and do not raise email delivery errors. |
| 68 | + # Set this to true and configure the email server for immediate delivery to raise delivery errors. |
| 69 | + # config.action_mailer.raise_delivery_errors = false |
| 70 | + |
| 71 | + # Set host to be used by links generated in mailer templates. |
| 72 | + config.action_mailer.default_url_options = { host: "example.com" } |
| 73 | + |
| 74 | + # Specify outgoing SMTP server. Remember to add smtp/* credentials via bin/rails credentials:edit. |
| 75 | + # config.action_mailer.smtp_settings = { |
| 76 | + # user_name: Rails.application.credentials.dig(:smtp, :user_name), |
| 77 | + # password: Rails.application.credentials.dig(:smtp, :password), |
| 78 | + # address: "smtp.example.com", |
| 79 | + # port: 587, |
| 80 | + # authentication: :plain |
| 81 | + # } |
| 82 | + |
| 83 | + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to |
| 84 | + # the I18n.default_locale when a translation cannot be found). |
| 85 | + config.i18n.fallbacks = true |
| 86 | + |
84 | 87 | # Do not dump schema after migrations. |
85 | 88 | config.active_record.dump_schema_after_migration = false |
| 89 | + |
| 90 | + # Only use :id for inspections in production. |
| 91 | + config.active_record.attributes_for_inspect = [:id] |
| 92 | + |
| 93 | + # Enable DNS rebinding protection and other `Host` header attacks. |
| 94 | + # config.hosts = [ |
| 95 | + # "example.com", # Allow requests from example.com |
| 96 | + # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` |
| 97 | + # ] |
| 98 | + # |
| 99 | + # Skip DNS rebinding protection for the default health check endpoint. |
| 100 | + # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } |
86 | 101 | end |
0 commit comments