-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade app configuration to Rails 7.1 #3500
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) | ||
|
||
require "bundler/setup" # Set up gems listed in the Gemfile. | ||
require "bootsnap/setup" | ||
require "bootsnap/setup" # Speed up boot time by caching expensive operations. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment is from Rails. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
# In the development environment your application's code is reloaded any time | ||
# it changes. This slows down response time but is perfect for development | ||
# since you don't have to restart the web server when you make code changes. | ||
config.cache_classes = false | ||
config.enable_reloading = true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rails changed the name of this option and reversed it, so enable_reloading=!cache_classes |
||
|
||
# Do not eager load code on boot. | ||
config.eager_load = false | ||
|
@@ -47,6 +47,9 @@ | |
# Tell Active Support which deprecation messages to disallow. | ||
config.active_support.disallowed_deprecation_warnings = [] | ||
|
||
# Highlight code that enqueued background job in logs. | ||
config.active_job.verbose_enqueue_logs = true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added by Rails. |
||
|
||
# Suppress logger output for asset requests. | ||
config.assets.quiet = true | ||
|
||
|
@@ -56,6 +59,9 @@ | |
# Annotate rendered view with file names. | ||
# config.action_view.annotate_rendered_view_with_filenames = true | ||
|
||
# Raise error when a before_action's only/except options reference missing actions | ||
config.action_controller.raise_on_missing_callback_actions = true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added by Rails. |
||
|
||
# Allow requests for all domains e.g. <app>.dev.gov.uk | ||
config.hosts.clear | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
# Settings specified here will take precedence over those in config/application.rb. | ||
|
||
# Code is not reloaded between requests. | ||
config.cache_classes = true | ||
config.enable_reloading = false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above. |
||
|
||
# Eager load code on boot. This eager loads most of Rails and | ||
# your application in memory, allowing both threaded web servers | ||
|
@@ -44,15 +44,32 @@ | |
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache | ||
# config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX | ||
|
||
# Assume all access to the app is happening through a SSL-terminating reverse proxy. | ||
# Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies. | ||
# config.assume_ssl = true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added by Rails. Commented by default. |
||
|
||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. | ||
# config.force_ssl = true | ||
|
||
# Use a different logger for distributed setups. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved here as it reflects the current default Rails configuration file ordering. |
||
# require "syslog/logger" | ||
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") | ||
|
||
if ENV["RAILS_LOG_TO_STDOUT"].present? | ||
logger = ActiveSupport::Logger.new($stdout) | ||
logger.formatter = config.log_formatter | ||
config.logger = ActiveSupport::TaggedLogging.new(logger) | ||
end | ||
|
||
# Prepend all log lines with the following tags. | ||
config.log_tags = [:request_id] | ||
|
||
# Include generic and useful information about system operation, but avoid logging too much | ||
# information to avoid inadvertent exposure of personally identifiable information (PII). | ||
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", :info) | ||
|
||
# Prepend all log lines with the following tags. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved above as it reflects the default Rails configuration ordering. |
||
config.log_tags = [:request_id] | ||
# Use default logging formatter so that PID and timestamp are not suppressed. | ||
config.log_formatter = ::Logger::Formatter.new | ||
|
||
# Use a different cache store in production. | ||
config.cache_store = :mem_cache_store, nil, { namespace: :collections, compress: true } unless ENV["HEROKU_APP_NAME"] | ||
|
@@ -74,16 +91,11 @@ | |
# Don't log any deprecations. | ||
config.active_support.report_deprecations = false | ||
|
||
# Use default logging formatter so that PID and timestamp are not suppressed. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See comment above. |
||
config.log_formatter = ::Logger::Formatter.new | ||
|
||
# Use a different logger for distributed setups. | ||
# require "syslog/logger" | ||
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") | ||
|
||
if ENV["RAILS_LOG_TO_STDOUT"].present? | ||
logger = ActiveSupport::Logger.new($stdout) | ||
logger.formatter = config.log_formatter | ||
config.logger = ActiveSupport::TaggedLogging.new(logger) | ||
end | ||
# Enable DNS rebinding protection and other `Host` header attacks. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added by Rails, commented by default. |
||
# config.hosts = [ | ||
# "example.com", # Allow requests from example.com | ||
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` | ||
# ] | ||
# Skip DNS rebinding protection for the default health check endpoint. | ||
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } } | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,8 @@ | |
Rails.application.configure do | ||
# Settings specified here will take precedence over those in config/application.rb. | ||
|
||
# Turn false under Spring and add config.action_view.cache_template_loading = true. | ||
config.cache_classes = true | ||
# While tests run files are not watched, reloading is not necessary. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above. |
||
config.enable_reloading = false | ||
|
||
# Eager loading loads your whole application. When running a single test locally, | ||
# this probably isn't necessary. It's a good idea to do in a continuous integration | ||
|
@@ -27,8 +27,8 @@ | |
config.action_controller.perform_caching = false | ||
config.cache_store = :null_store | ||
|
||
# Raise exceptions instead of rendering exception templates. | ||
config.action_dispatch.show_exceptions = false | ||
# Render exception templates for rescuable exceptions and raise for other exceptions. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New Rails default for the test environment. |
||
config.action_dispatch.show_exceptions = :rescuable | ||
|
||
# Disable request forgery protection in test environment. | ||
config.action_controller.allow_forgery_protection = false | ||
|
@@ -54,4 +54,7 @@ | |
|
||
# Annotate rendered view with file names. | ||
# config.action_view.annotate_rendered_view_with_filenames = true | ||
|
||
# Raise error when a before_action's only/except options reference missing actions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above. |
||
config.action_controller.raise_on_missing_callback_actions = true | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
# Be sure to restart your server when you modify this file. | ||
|
||
# Define an application-wide HTTP permissions policy. For further | ||
# information see https://developers.google.com/web/updates/2018/06/feature-policy | ||
# | ||
# Rails.application.config.permissions_policy do |f| | ||
# f.camera :none | ||
# f.gyroscope :none | ||
# f.microphone :none | ||
# f.usb :none | ||
# f.fullscreen :self | ||
# f.payment :self, "https://secure.example.com" | ||
# information see: https://developers.google.com/web/updates/2018/06/feature-policy | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change by Rails. |
||
|
||
# Rails.application.config.permissions_policy do |policy| | ||
# policy.camera :none | ||
# policy.gyroscope :none | ||
# policy.microphone :none | ||
# policy.usb :none | ||
# policy.fullscreen :self | ||
# policy.payment :self, "https://secure.example.com" | ||
# end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change made by Rails