Upgrade to rails 7.2.0
This commit is contained in:
@@ -9,12 +9,12 @@ Bundler.require(*Rails.groups)
|
||||
module Fabitapp
|
||||
class Application < Rails::Application
|
||||
# Initialize configuration defaults for originally generated Rails version.
|
||||
config.load_defaults 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.
|
||||
# Common ones are `templates`, `generators`, or `middleware`, for example.
|
||||
config.autoload_lib(ignore: %w(assets tasks))
|
||||
config.autoload_lib(ignore: %w[assets tasks])
|
||||
|
||||
# Configuration for the application, engines, and railties goes here.
|
||||
#
|
||||
|
||||
@@ -1 +1 @@
|
||||
E+WLIEWMPCNeAB6xBXcgWV8aH8gF8XBF1jhTN4m45Skch0dYgSD+xNkOS/038f2O2Y2WumPATxHtdZgD6ImV9fAniOBTVRQCPELsyuHUB4Wm9A44lF2u1NOhZvhtmQXVw2vRMsIhySbXPFmF0mbvCumBjPlwQ+jHldhgObToV3YV7f90GN7hb8InbxRvvZMx9K8PsLI6gaoU/cMsaKNVLaYHjKQ7wA7MXiMtArYlgDehILn/p3O3rsCw2JwpO/Nq+Q/Bvt2UcLpBsWZiT2dQJkMOR1kuxAkr3jKfQjWpZ4HJKZW4jvMxwTX/HFS9I0jL0QoQW31uHYLMUe+33M4j/N+rJ/NHCedHHXmE7ryGEGY3ta5KJ8kqouU56/Gw1dzURKwZDhqO4McihenzJmUPtpCEnfnC--b0DNmWjm4Ga91Ed2--2wWZLY37CAUShJt3JBmItg==
|
||||
+K7g0wUIAlSH7kpLPJCodrxgt29gHefxvH56etsYXsv7dmORAjpr8VPjuFoYRkTUpGdJAxH/lJGtNNPzE81YMOhZHJFYdwc4q4ZpwtsmnjAqWo2l13zveUyclFXO4yX7myfZ1yp6QGUzxc/Aa1R4nU/zZ++wqISrCSt8HPxj7/F3f/VjvsU+mgoVVMdlFu5WgVEn69cKZQkPqbm/ScjLP/3/pnyNr5+7oiwqYtcwZH+6QNqOaavJHhhyx8MIqNn5VPEn3POJu1BA6KNO3RiPs7nvAMjrwpYc0IdgqLpZrBSPYi64F+ENs86RhpgfuELWFD0SLvxUn13HXH6bzlyDNMDhN7tUjJ6VV9GVRP7Gw/IvUR10ILSJH0KDgK9ZgkRPT31syXeWPI2HTPqU54I0c8i+Dw8h--HD8iJUEswUS1fHZP--UWrSs7H3ua1P7jOaNCVV1w==
|
||||
@@ -20,6 +20,13 @@ test:
|
||||
<<: *default
|
||||
database: storage/test.sqlite3
|
||||
|
||||
|
||||
# SQLite3 write its data on the local filesystem, as such it requires
|
||||
# persistent disks. If you are deploying to a managed service, you should
|
||||
# make sure it provides disk persistence, as many don't.
|
||||
#
|
||||
# Similarly, if you deploy your application as a Docker container, you must
|
||||
# ensure the database is located in a persisted volume.
|
||||
production:
|
||||
<<: *default
|
||||
database: storage/production.sqlite3
|
||||
|
||||
@@ -14,7 +14,7 @@ Rails.application.configure do
|
||||
# Show full error reports.
|
||||
config.consider_all_requests_local = true
|
||||
|
||||
# Enable server timing
|
||||
# Enable server timing.
|
||||
config.server_timing = true
|
||||
|
||||
# Enable/disable caching. By default caching is disabled.
|
||||
@@ -24,9 +24,7 @@ Rails.application.configure do
|
||||
config.action_controller.enable_fragment_cache_logging = true
|
||||
|
||||
config.cache_store = :memory_store
|
||||
config.public_file_server.headers = {
|
||||
"Cache-Control" => "public, max-age=#{2.days.to_i}"
|
||||
}
|
||||
config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" }
|
||||
else
|
||||
config.action_controller.perform_caching = false
|
||||
|
||||
@@ -39,8 +37,12 @@ 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
|
||||
|
||||
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
|
||||
|
||||
# Print deprecation notices to the Rails logger.
|
||||
config.active_support.deprecation = :log
|
||||
|
||||
@@ -66,11 +68,14 @@ Rails.application.configure do
|
||||
# config.i18n.raise_on_missing_translations = true
|
||||
|
||||
# Annotate rendered view with file names.
|
||||
# config.action_view.annotate_rendered_view_with_filenames = true
|
||||
config.action_view.annotate_rendered_view_with_filenames = true
|
||||
|
||||
# Uncomment if you wish to allow Action Cable access from any origin.
|
||||
# config.action_cable.disable_request_forgery_protection = true
|
||||
|
||||
# Raise error when a before_action's only/except options reference missing actions
|
||||
# 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
|
||||
|
||||
@@ -51,6 +51,9 @@ Rails.application.configure do
|
||||
# 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.
|
||||
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
|
||||
|
||||
# Log to STDOUT by default
|
||||
config.logger = ActiveSupport::Logger.new(STDOUT)
|
||||
.tap { |logger| logger.formatter = ::Logger::Formatter.new }
|
||||
@@ -71,6 +74,8 @@ Rails.application.configure do
|
||||
# config.active_job.queue_adapter = :resque
|
||||
# config.active_job.queue_name_prefix = "fabitapp_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.
|
||||
|
||||
@@ -18,10 +18,7 @@ Rails.application.configure do
|
||||
config.eager_load = ENV["CI"].present?
|
||||
|
||||
# Configure public file server for tests with Cache-Control for performance.
|
||||
config.public_file_server.enabled = true
|
||||
config.public_file_server.headers = {
|
||||
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
|
||||
}
|
||||
config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{1.hour.to_i}" }
|
||||
|
||||
# Show full error reports and disable caching.
|
||||
config.consider_all_requests_local = true
|
||||
@@ -37,6 +34,8 @@ Rails.application.configure do
|
||||
# Store uploaded files on the local file system in a temporary directory.
|
||||
config.active_storage.service = :test
|
||||
|
||||
# Disable caching for Action Mailer templates even if Action Controller
|
||||
# caching is enabled.
|
||||
config.action_mailer.perform_caching = false
|
||||
|
||||
# Tell Action Mailer not to deliver emails to the real world.
|
||||
@@ -44,6 +43,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
|
||||
|
||||
@@ -59,6 +62,6 @@ Rails.application.configure do
|
||||
# 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
|
||||
# Raise error when a before_action's only/except options reference missing actions.
|
||||
config.action_controller.raise_on_missing_callback_actions = true
|
||||
end
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
# Use this to limit dissemination of sensitive information.
|
||||
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
|
||||
Rails.application.config.filter_parameters += [
|
||||
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
|
||||
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
|
||||
]
|
||||
|
||||
@@ -2,34 +2,32 @@
|
||||
# are invoked here are part of Puma's configuration DSL. For more information
|
||||
# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
|
||||
|
||||
# Puma can serve each request in a thread from an internal thread pool.
|
||||
# The `threads` method setting takes two numbers: a minimum and maximum.
|
||||
# Any libraries that use thread pools should be configured to match
|
||||
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
||||
# and maximum; this matches the default thread size of Active Record.
|
||||
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
|
||||
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
|
||||
threads min_threads_count, max_threads_count
|
||||
|
||||
# Specifies that the worker count should equal the number of processors in production.
|
||||
if ENV["RAILS_ENV"] == "production"
|
||||
require "concurrent-ruby"
|
||||
worker_count = Integer(ENV.fetch("WEB_CONCURRENCY") { Concurrent.physical_processor_count })
|
||||
workers worker_count if worker_count > 1
|
||||
end
|
||||
|
||||
# Specifies the `worker_timeout` threshold that Puma will use to wait before
|
||||
# terminating a worker in development environments.
|
||||
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
|
||||
# Puma starts a configurable number of processes (workers) and each process
|
||||
# serves each request in a thread from an internal thread pool.
|
||||
#
|
||||
# The ideal number of threads per worker depends both on how much time the
|
||||
# application spends waiting for IO operations and on how much you wish to
|
||||
# to prioritize throughput over latency.
|
||||
#
|
||||
# As a rule of thumb, increasing the number of threads will increase how much
|
||||
# traffic a given process can handle (throughput), but due to CRuby's
|
||||
# Global VM Lock (GVL) it has diminishing returns and will degrade the
|
||||
# response time (latency) of the application.
|
||||
#
|
||||
# The default is set to 3 threads as it's deemed a decent compromise between
|
||||
# throughput and latency for the average Rails application.
|
||||
#
|
||||
# Any libraries that use a connection pool or another resource pool should
|
||||
# be configured to provide at least as many connections as the number of
|
||||
# threads. This includes Active Record's `pool` parameter in `database.yml`.
|
||||
threads_count = ENV.fetch("RAILS_MAX_THREADS", 3)
|
||||
threads threads_count, threads_count
|
||||
|
||||
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
||||
port ENV.fetch("PORT") { 3000 }
|
||||
|
||||
# Specifies the `environment` that Puma will run in.
|
||||
environment ENV.fetch("RAILS_ENV") { "development" }
|
||||
|
||||
# Specifies the `pidfile` that Puma will use.
|
||||
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
|
||||
port ENV.fetch("PORT", 3000)
|
||||
|
||||
# Allow puma to be restarted by `bin/rails restart` command.
|
||||
plugin :tmp_restart
|
||||
|
||||
# Only use a pidfile when requested
|
||||
pidfile ENV["PIDFILE"] if ENV["PIDFILE"]
|
||||
|
||||
@@ -5,6 +5,10 @@ Rails.application.routes.draw do
|
||||
# Can be used by load balancers and uptime monitors to verify that the app is live.
|
||||
get "up" => "rails/health#show", as: :rails_health_check
|
||||
|
||||
# Render dynamic PWA files from app/views/pwa/*
|
||||
get "service-worker" => "rails/pwa#service_worker", as: :pwa_service_worker
|
||||
get "manifest" => "rails/pwa#manifest", as: :pwa_manifest
|
||||
|
||||
# Defines the root path route ("/")
|
||||
# root "posts#index"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user