]> git.openstreetmap.org Git - rails.git/blob - config/environments/production.rb
Remove version pin for git now danger is updated
[rails.git] / config / environments / production.rb
1 # frozen_string_literal: true
2
3 require "active_support/core_ext/integer/time"
4
5 Rails.application.configure do
6   # Settings specified here will take precedence over those in config/application.rb.
7
8   # Code is not reloaded between requests.
9   config.enable_reloading = false
10
11   # Eager load code on boot for better performance and memory savings (ignored by Rake tasks).
12   config.eager_load = true
13
14   # Full error reports are disabled.
15   config.consider_all_requests_local = false
16
17   # Turn on fragment caching in view templates.
18   config.action_controller.perform_caching = true
19
20   # Do not fall back to assets pipeline if a precompiled asset is missed.
21   config.assets.compile = false
22
23   # Compress JavaScripts using a preprocessor.
24   config.assets.js_compressor = Terser.new
25
26   # Cache assets for far-future expiry since they are all digest stamped.
27   config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
28
29   # Enable serving of images, stylesheets, and JavaScripts from an asset server.
30   # config.asset_host = "http://assets.example.com"
31
32   # Store uploaded files on the local file system (see config/storage.yml for options).
33   config.active_storage.service = :local
34
35   # Assume all access to the app is happening through a SSL-terminating reverse proxy.
36   config.assume_ssl = true
37
38   # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
39   config.force_ssl = true
40
41   # Skip http-to-https redirect for the default health check endpoint.
42   # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
43
44   # Log to STDOUT with the current request id as a default log tag.
45   config.log_tags = [:request_id]
46   config.logger   = if Settings.key?(:log_path)
47                       ActiveSupport::TaggedLogging.logger(Settings.log_path)
48                     else
49                       ActiveSupport::TaggedLogging.logger($stdout)
50                     end
51
52   # Change to "debug" to log everything (including potentially personally-identifiable information!).
53   config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
54
55   # Prevent health checks from clogging up the logs.
56   config.silence_healthcheck_path = "/up"
57
58   # Don't log any deprecations.
59   config.active_support.report_deprecations = false
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   # Configure caching of static assets
68   config.action_controller.page_cache_directory = Rails.public_path
69
70   # Ignore bad email addresses and do not raise email delivery errors.
71   # Set this to true and configure the email server for immediate delivery to raise delivery errors.
72   # config.action_mailer.raise_delivery_errors = false
73
74   # Set host to be used by links generated in mailer templates.
75   config.action_mailer.default_url_options = { :host => "example.com" }
76
77   # Specify outgoing SMTP server. Remember to add smtp/* credentials via bin/rails credentials:edit.
78   # config.action_mailer.smtp_settings = {
79   #   user_name: Rails.application.credentials.dig(:smtp, :user_name),
80   #   password: Rails.application.credentials.dig(:smtp, :password),
81   #   address: "smtp.example.com",
82   #   port: 587,
83   #   authentication: :plain
84   # }
85
86   # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
87   # the I18n.default_locale when a translation cannot be found).
88   config.i18n.fallbacks = true
89
90   # Do not dump schema after migrations.
91   config.active_record.dump_schema_after_migration = false unless Settings.status == "database_offline"
92
93   # Only use :id for inspections in production.
94   config.active_record.attributes_for_inspect = [:id]
95
96   # Enable DNS rebinding protection and other `Host` header attacks.
97   # config.hosts = [
98   #   "example.com",     # Allow requests from example.com
99   #   /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
100   # ]
101   #
102   # Skip DNS rebinding protection for the default health check endpoint.
103   # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
104
105   # Use delayed job to queue jobs in production.
106   config.active_job.queue_adapter = :delayed_job
107 end