Update Rails to version 7.2.2 (#30391)
This commit is contained in:
		@@ -52,8 +52,6 @@ require_relative '../lib/action_dispatch/remote_ip_extensions'
 | 
			
		||||
require_relative '../lib/stoplight/redis_data_store_extensions'
 | 
			
		||||
require_relative '../lib/active_record/database_tasks_extensions'
 | 
			
		||||
require_relative '../lib/active_record/batches'
 | 
			
		||||
require_relative '../lib/active_record/with_recursive'
 | 
			
		||||
require_relative '../lib/arel/union_parenthesizing'
 | 
			
		||||
require_relative '../lib/simple_navigation/item_extensions'
 | 
			
		||||
 | 
			
		||||
Bundler.require(:pam_authentication) if ENV['PAM_ENABLED'] == 'true'
 | 
			
		||||
@@ -61,10 +59,7 @@ Bundler.require(:pam_authentication) if ENV['PAM_ENABLED'] == 'true'
 | 
			
		||||
module Mastodon
 | 
			
		||||
  class Application < Rails::Application
 | 
			
		||||
    # Initialize configuration defaults for originally generated Rails version.
 | 
			
		||||
    config.load_defaults 7.1
 | 
			
		||||
 | 
			
		||||
    # Explicitly set the cache format version to align with Rails version
 | 
			
		||||
    config.active_support.cache_format_version = 7.1
 | 
			
		||||
    config.load_defaults 7.2
 | 
			
		||||
 | 
			
		||||
    # Please, add to the `ignore` list any other `lib` subdirectories that do
 | 
			
		||||
    # not contain `.rb` files, or that should not be reloaded or eager loaded.
 | 
			
		||||
 
 | 
			
		||||
@@ -37,11 +37,6 @@ Rails.application.configure do
 | 
			
		||||
 | 
			
		||||
  config.action_controller.forgery_protection_origin_check = ENV['DISABLE_FORGERY_REQUEST_PROTECTION'].nil?
 | 
			
		||||
 | 
			
		||||
  ActiveSupport::Logger.new($stdout).tap do |logger|
 | 
			
		||||
    logger.formatter = config.log_formatter
 | 
			
		||||
    config.logger = ActiveSupport::TaggedLogging.new(logger)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  # Generate random VAPID keys
 | 
			
		||||
  Webpush.generate_key.tap do |vapid_key|
 | 
			
		||||
    config.x.vapid_private_key = vapid_key.private_key
 | 
			
		||||
@@ -51,6 +46,8 @@ Rails.application.configure do
 | 
			
		||||
  # Don't care if the mailer can't send.
 | 
			
		||||
  config.action_mailer.raise_delivery_errors = false
 | 
			
		||||
 | 
			
		||||
  # Disable caching for Action Mailer templates even if Action Controller
 | 
			
		||||
  # caching is enabled.
 | 
			
		||||
  config.action_mailer.perform_caching = false
 | 
			
		||||
 | 
			
		||||
  # Print deprecation notices to the Rails logger.
 | 
			
		||||
@@ -89,6 +86,9 @@ Rails.application.configure do
 | 
			
		||||
 | 
			
		||||
  # Raise error when a before_action's only/except options reference missing actions.
 | 
			
		||||
  config.action_controller.raise_on_missing_callback_actions = true
 | 
			
		||||
 | 
			
		||||
  # Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
 | 
			
		||||
  config.generators.apply_rubocop_autocorrect_after_generate!
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Redis.raise_deprecations = true
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,6 @@ Rails.application.configure do
 | 
			
		||||
  # Full error reports are disabled and caching is turned on.
 | 
			
		||||
  config.consider_all_requests_local = false
 | 
			
		||||
  config.action_controller.perform_caching = true
 | 
			
		||||
  config.action_controller.asset_host = ENV['CDN_HOST'] if ENV['CDN_HOST'].present?
 | 
			
		||||
 | 
			
		||||
  # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment
 | 
			
		||||
  # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files).
 | 
			
		||||
@@ -26,8 +25,11 @@ Rails.application.configure do
 | 
			
		||||
  # Do not fallback to assets pipeline if a precompiled asset is missed.
 | 
			
		||||
  config.assets.compile = false
 | 
			
		||||
 | 
			
		||||
  # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
 | 
			
		||||
  # config.public_file_server.enabled = false
 | 
			
		||||
 | 
			
		||||
  # Enable serving of images, stylesheets, and JavaScripts from an asset server.
 | 
			
		||||
  # config.asset_host = "http://assets.example.com"
 | 
			
		||||
  config.asset_host = ENV['CDN_HOST'] if ENV['CDN_HOST'].present?
 | 
			
		||||
 | 
			
		||||
  # Specifies the header that your server uses for sending files.
 | 
			
		||||
  config.action_dispatch.x_sendfile_header = ENV['SENDFILE_HEADER'] if ENV['SENDFILE_HEADER'].present?
 | 
			
		||||
@@ -37,6 +39,10 @@ Rails.application.configure do
 | 
			
		||||
  # Allow to specify public IP of reverse proxy if it's needed
 | 
			
		||||
  config.action_dispatch.trusted_proxies = ENV['TRUSTED_PROXY_IP'].split(/(?:\s*,\s*|\s+)/).map { |item| IPAddr.new(item) } if ENV['TRUSTED_PROXY_IP'].present?
 | 
			
		||||
 | 
			
		||||
  # 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
 | 
			
		||||
 | 
			
		||||
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
 | 
			
		||||
  config.force_ssl = true
 | 
			
		||||
  # Skip http-to-https redirect for the default health check endpoint.
 | 
			
		||||
@@ -46,14 +52,19 @@ Rails.application.configure do
 | 
			
		||||
    },
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  # Info include generic and useful information about system operation, but avoids logging too much
 | 
			
		||||
  # information to avoid inadvertent exposure of personally identifiable information (PII). If you
 | 
			
		||||
  # want to log everything, set the level to "debug".
 | 
			
		||||
  config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'info').to_sym
 | 
			
		||||
  # Log to STDOUT by default
 | 
			
		||||
  config.logger = ActiveSupport::Logger.new($stdout)
 | 
			
		||||
                                       .tap  { |logger| logger.formatter = ::Logger::Formatter.new }
 | 
			
		||||
                                       .then { |logger| ActiveSupport::TaggedLogging.new(logger) }
 | 
			
		||||
 | 
			
		||||
  # Prepend all log lines with the following tags.
 | 
			
		||||
  config.log_tags = [:request_id]
 | 
			
		||||
 | 
			
		||||
  # "info" includes generic and useful information about system operation, but avoids logging too much
 | 
			
		||||
  # information to avoid inadvertent exposure of personally identifiable information (PII). If you
 | 
			
		||||
  # want to log everything, set the level to "debug".
 | 
			
		||||
  config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'info')
 | 
			
		||||
 | 
			
		||||
  # Use a different cache store in production.
 | 
			
		||||
  config.cache_store = :redis_cache_store, REDIS_CONFIGURATION.cache
 | 
			
		||||
 | 
			
		||||
