2
0
mirror of https://github.com/moebooru/moebooru synced 2025-08-22 09:57:31 +00:00

Update to rails 7.2

This commit is contained in:
nanaya 2024-09-01 05:00:14 +09:00
parent 91c0c86675
commit 1cbf8e2e69
11 changed files with 196 additions and 188 deletions

View File

@ -1,6 +1,6 @@
source "https://rubygems.org" source "https://rubygems.org"
gem "rails", "~> 7.1.3" gem "rails", "~> 7.2.1"
gem "sprockets-rails" gem "sprockets-rails"
gem "jsbundling-rails", ">= 1.3.0" gem "jsbundling-rails", ">= 1.3.0"

View File

@ -1,88 +1,84 @@
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
actioncable (7.1.3.4) actioncable (7.2.1)
actionpack (= 7.1.3.4) actionpack (= 7.2.1)
activesupport (= 7.1.3.4) activesupport (= 7.2.1)
nio4r (~> 2.0) nio4r (~> 2.0)
websocket-driver (>= 0.6.1) websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6) zeitwerk (~> 2.6)
actionmailbox (7.1.3.4) actionmailbox (7.2.1)
actionpack (= 7.1.3.4) actionpack (= 7.2.1)
activejob (= 7.1.3.4) activejob (= 7.2.1)
activerecord (= 7.1.3.4) activerecord (= 7.2.1)
activestorage (= 7.1.3.4) activestorage (= 7.2.1)
activesupport (= 7.1.3.4) activesupport (= 7.2.1)
mail (>= 2.7.1) mail (>= 2.8.0)
net-imap actionmailer (7.2.1)
net-pop actionpack (= 7.2.1)
net-smtp actionview (= 7.2.1)
actionmailer (7.1.3.4) activejob (= 7.2.1)
actionpack (= 7.1.3.4) activesupport (= 7.2.1)
actionview (= 7.1.3.4) mail (>= 2.8.0)
activejob (= 7.1.3.4)
activesupport (= 7.1.3.4)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.2) rails-dom-testing (~> 2.2)
actionpack (7.1.3.4) actionpack (7.2.1)
actionview (= 7.1.3.4) actionview (= 7.2.1)
activesupport (= 7.1.3.4) activesupport (= 7.2.1)
nokogiri (>= 1.8.5) nokogiri (>= 1.8.5)
racc racc
rack (>= 2.2.4) rack (>= 2.2.4, < 3.2)
rack-session (>= 1.0.1) rack-session (>= 1.0.1)
rack-test (>= 0.6.3) rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2) rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6) rails-html-sanitizer (~> 1.6)
actiontext (7.1.3.4) useragent (~> 0.16)
actionpack (= 7.1.3.4) actiontext (7.2.1)
activerecord (= 7.1.3.4) actionpack (= 7.2.1)
activestorage (= 7.1.3.4) activerecord (= 7.2.1)
activesupport (= 7.1.3.4) activestorage (= 7.2.1)
activesupport (= 7.2.1)
globalid (>= 0.6.0) globalid (>= 0.6.0)
nokogiri (>= 1.8.5) nokogiri (>= 1.8.5)
actionview (7.1.3.4) actionview (7.2.1)
activesupport (= 7.1.3.4) activesupport (= 7.2.1)
builder (~> 3.1) builder (~> 3.1)
erubi (~> 1.11) erubi (~> 1.11)
rails-dom-testing (~> 2.2) rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6) rails-html-sanitizer (~> 1.6)
activejob (7.1.3.4) activejob (7.2.1)
activesupport (= 7.1.3.4) activesupport (= 7.2.1)
globalid (>= 0.3.6) globalid (>= 0.3.6)
activemodel (7.1.3.4) activemodel (7.2.1)
activesupport (= 7.1.3.4) activesupport (= 7.2.1)
activerecord (7.1.3.4) activerecord (7.2.1)
activemodel (= 7.1.3.4) activemodel (= 7.2.1)
activesupport (= 7.1.3.4) activesupport (= 7.2.1)
timeout (>= 0.4.0) timeout (>= 0.4.0)
activestorage (7.1.3.4) activestorage (7.2.1)
actionpack (= 7.1.3.4) actionpack (= 7.2.1)
activejob (= 7.1.3.4) activejob (= 7.2.1)
activerecord (= 7.1.3.4) activerecord (= 7.2.1)
activesupport (= 7.1.3.4) activesupport (= 7.2.1)
marcel (~> 1.0) marcel (~> 1.0)
activesupport (7.1.3.4) activesupport (7.2.1)
base64 base64
bigdecimal bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5) connection_pool (>= 2.2.5)
drb drb
i18n (>= 1.6, < 2) i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1) minitest (>= 5.1)
mutex_m securerandom (>= 0.3)
tzinfo (~> 2.0) tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.6) addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0) public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2) ast (2.4.2)
base64 (0.2.0) base64 (0.2.0)
bigdecimal (3.1.8) bigdecimal (3.1.8)
builder (3.2.4) builder (3.3.0)
coderay (1.1.3) coderay (1.1.3)
concurrent-ruby (1.3.1) concurrent-ruby (1.3.4)
connection_pool (2.4.1) connection_pool (2.4.1)
crass (1.0.6) crass (1.0.6)
daemons (1.4.1) daemons (1.4.1)
@ -91,7 +87,7 @@ GEM
date (3.3.4) date (3.3.4)
diff-lcs (1.5.1) diff-lcs (1.5.1)
drb (2.2.1) drb (2.2.1)
erubi (1.12.0) erubi (1.13.0)
exception_notification (4.5.0) exception_notification (4.5.0)
actionmailer (>= 5.2, < 8) actionmailer (>= 5.2, < 8)
activesupport (>= 5.2, < 8) activesupport (>= 5.2, < 8)
@ -103,8 +99,8 @@ GEM
i18n-js (3.0.11) i18n-js (3.0.11)
i18n (>= 0.6.6, < 2) i18n (>= 0.6.6, < 2)
io-console (0.7.2) io-console (0.7.2)
irb (1.11.2) irb (1.14.0)
rdoc rdoc (>= 4.0.0)
reline (>= 0.4.2) reline (>= 0.4.2)
jbuilder (2.11.5) jbuilder (2.11.5)
actionview (>= 5.0.0) actionview (>= 5.0.0)
@ -113,6 +109,7 @@ GEM
railties (>= 6.0.0) railties (>= 6.0.0)
json (2.7.1) json (2.7.1)
language_server-protocol (3.17.0.3) language_server-protocol (3.17.0.3)
logger (1.6.0)
loofah (2.22.0) loofah (2.22.0)
crass (~> 1.0.2) crass (~> 1.0.2)
nokogiri (>= 1.12.0) nokogiri (>= 1.12.0)
@ -126,20 +123,19 @@ GEM
mini_magick (4.12.0) mini_magick (4.12.0)
mini_mime (1.1.5) mini_mime (1.1.5)
mini_portile2 (2.8.7) mini_portile2 (2.8.7)
minitest (5.23.1) minitest (5.25.1)
mutex_m (0.2.0) net-imap (0.4.15)
net-imap (0.4.10)
date date
net-protocol net-protocol
net-pop (0.1.2) net-pop (0.1.2)
net-protocol net-protocol
net-protocol (0.2.2) net-protocol (0.2.2)
timeout timeout
net-smtp (0.4.0.1) net-smtp (0.5.0)
net-protocol net-protocol
newrelic_rpm (9.7.1) newrelic_rpm (9.7.1)
nio4r (2.7.0) nio4r (2.7.3)
nokogiri (1.16.5) nokogiri (1.16.7)
mini_portile2 (~> 2.8.2) mini_portile2 (~> 2.8.2)
racc (~> 1.4) racc (~> 1.4)
parallel (1.24.0) parallel (1.24.0)
@ -155,8 +151,8 @@ GEM
public_suffix (5.0.4) public_suffix (5.0.4)
puma (6.4.2) puma (6.4.2)
nio4r (~> 2.0) nio4r (~> 2.0)
racc (1.8.0) racc (1.8.1)
rack (3.0.11) rack (3.1.7)
rack-mini-profiler (3.3.0) rack-mini-profiler (3.3.0)
rack (>= 1.2.0) rack (>= 1.2.0)
rack-session (2.0.0) rack-session (2.0.0)
@ -166,20 +162,20 @@ GEM
rackup (2.1.0) rackup (2.1.0)
rack (>= 3) rack (>= 3)
webrick (~> 1.8) webrick (~> 1.8)
rails (7.1.3.4) rails (7.2.1)
actioncable (= 7.1.3.4) actioncable (= 7.2.1)
actionmailbox (= 7.1.3.4) actionmailbox (= 7.2.1)
actionmailer (= 7.1.3.4) actionmailer (= 7.2.1)
actionpack (= 7.1.3.4) actionpack (= 7.2.1)
actiontext (= 7.1.3.4) actiontext (= 7.2.1)
actionview (= 7.1.3.4) actionview (= 7.2.1)
activejob (= 7.1.3.4) activejob (= 7.2.1)
activemodel (= 7.1.3.4) activemodel (= 7.2.1)
activerecord (= 7.1.3.4) activerecord (= 7.2.1)
activestorage (= 7.1.3.4) activestorage (= 7.2.1)
activesupport (= 7.1.3.4) activesupport (= 7.2.1)
bundler (>= 1.15.0) bundler (>= 1.15.0)
railties (= 7.1.3.4) railties (= 7.2.1)
rails-controller-testing (1.0.5) rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1) actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1)
@ -194,20 +190,20 @@ GEM
rails-i18n (7.0.8) rails-i18n (7.0.8)
i18n (>= 0.7, < 2) i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8) railties (>= 6.0.0, < 8)
railties (7.1.3.4) railties (7.2.1)
actionpack (= 7.1.3.4) actionpack (= 7.2.1)
activesupport (= 7.1.3.4) activesupport (= 7.2.1)
irb irb (~> 1.13)
rackup (>= 1.0.0) rackup (>= 1.0.0)
rake (>= 12.2) rake (>= 12.2)
thor (~> 1.0, >= 1.2.2) thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6) zeitwerk (~> 2.6)
rainbow (3.1.1) rainbow (3.1.1)
rake (13.1.0) rake (13.2.1)
rdoc (6.6.3.1) rdoc (6.7.0)
psych (>= 4.0.0) psych (>= 4.0.0)
regexp_parser (2.9.0) regexp_parser (2.9.0)
reline (0.4.3) reline (0.5.9)
io-console (~> 0.5) io-console (~> 0.5)
rexml (3.2.8) rexml (3.2.8)
strscan (>= 3.0.9) strscan (>= 3.0.9)
@ -241,6 +237,7 @@ GEM
rubocop-performance rubocop-performance
rubocop-rails rubocop-rails
ruby-progressbar (1.13.0) ruby-progressbar (1.13.0)
securerandom (0.3.1)
sitemap_generator (6.3.0) sitemap_generator (6.3.0)
builder (~> 3.0) builder (~> 3.0)
sprockets (4.2.1) sprockets (4.2.1)
@ -250,22 +247,23 @@ GEM
actionpack (>= 5.2) actionpack (>= 5.2)
activesupport (>= 5.2) activesupport (>= 5.2)
sprockets (>= 3.0.0) sprockets (>= 3.0.0)
stringio (3.1.0) stringio (3.1.1)
strscan (3.1.0) strscan (3.1.0)
terser (1.2.0) terser (1.2.0)
execjs (>= 0.3.0, < 3) execjs (>= 0.3.0, < 3)
thor (1.3.1) thor (1.3.2)
timeout (0.4.1) timeout (0.4.1)
tzinfo (2.0.6) tzinfo (2.0.6)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0) unicode-display_width (2.5.0)
useragent (0.16.10)
webrick (1.8.1) webrick (1.8.1)
websocket-driver (0.7.6) websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0) websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5) websocket-extensions (0.1.5)
will-paginate-i18n (0.1.15) will-paginate-i18n (0.1.15)
will_paginate (4.0.0) will_paginate (4.0.0)
zeitwerk (2.6.13) zeitwerk (2.6.17)
PLATFORMS PLATFORMS
ruby ruby
@ -288,7 +286,7 @@ DEPENDENCIES
pry pry
puma puma
rack-mini-profiler rack-mini-profiler
rails (~> 7.1.3) rails (~> 7.2.1)
rails-controller-testing rails-controller-testing
rails-i18n rails-i18n
rubocop-rails-omakase rubocop-rails-omakase

