The server cannot process the request due to a client error. Please check the request and try again. If you’re the application owner check the logs for more information.
+diff --git a/Gemfile b/Gemfile index 70e41ea..4c9b910 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby "3.4.6" -gem "rails", "~> 7.2.0" +gem "rails", "~> 8.0.0" gem "bootsnap", require: false gem "pg" diff --git a/Gemfile.lock b/Gemfile.lock index 23825ed..86f11cc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,66 +1,65 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.2.2.2) - actionpack (= 7.2.2.2) - activesupport (= 7.2.2.2) + actioncable (8.0.3) + actionpack (= 8.0.3) + activesupport (= 8.0.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.2.2.2) - actionpack (= 7.2.2.2) - activejob (= 7.2.2.2) - activerecord (= 7.2.2.2) - activestorage (= 7.2.2.2) - activesupport (= 7.2.2.2) + actionmailbox (8.0.3) + actionpack (= 8.0.3) + activejob (= 8.0.3) + activerecord (= 8.0.3) + activestorage (= 8.0.3) + activesupport (= 8.0.3) mail (>= 2.8.0) - actionmailer (7.2.2.2) - actionpack (= 7.2.2.2) - actionview (= 7.2.2.2) - activejob (= 7.2.2.2) - activesupport (= 7.2.2.2) + actionmailer (8.0.3) + actionpack (= 8.0.3) + actionview (= 8.0.3) + activejob (= 8.0.3) + activesupport (= 8.0.3) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.2.2.2) - actionview (= 7.2.2.2) - activesupport (= 7.2.2.2) + actionpack (8.0.3) + actionview (= 8.0.3) + activesupport (= 8.0.3) nokogiri (>= 1.8.5) - racc - rack (>= 2.2.4, < 3.2) + rack (>= 2.2.4) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actiontext (7.2.2.2) - actionpack (= 7.2.2.2) - activerecord (= 7.2.2.2) - activestorage (= 7.2.2.2) - activesupport (= 7.2.2.2) + actiontext (8.0.3) + actionpack (= 8.0.3) + activerecord (= 8.0.3) + activestorage (= 8.0.3) + activesupport (= 8.0.3) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.2.2.2) - activesupport (= 7.2.2.2) + actionview (8.0.3) + activesupport (= 8.0.3) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.2.2.2) - activesupport (= 7.2.2.2) + activejob (8.0.3) + activesupport (= 8.0.3) globalid (>= 0.3.6) - activemodel (7.2.2.2) - activesupport (= 7.2.2.2) - activerecord (7.2.2.2) - activemodel (= 7.2.2.2) - activesupport (= 7.2.2.2) + activemodel (8.0.3) + activesupport (= 8.0.3) + activerecord (8.0.3) + activemodel (= 8.0.3) + activesupport (= 8.0.3) timeout (>= 0.4.0) - activestorage (7.2.2.2) - actionpack (= 7.2.2.2) - activejob (= 7.2.2.2) - activerecord (= 7.2.2.2) - activesupport (= 7.2.2.2) + activestorage (8.0.3) + actionpack (= 8.0.3) + activejob (= 8.0.3) + activerecord (= 8.0.3) + activesupport (= 8.0.3) marcel (~> 1.0) - activesupport (7.2.2.2) + activesupport (8.0.3) base64 benchmark (>= 0.3) bigdecimal @@ -72,7 +71,8 @@ GEM minitest (>= 5.1) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) - acts_as_list (1.2.4) + uri (>= 0.13.1) + acts_as_list (1.2.6) activerecord (>= 6.1) activesupport (>= 6.1) addressable (2.8.7) @@ -80,8 +80,8 @@ GEM american_date (1.3.0) ast (2.4.3) aws-eventstream (1.4.0) - aws-partitions (1.1168.0) - aws-sdk-core (3.233.0) + aws-partitions (1.1177.0) + aws-sdk-core (3.235.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) @@ -89,19 +89,19 @@ GEM bigdecimal jmespath (~> 1, >= 1.6.1) logger - aws-sdk-kms (1.113.0) - aws-sdk-core (~> 3, >= 3.231.0) + aws-sdk-kms (1.115.0) + aws-sdk-core (~> 3, >= 3.234.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.199.1) - aws-sdk-core (~> 3, >= 3.231.0) + aws-sdk-s3 (1.201.0) + aws-sdk-core (~> 3, >= 3.234.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) aws-sigv4 (1.12.1) aws-eventstream (~> 1, >= 1.0.2) base64 (0.3.0) bcrypt (3.1.20) - benchmark (0.4.1) - bigdecimal (3.2.3) + benchmark (0.5.0) + bigdecimal (3.3.1) bindex (0.8.1) bootsnap (1.18.6) msgpack (~> 1.2) @@ -149,7 +149,7 @@ GEM concurrent-ruby (~> 1.0) logger zeitwerk (~> 2.6) - erb (5.0.2) + erb (5.1.1) erubi (1.13.1) et-orbi (1.4.0) tzinfo @@ -172,8 +172,8 @@ GEM thor (~> 1.4) friendly_id (5.5.1) activerecord (>= 4.0.0) - fugit (1.11.2) - et-orbi (~> 1, >= 1.2.11) + fugit (1.12.1) + et-orbi (~> 1.4) raabro (~> 1.4) globalid (1.3.0) activesupport (>= 6.1) @@ -203,7 +203,7 @@ GEM jmespath (1.6.2) jsbundling-rails (1.3.1) railties (>= 6.0.0) - json (2.13.2) + json (2.15.1) jwt (3.1.2) base64 language_server-protocol (3.17.0.5) @@ -218,7 +218,8 @@ GEM madmin (1.2.11) pagy (>= 3.5) rails (>= 6.0.3) - mail (2.8.1) + mail (2.9.0) + logger mini_mime (>= 0.1.1) net-imap net-pop @@ -232,7 +233,7 @@ GEM mini_magick (5.3.1) logger mini_mime (1.1.5) - minitest (5.25.5) + minitest (5.26.0) mission_control-jobs (1.1.0) actioncable (>= 7.1) actionpack (>= 7.1) @@ -246,7 +247,7 @@ GEM msgpack (1.8.0) name_of_person (1.1.3) activesupport (>= 5.2.0) - net-imap (0.5.11) + net-imap (0.5.12) date net-protocol net-pop (0.1.2) @@ -290,23 +291,23 @@ GEM pg (1.6.2-x86_64-linux) pg (1.6.2-x86_64-linux-musl) phonelib (0.10.12) - pp (0.6.2) + pp (0.6.3) prettyprint pretender (0.6.0) actionpack (>= 7.1) prettyprint (0.2.0) - prism (1.4.0) + prism (1.6.0) psych (5.2.6) date stringio public_suffix (6.0.2) - puma (7.0.4) + puma (7.1.0) nio4r (~> 2.0) pundit (2.5.2) activesupport (>= 3.0.0) raabro (1.4.0) racc (1.8.1) - rack (3.1.16) + rack (3.2.3) rack-session (2.1.1) base64 (>= 0.1.0) rack (>= 3.0.0) @@ -314,20 +315,20 @@ GEM rack (>= 1.3) rackup (2.2.1) rack (>= 3) - rails (7.2.2.2) - actioncable (= 7.2.2.2) - actionmailbox (= 7.2.2.2) - actionmailer (= 7.2.2.2) - actionpack (= 7.2.2.2) - actiontext (= 7.2.2.2) - actionview (= 7.2.2.2) - activejob (= 7.2.2.2) - activemodel (= 7.2.2.2) - activerecord (= 7.2.2.2) - activestorage (= 7.2.2.2) - activesupport (= 7.2.2.2) + rails (8.0.3) + actioncable (= 8.0.3) + actionmailbox (= 8.0.3) + actionmailer (= 8.0.3) + actionpack (= 8.0.3) + actiontext (= 8.0.3) + actionview (= 8.0.3) + activejob (= 8.0.3) + activemodel (= 8.0.3) + activerecord (= 8.0.3) + activestorage (= 8.0.3) + activesupport (= 8.0.3) bundler (>= 1.15.0) - railties (= 7.2.2.2) + railties (= 8.0.3) rails-dom-testing (2.3.0) activesupport (>= 5.0.0) minitest @@ -335,13 +336,14 @@ GEM rails-html-sanitizer (1.6.2) loofah (~> 2.21) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) - railties (7.2.2.2) - actionpack (= 7.2.2.2) - activesupport (= 7.2.2.2) + railties (8.0.3) + actionpack (= 8.0.3) + activesupport (= 8.0.3) irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.3.0) @@ -356,21 +358,21 @@ GEM regexp_parser (2.11.3) reline (0.6.2) io-console (~> 0.5) - responders (3.1.1) - actionpack (>= 5.2) - railties (>= 5.2) + responders (3.2.0) + actionpack (>= 7.0) + railties (>= 7.0) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) rexml (3.4.4) - rspec-core (3.13.5) + rspec-core (3.13.6) rspec-support (~> 3.13.0) rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.5) + rspec-mocks (3.13.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-rails (8.0.2) @@ -382,7 +384,7 @@ GEM rspec-mocks (~> 3.13) rspec-support (~> 3.13) rspec-support (3.13.6) - rubocop (1.81.1) + rubocop (1.81.6) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -410,19 +412,17 @@ GEM ffi (~> 1.12) logger ruby_http_client (3.5.5) - rubyzip (3.1.1) + rubyzip (3.2.1) securerandom (0.4.1) - selenium-webdriver (4.36.0) + selenium-webdriver (4.37.0) base64 (~> 0.2) - json (<= 2.13.2) logger (~> 1.4) - prism (~> 1.0, < 1.5) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 4.0) websocket (~> 1.0) sendgrid-ruby (6.7.0) ruby_http_client (~> 3.4) - sentry-ruby (5.28.0) + sentry-ruby (6.0.0) bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) solid_cable (3.0.12) @@ -430,11 +430,11 @@ GEM activejob (>= 7.2) activerecord (>= 7.2) railties (>= 7.2) - solid_queue (1.2.1) + solid_queue (1.2.2) activejob (>= 7.1) activerecord (>= 7.1) concurrent-ruby (>= 1.3.1) - fugit (~> 1.11.0) + fugit (~> 1.11) railties (>= 7.1) thor (>= 1.3.1) sprockets (4.2.2) @@ -461,6 +461,7 @@ GEM unicode-display_width (3.2.0) unicode-emoji (~> 4.1) unicode-emoji (4.1.0) + uri (1.0.4) useragent (0.16.11) warden (1.2.9) rack (>= 2.0.9) @@ -522,7 +523,7 @@ DEPENDENCIES pretender puma pundit - rails (~> 7.2.0) + rails (~> 8.0.0) ransack responders rest-client diff --git a/app/controllers/access_requests_controller.rb b/app/controllers/access_requests_controller.rb index 9d62991..b411225 100644 --- a/app/controllers/access_requests_controller.rb +++ b/app/controllers/access_requests_controller.rb @@ -43,7 +43,7 @@ def approve ::UnitAccessApprovalJob.perform_later(unit: @access_request.unit, user: @access_request.user) redirect_to users_path, notice: t("controllers.access_request_controller.approve_success") else - render :review, status: :unprocessable_entity + render :review, status: :unprocessable_content end end @@ -53,7 +53,7 @@ def reject ::UnitAccessRejectionJob.perform_later(unit: @access_request.unit, user: @access_request.user) redirect_to users_path, notice: t("controllers.access_request_controller.reject_success") else - render :review, status: :unprocessable_entity + render :review, status: :unprocessable_content end end @@ -78,7 +78,7 @@ def set_access_request end def access_request_params - params.require(:access_request).permit(:unit_name) + params.expect(access_request: [:unit_name]) end def approval_params diff --git a/app/controllers/import_jobs_controller.rb b/app/controllers/import_jobs_controller.rb index 2e8e8af..7ba0501 100644 --- a/app/controllers/import_jobs_controller.rb +++ b/app/controllers/import_jobs_controller.rb @@ -45,7 +45,7 @@ def destroy private def import_job_params - params.require(:import_job).permit(:data_string) + params.expect(import_job: [:data_string]) end def set_import_job diff --git a/app/controllers/meetings_controller.rb b/app/controllers/meetings_controller.rb index 8beb373..1466304 100644 --- a/app/controllers/meetings_controller.rb +++ b/app/controllers/meetings_controller.rb @@ -39,7 +39,7 @@ def create format.turbo_stream end else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -58,7 +58,7 @@ def update end end else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end @@ -90,7 +90,7 @@ def update_contributors partial: "meetings/contributors", locals: { meeting: @meeting }) else - render :edit_contributors, status: :unprocessable_entity + render :edit_contributors, status: :unprocessable_content end end end @@ -118,7 +118,7 @@ def upsert end else respond_to do |format| - format.json { render json: @meeting.errors.full_messages.to_json, status: :unprocessable_entity } + format.json { render json: @meeting.errors.full_messages.to_json, status: :unprocessable_content } end end end @@ -136,10 +136,10 @@ def set_meeting end def meeting_params - params.require(:meeting).permit(:date, :meeting_type, :scheduler_id) + params.expect(meeting: [:date, :meeting_type, :scheduler_id]) end def meeting_program_member_params - params.require(:meeting).permit(*Meeting::CONTRIBUTOR_TITLES.keys) + params.expect(meeting: [*Meeting::CONTRIBUTOR_TITLES.keys]) end end diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index 4fb8b6f..9c4cd7c 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -40,7 +40,7 @@ def create end end else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -57,7 +57,7 @@ def update end end else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end @@ -101,7 +101,7 @@ def upsert end else respond_to do |format| - format.json { render json: @member.errors.full_messages.to_json, status: :unprocessable_entity } + format.json { render json: @member.errors.full_messages.to_json, status: :unprocessable_content } end end end @@ -113,15 +113,15 @@ def set_member end def member_params - params.require(:member).permit( - :birthdate, - :email, - :gender, - :name, - :paused_on, - :paused_by, - :paused_until, - :phone_number, + params.expect( + member: [:birthdate, + :email, + :gender, + :name, + :paused_on, + :paused_by, + :paused_until, + :phone_number], ) end end diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index 49f5619..0ac70d8 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -38,7 +38,7 @@ def create end end else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -55,7 +55,7 @@ def update end end else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end @@ -85,6 +85,6 @@ def set_note end def note_params - params.require(:note).permit(:member_id, :date, :content) + params.expect(note: [:member_id, :date, :content]) end end diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index 64043e0..66f6b1f 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -36,14 +36,14 @@ def authorize_action end def settings_update_params - params.require(:user) - .permit( - :avatar, - :email, - :name, - :notification_preference_email, - :notification_preference_sms, - :phone_number - ) + params + .expect( + user: [:avatar, + :email, + :name, + :notification_preference_email, + :notification_preference_sms, + :phone_number] + ) end end diff --git a/app/controllers/songs_controller.rb b/app/controllers/songs_controller.rb index 45f1811..dc9cd1d 100644 --- a/app/controllers/songs_controller.rb +++ b/app/controllers/songs_controller.rb @@ -35,7 +35,7 @@ def create end end else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -54,7 +54,7 @@ def update end end else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end @@ -80,6 +80,6 @@ def set_song end def song_params - params.require(:song).permit(:song_type, :title) + params.expect(song: [:song_type, :title]) end end diff --git a/app/controllers/talks_controller.rb b/app/controllers/talks_controller.rb index fc26a0c..645ddba 100644 --- a/app/controllers/talks_controller.rb +++ b/app/controllers/talks_controller.rb @@ -42,7 +42,7 @@ def create end end else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -60,7 +60,7 @@ def update end end else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end @@ -95,7 +95,7 @@ def upsert end else respond_to do |format| - format.json { render json: @talk.errors.full_messages.to_json, status: :unprocessable_entity } + format.json { render json: @talk.errors.full_messages.to_json, status: :unprocessable_content } end end end @@ -111,7 +111,7 @@ def move else @talk.errors.add(:position, "was not provided") if position.nil? - render json: @talk.errors.full_messages.to_json, status: :unprocessable_entity + render json: @talk.errors.full_messages.to_json, status: :unprocessable_content end end end @@ -128,6 +128,6 @@ def set_talk end def talk_params - params.require(:talk).permit(:speaker_name, :purpose, :topic) + params.expect(talk: [:speaker_name, :purpose, :topic]) end end diff --git a/app/controllers/units_controller.rb b/app/controllers/units_controller.rb index 15c0ef6..79a1fa7 100644 --- a/app/controllers/units_controller.rb +++ b/app/controllers/units_controller.rb @@ -22,7 +22,7 @@ def create if @unit.save redirect_to root_path else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -35,7 +35,7 @@ def update end end else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end @@ -74,7 +74,7 @@ def speaker_last_spoke private def unit_params - params.require(:unit).permit(:name) + params.expect(unit: [:name]) end def set_unit diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index f222487..dbe8614 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -33,7 +33,7 @@ def update end end else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end diff --git a/app/controllers/webhooks/sendgrid_events_controller.rb b/app/controllers/webhooks/sendgrid_events_controller.rb index 4bc8596..d67e149 100644 --- a/app/controllers/webhooks/sendgrid_events_controller.rb +++ b/app/controllers/webhooks/sendgrid_events_controller.rb @@ -14,14 +14,14 @@ def create Sentry.capture_message("Failed to save SendgridEvent", extra: { sendgrid_event: sendgrid_event, errors: sendgrid_event.errors.full_messages }) - status = :unprocessable_entity + status = :unprocessable_content break end head status rescue ActionController::ParameterMissing => e Sentry.capture_message("Sendgrid webhook parameter missing", extra: { error: e }) - head :unprocessable_entity + head :unprocessable_content end private diff --git a/config/application.rb b/config/application.rb index 3c4ca23..4f33f0e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -10,7 +10,7 @@ module Edify class Application < Rails::Application config.application_name = Rails.application.class.module_parent_name # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.1 + config.load_defaults 8.0 # 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. diff --git a/config/environments/development.rb b/config/environments/development.rb index 54a9cac..09b4d95 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -5,9 +5,7 @@ config.action_mailer.default_url_options = { host: ::EdifyConfig.app_url, port: 3000 } # Settings specified here will take precedence over those in config/application.rb. - # 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. + # Make code changes take effect immediately without server restart. config.enable_reloading = true # Do not eager load code on boot. @@ -19,8 +17,8 @@ # Enable server timing. config.server_timing = true - # Enable/disable caching. By default caching is disabled. - # Run rails dev:cache to toggle caching. + # Enable/disable Action Controller caching. By default Action Controller caching is disabled. + # Run rails dev:cache to toggle Action Controller caching. if Rails.root.join("tmp/caching-dev.txt").exist? config.action_controller.perform_caching = true config.action_controller.enable_fragment_cache_logging = true @@ -41,10 +39,10 @@ # 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. + # Make template changes take effect immediately. config.action_mailer.perform_caching = false + # Set localhost to be used by links generated in mailer templates. config.action_mailer.default_url_options = { host: "localhost", port: 3000 } # Print deprecation notices to the Rails logger. diff --git a/config/environments/production.rb b/config/environments/production.rb index a9cb843..fc7c61b 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -7,14 +7,13 @@ # Code is not reloaded between requests. config.enable_reloading = false - # Eager load code on boot. This eager loads most of Rails and - # your application in memory, allowing both threaded web servers - # and those relying on copy on write to perform better. - # Rake tasks automatically ignore this option for performance. + # Eager load code on boot for better performance and memory savings (ignored by Rake tasks). config.eager_load = true - # Full error reports are disabled and caching is turned on. + # Full error reports are disabled. config.consider_all_requests_local = false + + # Turn on fragment caching in view templates. config.action_controller.perform_caching = true # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment @@ -46,8 +45,7 @@ # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] # 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 + config.assume_ssl = true # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. config.force_ssl = true @@ -63,12 +61,16 @@ # 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". + # Change to "debug" to log everything (including potentially personally-identifiable information!) config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") - # Use a different cache store in production. + # Prevent health checks from clogging up the logs. + config.silence_healthcheck_path = "/up" + + # Don't log any deprecations. + config.active_support.report_deprecations = false + + # Replace the default in-process memory cache store with a durable alternative. # config.cache_store = :mem_cache_store # Use a real queuing backend for Active Job. @@ -118,13 +120,14 @@ config.active_record.dump_schema_after_migration = false # Only use :id for inspections in production. - # config.active_record.attributes_for_inspect = [:id] + config.active_record.attributes_for_inspect = [:id] # Enable DNS rebinding protection and other `Host` header attacks. # 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 diff --git a/config/environments/test.rb b/config/environments/test.rb index 597f85b..82eedd6 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -46,9 +46,8 @@ # 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" } + # Set host to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "example.com" } # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr diff --git a/config/initializers/new_framework_defaults_7_2.rb b/config/initializers/new_framework_defaults_7_2.rb deleted file mode 100644 index 8cf814d..0000000 --- a/config/initializers/new_framework_defaults_7_2.rb +++ /dev/null @@ -1,70 +0,0 @@ -# Be sure to restart your server when you modify this file. -# -# This file eases your Rails 7.2 framework defaults upgrade. -# -# Uncomment each configuration one by one to switch to the new default. -# Once your application is ready to run with all new defaults, you can remove -# this file and set the `config.load_defaults` to `7.2`. -# -# Read the Guide for Upgrading Ruby on Rails for more info on each option. -# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html - -### -# Controls whether Active Job's `#perform_later` and similar methods automatically defer -# the job queuing to after the current Active Record transaction is committed. -# -# Example: -# Topic.transaction do -# topic = Topic.create(...) -# NewTopicNotificationJob.perform_later(topic) -# end -# -# In this example, if the configuration is set to `:never`, the job will -# be enqueued immediately, even though the `Topic` hasn't been committed yet. -# Because of this, if the job is picked up almost immediately, or if the -# transaction doesn't succeed for some reason, the job will fail to find this -# topic in the database. -# -# If `enqueue_after_transaction_commit` is set to `:default`, the queue adapter -# will define the behaviour. -# -# Note: Active Job backends can disable this feature. This is generally done by -# backends that use the same database as Active Record as a queue, hence they -# don't need this feature. -#++ -Rails.application.config.active_job.enqueue_after_transaction_commit = :default - -### -# Adds image/webp to the list of content types Active Storage considers as an image -# Prevents automatic conversion to a fallback PNG, and assumes clients support WebP, as they support gif, jpeg, and png. -# This is possible due to broad browser support for WebP, but older browsers and email clients may still not support -# WebP. Requires imagemagick/libvips built with WebP support. -#++ -# Rails.application.config.active_storage.web_image_content_types = %w[image/png image/jpeg image/gif image/webp] - -### -# Enable validation of migration timestamps. When set, an ActiveRecord::InvalidMigrationTimestampError -# will be raised if the timestamp prefix for a migration is more than a day ahead of the timestamp -# associated with the current time. This is done to prevent forward-dating of migration files, which can -# impact migration generation and other migration commands. -# -# Applications with existing timestamped migrations that do not adhere to the -# expected format can disable validation by setting this config to `false`. -#++ -Rails.application.config.active_record.validate_migration_timestamps = true - -### -# Controls whether the PostgresqlAdapter should decode dates automatically with manual queries. -# -# Example: -# ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.select_value("select '2024-01-01'::date") #=> Date -# -# This query used to return a `String`. -#++ -Rails.application.config.active_record.postgresql_adapter_decode_dates = true - -### -# Enables YJIT as of Ruby 3.3, to bring sizeable performance improvements. If you are -# deploying to a memory constrained environment you may want to set this to `false`. -#++ -# Rails.application.config.yjit = true diff --git a/config/puma.rb b/config/puma.rb index ab9d2b9..6f6bf4b 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,13 +1,17 @@ # This configuration file will be evaluated by Puma. The top-level methods that # 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 starts a configurable number of processes (workers) and each process # serves each request in a thread from an internal thread pool. # +# You can control the number of workers using ENV["WEB_CONCURRENCY"]. You +# should only set this value when you want to run 2 or more workers. The +# default is already 1. +# # 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. +# 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 @@ -33,6 +37,9 @@ # Allow puma to be restarted by `bin/rails restart` command. plugin :tmp_restart +# Run the Solid Queue supervisor inside of Puma for single-server deployments +plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"] + # 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"] diff --git a/public/400.html b/public/400.html new file mode 100644 index 0000000..282dbc8 --- /dev/null +++ b/public/400.html @@ -0,0 +1,114 @@ + + + + +
+ +The server cannot process the request due to a client error. Please check the request and try again. If you’re the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
-We’re sorry, but something went wrong.
Our engineers have been notified.