annotate config/environments/production.rb @ 254:89f6c0016bab default tip

Update to latest rails
author nanaya <me@nanaya.net>
date Tue, 03 Sep 2024 19:21:25 +0900
parents ad6264cca788
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
214
2335107f35d0 Run rails update
nanaya <me@nanaya.pro>
parents: 205
diff changeset
1 require "active_support/core_ext/integer/time"
2335107f35d0 Run rails update
nanaya <me@nanaya.pro>
parents: 205
diff changeset
2
0
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
3 Rails.application.configure do
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
4 # Settings specified here will take precedence over those in config/application.rb.
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
5
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
6 # Code is not reloaded between requests.
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
7 config.enable_reloading = false
0
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
8
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
9 # Eager load code on boot. This eager loads most of Rails and
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
10 # your application in memory, allowing both threaded web servers
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
11 # and those relying on copy on write to perform better.
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
12 # Rake tasks automatically ignore this option for performance.
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
13 config.eager_load = true
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
14
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
15 # Full error reports are disabled and caching is turned on.
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
16 config.consider_all_requests_local = false
0
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
17 config.action_controller.perform_caching = true
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
18
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
19 # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
20 # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files).
185
f67f3ad50270 Update to latest rails and gems
nanaya <me@nanaya.pro>
parents: 89
diff changeset
21 # config.require_master_key = true
f67f3ad50270 Update to latest rails and gems
nanaya <me@nanaya.pro>
parents: 89
diff changeset
22
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
23 # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
24 # config.public_file_server.enabled = false
72
257910c60eb3 Rails 5 \o/
nanaya <me@myconan.net>
parents: 50
diff changeset
25
257910c60eb3 Rails 5 \o/
nanaya <me@myconan.net>
parents: 50
diff changeset
26 # Enable serving of images, stylesheets, and JavaScripts from an asset server.
223
ad6264cca788 Update to rails 7
nanaya <me@nanaya.pro>
parents: 214
diff changeset
27 # config.asset_host = "http://assets.example.com"
0
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
28
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
29 # Specifies the header that your server uses for sending files.
223
ad6264cca788 Update to rails 7
nanaya <me@nanaya.pro>
parents: 214
diff changeset
30 # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
ad6264cca788 Update to rails 7
nanaya <me@nanaya.pro>
parents: 214
diff changeset
31 # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
72
257910c60eb3 Rails 5 \o/
nanaya <me@myconan.net>
parents: 50
diff changeset
32
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
33 # Assume all access to the app is happening through a SSL-terminating reverse proxy.
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
34 # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
35 # config.assume_ssl = true
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
36
0
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
37 # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
38 config.force_ssl = true
0
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
39
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
40 # Skip http-to-https redirect for the default health check endpoint.
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
41 # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
42
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
43 # Log to STDOUT by default
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
44 config.logger = ActiveSupport::Logger.new(STDOUT)
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
45 .tap { |logger| logger.formatter = ::Logger::Formatter.new }
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
46 .then { |logger| ActiveSupport::TaggedLogging.new(logger) }
0
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
47
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
48 # Prepend all log lines with the following tags.
214
2335107f35d0 Run rails update
nanaya <me@nanaya.pro>
parents: 205
diff changeset
49 config.log_tags = [ :request_id ]
0
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
50
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
51 # "info" includes generic and useful information about system operation, but avoids logging too much
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
52 # information to avoid inadvertent exposure of personally identifiable information (PII). If you
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
53 # want to log everything, set the level to "debug".
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
54 config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
55
0
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
56 # Use a different cache store in production.
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
57 # config.cache_store = :mem_cache_store
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
58
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
59 # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
60 # the I18n.default_locale when a translation cannot be found).
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
61 config.i18n.fallbacks = true
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
62
223
ad6264cca788 Update to rails 7
nanaya <me@nanaya.pro>
parents: 214
diff changeset
63 # Don't log any deprecations.
ad6264cca788 Update to rails 7
nanaya <me@nanaya.pro>
parents: 214
diff changeset
64 config.active_support.report_deprecations = false
214
2335107f35d0 Run rails update
nanaya <me@nanaya.pro>
parents: 205
diff changeset
65
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
66 # Enable DNS rebinding protection and other `Host` header attacks.
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
67 # config.hosts = [
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
68 # "example.com", # Allow requests from example.com
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
69 # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
70 # ]
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
71 # Skip DNS rebinding protection for the default health check endpoint.
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
72 # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
0
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
73 end