View File

@ -1,8 +1,8 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
require "fileutils" require "fileutils"
# path to your application root.
APP_ROOT = File.expand_path("..", __dir__) APP_ROOT = File.expand_path("..", __dir__)
APP_NAME = "moebooru"
def system!(*args) def system!(*args)
system(*args, exception: true) system(*args, exception: true)
@ -30,4 +30,8 @@ FileUtils.chdir APP_ROOT do
puts "\n== Restarting application server ==" puts "\n== Restarting application server =="
system! "bin/rails restart" system! "bin/rails restart"
# puts "\n== Configuring puma-dev =="
# system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
# system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
end end

View File

@ -1,6 +1,6 @@
require_relative "boot" require_relative "boot"
# To allow setting environment variable ZP_DATABASE_URL instead of DATABASE_URL. # To allow setting environment variable MB_DATABASE_URL instead of DATABASE_URL.
ENV["DATABASE_URL"] = ENV["MB_DATABASE_URL"] if ENV["MB_DATABASE_URL"] ENV["DATABASE_URL"] = ENV["MB_DATABASE_URL"] if ENV["MB_DATABASE_URL"]
ENV["NODE_ENV"] = ENV["RAILS_ENV"] ENV["NODE_ENV"] = ENV["RAILS_ENV"]
@ -8,33 +8,28 @@ require "rails/all"
require_relative "init_config" require_relative "init_config"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*CONFIG["bundler_groups"]) Bundler.require(*CONFIG["bundler_groups"])
module Moebooru module Moebooru
class Application < Rails::Application class Application < Rails::Application
config.load_defaults 7.1 # Initialize configuration defaults for originally generated Rails version.
config.active_record.belongs_to_required_by_default = false config.load_defaults 7.2
# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
# -- all .rb files in that directory are automatically loaded after loading
# the framework and any gems in your application.
# Custom directories with classes and modules you want to be autoloadable. # Please, add to the `ignore` list any other `lib` subdirectories that do
# config.autoload_paths += %W(#{config.root}/extras) # 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])
# Also load files in lib/ in addition to app/. # Configuration for the application, engines, and railties goes here.
config.eager_load_paths << Rails.root.join("lib") #
# These settings can be overridden in specific environments using the files
# in config/environments, which are processed later.
#
# config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
config.i18n.available_locales = CONFIG["available_locales"] config.i18n.available_locales = CONFIG["available_locales"]
config.i18n.default_locale = CONFIG["default_locale"] config.i18n.default_locale = CONFIG["default_locale"]
@ -59,5 +54,7 @@ module Moebooru
config.action_mailer.default_url_options = { host: "#{scheme}#{CONFIG["server_host"]}" } config.action_mailer.default_url_options = { host: "#{scheme}#{CONFIG["server_host"]}" }
config.middleware.delete ActionDispatch::HostAuthorization config.middleware.delete ActionDispatch::HostAuthorization
config.active_record.belongs_to_required_by_default = false
end end
end end

