|
4 | 4 | # Settings specified here will take precedence over those in config/application.rb. |
5 | 5 |
|
6 | 6 | # Code is not reloaded between requests. |
7 | | - config.cache_classes = true |
| 7 | + config.enable_reloading = false |
8 | 8 |
|
9 | 9 | # Eager load code on boot. This eager loads most of Rails and |
10 | 10 | # your application in memory, allowing both threaded web servers |
|
13 | 13 | config.eager_load = true |
14 | 14 |
|
15 | 15 | # Full error reports are disabled and caching is turned on. |
16 | | - config.consider_all_requests_local = false |
| 16 | + config.consider_all_requests_local = false |
17 | 17 | config.action_controller.perform_caching = true |
18 | 18 |
|
19 | | - # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] |
20 | | - # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). |
| 19 | + # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment |
| 20 | + # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files). |
21 | 21 | # config.require_master_key = true |
22 | 22 |
|
23 | | - # Disable serving static files from the `/public` folder by default since |
24 | | - # Apache or NGINX already handles this. |
| 23 | + # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead. |
25 | 24 | config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? |
26 | 25 |
|
27 | 26 | # Compress CSS using a preprocessor. |
28 | 27 | # config.assets.css_compressor = :sass |
29 | 28 |
|
30 | | - # Do not fallback to assets pipeline if a precompiled asset is missed. |
| 29 | + # Do not fall back to assets pipeline if a precompiled asset is missed. |
31 | 30 | config.assets.compile = false |
32 | 31 |
|
33 | 32 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. |
|
45 | 44 | # config.action_cable.url = "wss://example.com/cable" |
46 | 45 | # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] |
47 | 46 |
|
| 47 | + # Assume all access to the app is happening through a SSL-terminating reverse proxy. |
| 48 | + # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies. |
| 49 | + # config.assume_ssl = true |
| 50 | + |
48 | 51 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. |
49 | | - # config.force_ssl = true |
| 52 | + config.force_ssl = true |
50 | 53 |
|
51 | | - # Include generic and useful information about system operation, but avoid logging too much |
52 | | - # information to avoid inadvertent exposure of personally identifiable information (PII). |
53 | | - config.log_level = :info |
| 54 | + # Log to STDOUT by default |
| 55 | + config.logger = ActiveSupport::Logger.new(STDOUT) |
| 56 | + .tap { |logger| logger.formatter = ::Logger::Formatter.new } |
| 57 | + .then { |logger| ActiveSupport::TaggedLogging.new(logger) } |
54 | 58 |
|
55 | 59 | # Prepend all log lines with the following tags. |
56 | 60 | config.log_tags = [ :request_id ] |
57 | 61 |
|
| 62 | + # "info" includes generic and useful information about system operation, but avoids logging too much |
| 63 | + # information to avoid inadvertent exposure of personally identifiable information (PII). If you |
| 64 | + # want to log everything, set the level to "debug". |
| 65 | + config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") |
| 66 | + |
58 | 67 | # Use a different cache store in production. |
59 | 68 | # config.cache_store = :mem_cache_store |
60 | 69 |
|
61 | 70 | # Use a real queuing backend for Active Job (and separate queues per environment). |
62 | | - # config.active_job.queue_adapter = :resque |
| 71 | + # config.active_job.queue_adapter = :resque |
63 | 72 | # config.active_job.queue_name_prefix = "timdex_ui_production" |
64 | 73 |
|
65 | 74 | config.action_mailer.perform_caching = false |
|
75 | 84 | # Don't log any deprecations. |
76 | 85 | config.active_support.report_deprecations = false |
77 | 86 |
|
78 | | - # Use default logging formatter so that PID and timestamp are not suppressed. |
79 | | - config.log_formatter = ::Logger::Formatter.new |
80 | | - |
81 | | - # Use a different logger for distributed setups. |
82 | | - # require "syslog/logger" |
83 | | - # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") |
84 | | - |
85 | | - if ENV["RAILS_LOG_TO_STDOUT"].present? |
86 | | - logger = ActiveSupport::Logger.new(STDOUT) |
87 | | - logger.formatter = config.log_formatter |
88 | | - config.logger = ActiveSupport::TaggedLogging.new(logger) |
89 | | - end |
90 | | - |
91 | 87 | # Do not dump schema after migrations. |
92 | 88 | config.active_record.dump_schema_after_migration = false |
| 89 | + |
| 90 | + # Enable DNS rebinding protection and other `Host` header attacks. |
| 91 | + # config.hosts = [ |
| 92 | + # "example.com", # Allow requests from example.com |
| 93 | + # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` |
| 94 | + # ] |
| 95 | + # Skip DNS rebinding protection for the default health check endpoint. |
| 96 | + # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } |
93 | 97 | end |
0 commit comments