@@ -61,6 +72,8 @@ Rails.application.configure do
 | 
			
		||||
  # config.active_job.queue_adapter = :resque
 | 
			
		||||
  # config.active_job.queue_name_prefix = "mastodon_production"
 | 
			
		||||
 | 
			
		||||
  # Disable caching for Action Mailer templates even if Action Controller
 | 
			
		||||
  # caching is enabled.
 | 
			
		||||
  config.action_mailer.perform_caching = false
 | 
			
		||||
 | 
			
		||||
  # Ignore bad email addresses and do not raise email delivery errors.
 | 
			
		||||
@@ -87,18 +100,8 @@ Rails.application.configure do
 | 
			
		||||
    { key: controller.signature_key_id } if controller.respond_to?(:signed_request?) && controller.signed_request?
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  # Use a different logger for distributed setups.
 | 
			
		||||
  # require "syslog/logger"
 | 
			
		||||
  # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
 | 
			
		||||
 | 
			
		||||
  # Log to STDOUT by default
 | 
			
		||||
  config.logger = ActiveSupport::Logger.new($stdout)
 | 
			
		||||
                                       .tap  { |logger| logger.formatter = ::Logger::Formatter.new }
 | 
			
		||||
                                       .then { |logger| ActiveSupport::TaggedLogging.new(logger) }
 | 
			
		||||
 | 
			
		||||
  # Do not dump schema after migrations.
 | 
			
		||||
  config.active_record.dump_schema_after_migration = false
 | 
			
		||||
 | 
			
		||||
  config.action_mailer.perform_caching = false
 | 
			
		||||
 | 
			
		||||
  # E-mails
 | 
			
		||||
 
 | 
			
		||||
@@ -19,8 +19,6 @@ Rails.application.configure do
 | 
			
		||||
  # loading is working properly before deploying your code.
 | 
			
		||||
  config.eager_load = ENV['CI'].present?
 | 
			
		||||
 | 
			
		||||
  config.assets_digest = false
 | 
			
		||||
 | 
			
		||||
  # Show full error reports and disable caching.
 | 
			
		||||
  config.consider_all_requests_local = true
 | 
			
		||||
  config.action_controller.perform_caching = false
 | 
			
		||||
@@ -32,6 +30,8 @@ Rails.application.configure do
 | 
			
		||||
  # Disable request forgery protection in test environment.
 | 
			
		||||
  config.action_controller.allow_forgery_protection = false
 | 
			
		||||
 | 
			
		||||
  # Disable caching for Action Mailer templates even if Action Controller
 | 
			
		||||
  # caching is enabled.
 | 
			
		||||
  config.action_mailer.perform_caching = false
 | 
			
		||||
 | 
			
		||||
  config.action_mailer.default_options = { from: 'notifications@localhost' }
 | 
			
		||||
@@ -41,6 +41,10 @@ Rails.application.configure do
 | 
			
		||||
  # ActionMailer::Base.deliveries array.
 | 
			
		||||
  config.action_mailer.delivery_method = :test
 | 
			
		||||
 | 
			
		||||
  # Unlike controllers, the mailer instance doesn't have any context about the
 | 
			
		||||
  # incoming request so you'll need to provide the :host parameter yourself.
 | 
			
		||||
  config.action_mailer.default_url_options = { host: 'www.example.com' }
 | 
			
		||||
 | 
			
		||||
  # Print deprecation notices to the stderr.
 | 
			
		||||
  config.active_support.deprecation = :stderr
 | 
			
		||||
 | 
			
		||||
@@ -58,7 +62,6 @@ Rails.application.configure do
 | 
			
		||||
  # Raise exceptions for disallowed deprecations.
 | 
			
		||||
  config.active_support.disallowed_deprecation = :raise
 | 
			
		||||
 | 
			
		||||
  config.i18n.default_locale = :en
 | 
			
		||||
  config.i18n.fallbacks = true
 | 
			
		||||
 | 
			
		||||
  # Tell Active Support which deprecation messages to disallow.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user