View File

@ -6,7 +6,7 @@ Rails.application.configure do
# In the development environment your application's code is reloaded any time # In the development environment your application's code is reloaded any time
# it changes. This slows down response time but is perfect for development # 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. # since you don't have to restart the web server when you make code changes.
config.cache_classes = false config.enable_reloading = true
# Do not eager load code on boot. # Do not eager load code on boot.
config.eager_load = false config.eager_load = false
@ -14,24 +14,22 @@ Rails.application.configure do
# Show full error reports. # Show full error reports.
config.consider_all_requests_local = true config.consider_all_requests_local = true
# Enable server timing # Enable server timing.
config.server_timing = true config.server_timing = true
# Enable/disable caching. By default caching is disabled. # Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching. # Run rails dev:cache to toggle caching.
# if Rails.root.join("tmp/caching-dev.txt").exist? if Rails.root.join("tmp/caching-dev.txt").exist?
# config.action_controller.perform_caching = true config.action_controller.perform_caching = true
# config.action_controller.enable_fragment_cache_logging = true config.action_controller.enable_fragment_cache_logging = true
# config.cache_store = :memory_store config.cache_store = :memory_store
# config.public_file_server.headers = { config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" }
# "Cache-Control" => "public, max-age=#{2.days.to_i}" else
# } config.action_controller.perform_caching = false
# else
# config.action_controller.perform_caching = false
# config.cache_store = :null_store config.cache_store = :null_store
# end end
# Store uploaded files on the local file system (see config/storage.yml for options). # Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local config.active_storage.service = :local
@ -39,9 +37,11 @@ Rails.application.configure do
# Don't care if the mailer can't send. # Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false 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.perform_caching = false
config.action_mailer.delivery_method = :file # config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
# Print deprecation notices to the Rails logger. # Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log config.active_support.deprecation = :log
@ -58,6 +58,9 @@ Rails.application.configure do
# Highlight code that triggered database queries in logs. # Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = true config.active_record.verbose_query_logs = true
# Highlight code that enqueued background job in logs.
config.active_job.verbose_enqueue_logs = true
# Suppress logger output for asset requests. # Suppress logger output for asset requests.
config.assets.quiet = true config.assets.quiet = true
@ -65,8 +68,14 @@ Rails.application.configure do
# config.i18n.raise_on_missing_translations = true # config.i18n.raise_on_missing_translations = true
# Annotate rendered view with file names. # 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. # Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true # config.action_cable.disable_request_forgery_protection = true
# 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 end

