annotate config/environments/production.rb @ 256:604b69827fb2

Add default public files
author nanaya <me@nanaya.net>
date Sun, 15 Dec 2024 22:48:13 +0900
parents eda83610b65c
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
255
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
9 # Eager load code on boot for better performance and memory savings (ignored by Rake tasks).
0
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
10 config.eager_load = true
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
11
255
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
12 # Full error reports are disabled.
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
13 config.consider_all_requests_local = false
255
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
14
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
15 # Turn on fragment caching in view templates.
0
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
16 config.action_controller.perform_caching = true
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
17
255
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
18 # Cache assets for far-future expiry since they are all digest stamped.
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
19 config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
72
257910c60eb3 Rails 5 \o/
nanaya <me@myconan.net>
parents: 50
diff changeset
20
257910c60eb3 Rails 5 \o/
nanaya <me@myconan.net>
parents: 50
diff changeset
21 # 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
22 # config.asset_host = "http://assets.example.com"
0
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
23
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
24 # Assume all access to the app is happening through a SSL-terminating reverse proxy.
255
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
25 config.assume_ssl = true
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
26
0
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
27 # 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
28 config.force_ssl = true
0
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
29
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
30 # Skip http-to-https redirect for the default health check endpoint.
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
31 # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
32
255
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
33 # Log to STDOUT with the current request id as a default log tag.
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
34 config.log_tags = [ :request_id ]
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
35 config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
0
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
36
255
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
37 # Change to "debug" to log everything (including potentially personally-identifiable information!)
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
38 config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
39
255
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
40 # Prevent health checks from clogging up the logs.
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
41 config.silence_healthcheck_path = "/up"
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
42
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
43 # Don't log any deprecations.
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
44 config.active_support.report_deprecations = false
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
45
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
46 # Replace the default in-process memory cache store with a durable alternative.
0
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
47 # config.cache_store = :mem_cache_store
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
48
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
49 # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
50 # the I18n.default_locale when a translation cannot be found).
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
51 config.i18n.fallbacks = true
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
52
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
53 # Enable DNS rebinding protection and other `Host` header attacks.
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
54 # config.hosts = [
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
55 # "example.com", # Allow requests from example.com
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
56 # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
57 # ]
255
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
58 #
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
59 # Skip DNS rebinding protection for the default health check endpoint.
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
60 # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
0
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
61 end