Skip to content

Commit d037186

Browse files
committed
Exec 'bin/rails app:update' for config/environments/productioin.rb
1 parent dc9e8b0 commit d037186

File tree

1 file changed

+33
-28
lines changed

1 file changed

+33
-28
lines changed

config/environments/production.rb

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Settings specified here will take precedence over those in config/application.rb.
55

66
# Code is not reloaded between requests.
7-
config.cache_classes = true
7+
config.enable_reloading = false
88

99
# Eager load code on boot. This eager loads most of Rails and
1010
# your application in memory, allowing both threaded web servers
@@ -13,29 +13,29 @@
1313
config.eager_load = true
1414

1515
# Full error reports are disabled and caching is turned on.
16-
config.consider_all_requests_local = false
16+
config.consider_all_requests_local = false
1717
config.action_controller.perform_caching = true
1818

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).
2121
# config.require_master_key = true
2222

23-
# Disable serving static files from the `/public` folder by default since
24-
# Apache or NGINX already handles this.
25-
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
23+
# Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
24+
# config.public_file_server.enabled = false
25+
# config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
2626

2727
# Compress CSS using a preprocessor.
2828
# config.assets.css_compressor = :sass
2929

30-
# Do not fallback to assets pipeline if a precompiled asset is missed.
30+
# Do not fall back to assets pipeline if a precompiled asset is missed.
3131
config.assets.compile = false
3232

3333
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
34-
# config.asset_host = 'http://assets.example.com'
34+
# config.asset_host = "http://assets.example.com"
3535

3636
# Specifies the header that your server uses for sending files.
37-
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
38-
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
37+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
38+
# config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
3939

4040
# Store uploaded files on the local file system (see config/storage.yml for options).
4141
config.active_storage.service = :local
@@ -45,21 +45,31 @@
4545
# config.action_cable.url = "wss://example.com/cable"
4646
# config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
4747

48+
# Assume all access to the app is happening through a SSL-terminating reverse proxy.
49+
# Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
50+
config.assume_ssl = true
51+
4852
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
4953
config.force_ssl = true
5054

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 = :debug
55+
# Log to STDOUT by default
56+
config.logger = ActiveSupport::Logger.new(STDOUT)
57+
.tap { |logger| logger.formatter = ::Logger::Formatter.new }
58+
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }
5459

5560
# Prepend all log lines with the following tags.
5661
config.log_tags = [ :request_id ]
5762

63+
# "info" includes generic and useful information about system operation, but avoids logging too much
64+
# information to avoid inadvertent exposure of personally identifiable information (PII). If you
65+
# want to log everything, set the level to "debug".
66+
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
67+
5868
# Use a different cache store in production.
5969
# config.cache_store = :mem_cache_store
6070

6171
# Use a real queuing backend for Active Job (and separate queues per environment).
62-
# config.active_job.queue_adapter = :resque
72+
# config.active_job.queue_adapter = :resque
6373
# config.active_job.queue_name_prefix = "coderdojo_jp_production"
6474

6575
config.action_mailer.perform_caching = false
@@ -75,22 +85,17 @@
7585
# Don't log any deprecations.
7686
config.active_support.report_deprecations = false
7787

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-
9188
# Do not dump schema after migrations.
9289
config.active_record.dump_schema_after_migration = false
9390

91+
# Enable DNS rebinding protection and other `Host` header attacks.
92+
# config.hosts = [
93+
# "example.com", # Allow requests from example.com
94+
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
95+
# ]
96+
# Skip DNS rebinding protection for the default health check endpoint.
97+
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
98+
9499
# Redirect if not in correct domains
95100
config.middleware.use Rack::HostRedirect, {
96101
%w(coderdojo-japan.herokuapp.com www.coderdojo.jp) => 'coderdojo.jp'

0 commit comments

Comments
 (0)