View File

@ -28,7 +28,7 @@ Rails.application.configure do
config.assets.js_compressor = :terser config.assets.js_compressor = :terser
# Do not fallback to assets pipeline if a precompiled asset is missed. # Do not fall back to assets pipeline if a precompiled asset is missed.
config.assets.compile = false config.assets.compile = false
# force manifest resolver even when debug is (globally) enabled # force manifest resolver even when debug is (globally) enabled
@ -56,6 +56,9 @@ Rails.application.configure do
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
config.force_ssl = CONFIG["secure"] config.force_ssl = CONFIG["secure"]
# 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 # Log to STDOUT by default
config.logger = ActiveSupport::Logger.new(STDOUT) config.logger = ActiveSupport::Logger.new(STDOUT)
.tap { |logger| logger.formatter = ::Logger::Formatter.new } .tap { |logger| logger.formatter = ::Logger::Formatter.new }
@ -64,7 +67,7 @@ Rails.application.configure do
# Prepend all log lines with the following tags. # Prepend all log lines with the following tags.
config.log_tags = [ :request_id ] config.log_tags = [ :request_id ]
# Info include generic and useful information about system operation, but avoids logging too much # "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 # information to avoid inadvertent exposure of personally identifiable information (PII). If you
# want to log everything, set the level to "debug". # want to log everything, set the level to "debug".
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
@ -76,6 +79,8 @@ Rails.application.configure do
# config.active_job.queue_adapter = :resque # config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "moebooru_production" # config.active_job.queue_name_prefix = "moebooru_production"
# Disable caching for Action Mailer templates even if Action Controller
# caching is enabled.
config.action_mailer.perform_caching = false config.action_mailer.perform_caching = false
# Ignore bad email addresses and do not raise email delivery errors. # Ignore bad email addresses and do not raise email delivery errors.
@ -103,14 +108,15 @@ Rails.application.configure do
config.action_mailer.delivery_method = :sendmail config.action_mailer.delivery_method = :sendmail
config.middleware.use ExceptionNotification::Rack, config.middleware.use ExceptionNotification::Rack,
ignore_exceptions: %w[ ignore_exceptions: [
ActionController::UnknownHttpMethod "ActionController::UnknownHttpMethod",
ActionController::BadRequest "ActionController::BadRequest",
ActionController::ParameterMissing "ActionController::ParameterMissing",
ActionController::InvalidAuthenticityToken "ActionController::InvalidAuthenticityToken",
ActionDispatch::Http::MimeNegotiation::InvalidType "ActionDispatch::Http::MimeNegotiation::InvalidType",
ActionDispatch::Http::Parameters::ParseError "ActionDispatch::Http::Parameters::ParseError",
] + ExceptionNotifier.ignored_exceptions, *ExceptionNotifier.ignored_exceptions
],
email: { email: {
email_prefix: "[#{CONFIG["app_name"]}] ", email_prefix: "[#{CONFIG["app_name"]}] ",
sender_address: "notifier <#{CONFIG["email_from"]}>", sender_address: "notifier <#{CONFIG["email_from"]}>",

View File

@ -18,10 +18,7 @@ Rails.application.configure do
config.eager_load = ENV["CI"].present? config.eager_load = ENV["CI"].present?
# Configure public file server for tests with Cache-Control for performance. # 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. # Show full error reports and disable caching.
config.consider_all_requests_local = true config.consider_all_requests_local = true
@ -38,6 +35,8 @@ Rails.application.configure do
# Store uploaded files on the local file system in a temporary directory. # Store uploaded files on the local file system in a temporary directory.
config.active_storage.service = :test config.active_storage.service = :test
# Disable caching for Action Mailer templates even if Action Controller
# caching is enabled.
config.action_mailer.perform_caching = false config.action_mailer.perform_caching = false
# Tell Action Mailer not to deliver emails to the real world. # Tell Action Mailer not to deliver emails to the real world.
@ -45,6 +44,10 @@ Rails.application.configure do
# ActionMailer::Base.deliveries array. # ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test 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. # Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr config.active_support.deprecation = :stderr
@ -60,6 +63,6 @@ Rails.application.configure do
# Annotate rendered view with file names. # Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true # 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 config.action_controller.raise_on_missing_callback_actions = true
end end

View File

@ -16,4 +16,4 @@ Rails.application.config.assets.paths << Rails.root.join("node_modules")
# Precompile additional assets. # Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in the app/assets # application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added. # folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css ) # Rails.application.config.assets.precompile += %w[ admin.js admin.css ]

View File

@ -4,5 +4,5 @@
# Use this to limit dissemination of sensitive information. # Use this to limit dissemination of sensitive information.
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
Rails.application.config.filter_parameters += [ Rails.application.config.filter_parameters += [
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
] ]

View File

@ -3,16 +3,20 @@
# Add new inflection rules using the following format. Inflections # Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different # are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default: # locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.plural /^(ox)$/i, "\\1en"
# inflect.singular /^(ox)en/i, "\\1"
# inflect.irregular "person", "people"
# inflect.uncountable %w( fish sheep )
# end
ActiveSupport::Inflector.inflections(:en) do |inflect| ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.plural /^(ox)$/i, "\\1en"
# inflect.singular /^(ox)en/i, "\\1"
# inflect.irregular "person", "people"
# inflect.uncountable %w( fish sheep )
inflect.uncountable %w[ api ] inflect.uncountable %w[ api ]
end end
# These inflection rules are supported but not enabled by default: # These inflection rules are supported but not enabled by default:
# ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.acronym "RESTful"
# end
ActiveSupport::Inflector.inflections(:en) do |inflect| ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.acronym "RESTful"
inflect.acronym "DText" inflect.acronym "DText"
end end

View File

@ -1,47 +1,34 @@
# Puma can serve each request in a thread from an internal thread pool. # This configuration file will be evaluated by Puma. The top-level methods that
# The `threads` method setting takes two numbers a minimum and maximum. # are invoked here are part of Puma's configuration DSL. For more information
# Any libraries that use thread pools should be configured to match # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
# 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. # Puma starts a configurable number of processes (workers) and each process
# serves each request in a thread from an internal thread pool.
# #
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i # 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 threads threads_count, threads_count
# Specifies the `port` that Puma will listen on to receive requests, default is 3000. # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
# port ENV.fetch("PORT", 3000)
port ENV.fetch("PORT") { 3000 }
# Specifies the `environment` that Puma will run in. # Allow puma to be restarted by `bin/rails restart` command.
#
environment ENV.fetch("RAILS_ENV") { "development" }
# Specifies the number of `workers` to boot in clustered mode.
# Workers are forked webserver processes. If using threads and workers together
# the concurrency of the application would be max `threads` * `workers`.
# Workers do not work on JRuby or Windows (both of which do not support
# processes).
#
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
# Use the `preload_app!` method when specifying a `workers` number.
# This directive tells Puma to first boot the application and load code
# before forking the application. This takes advantage of Copy On Write
# process behavior so workers use less memory. If you use this option
# you need to make sure to reconnect any threads in the `on_worker_boot`
# block.
#
# preload_app!
# The code in the `on_worker_boot` will be called if you are using
# clustered mode by specifying a number of `workers`. After each worker
# process is booted this block will be run, if you are using `preload_app!`
# option you will want to use this block to reconnect to any threads
# or connections that may have been created at application boot, Ruby
# cannot share connections between processes.
#
# on_worker_boot do
# ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
# end
# Allow puma to be restarted by `rails restart` command.
plugin :tmp_restart plugin :tmp_restart
# Specify the PID file. Defaults to tmp/pids/server.pid in development.
# In other environments, only set the PID file if requested.
pidfile ENV["PIDFILE"] if ENV["PIDFILE"]