annotate config/environments/production.rb @ 496:eadd0a3b9921

Update gems
author nanaya <me@nanaya.net>
date Sun, 15 Dec 2024 22:18:31 +0900
parents 92929378413e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
481
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
1 require "active_support/core_ext/integer/time"
88fd5722fcb3 Update defaults
nanaya <me@nanaya.pro>
parents: 467
diff changeset
2
431
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 363
diff changeset
3 Rails.application.configure do
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
4 # Settings specified here will take precedence over those in config/application.rb.
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
5
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
6 # Code is not reloaded between requests.
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
7 config.enable_reloading = false
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
8
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
9 # Eager load code on boot for better performance and memory savings (ignored by Rake tasks).
202
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
10 config.eager_load = true
d4cf49db9c49 ...copypasta the whole environments from clean 4.0
Edho Arief <edho@myconan.net>
parents: 198
diff changeset
11
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
12 # Full error reports are disabled.
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
13 config.consider_all_requests_local = false
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
14
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
15 # Turn on fragment caching in view templates.
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
16 config.action_controller.perform_caching = true
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
17
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
18 # Cache assets for far-future expiry since they are all digest stamped.
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
19 config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
20
431
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 363
diff changeset
21 # Enable serving of images, stylesheets, and JavaScripts from an asset server.
485
6cac8fcf8164 Update to rails 7 (and ruby 3.1)
nanaya <me@nanaya.pro>
parents: 481
diff changeset
22 # config.asset_host = "http://assets.example.com"
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
23
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
24 # Assume all access to the app is happening through a SSL-terminating reverse proxy.
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
25 config.assume_ssl = true
431
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 363
diff changeset
26
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
27 # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
28 config.force_ssl = true
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
29
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
30 # Skip http-to-https redirect for the default health check endpoint.
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
31 # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
32
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
33 # Log to STDOUT with the current request id as a default log tag.
467
fd3078b4d355 Update to latest rails
nanaya <me@nanaya.pro>
parents: 437
diff changeset
34 config.log_tags = [ :request_id ]
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
35 config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
36
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
37 # Change to "debug" to log everything (including potentially personally-identifiable information!)
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
38 config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
39
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
40 # Prevent health checks from clogging up the logs.
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
41 config.silence_healthcheck_path = "/up"
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
42
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
43 # Don't log any deprecations.
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
44 config.active_support.report_deprecations = false
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
45
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
46 # Replace the default in-process memory cache store with a durable alternative.
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
47 # config.cache_store = :mem_cache_store
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
48
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
49 # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
431
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 363
diff changeset
50 # the I18n.default_locale when a translation cannot be found).
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
51 config.i18n.fallbacks = true
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
52
431
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 363
diff changeset
53 # Do not dump schema after migrations.
68eb23b52864 Rails 5 \o/
nanaya <me@myconan.net>
parents: 363
diff changeset
54 config.active_record.dump_schema_after_migration = false
495
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
55
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
56 # Only use :id for inspections in production.
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
57 config.active_record.attributes_for_inspect = [ :id ]
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
58
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
59 # Enable DNS rebinding protection and other `Host` header attacks.
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
60 # config.hosts = [
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
61 # "example.com", # Allow requests from example.com
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
62 # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
63 # ]
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
64 #
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
65 # Skip DNS rebinding protection for the default health check endpoint.
92929378413e Update to latest rails
nanaya <me@nanaya.net>
parents: 485
diff changeset
66 # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
67 end