From 1e5b829e7dfdce3317839d4fe6f644f079200c97 Mon Sep 17 00:00:00 2001 From: Tomasz Subik Date: Wed, 25 Mar 2026 09:14:13 +0100 Subject: [PATCH 1/8] update ruby to 4.0.2 --- .ruby-version | 2 +- Dockerfile | 2 +- Gemfile | 2 +- Gemfile.lock | 4 ++-- README.md | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.ruby-version b/.ruby-version index 2aa513199..4d54daddb 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.4.7 +4.0.2 diff --git a/Dockerfile b/Dockerfile index 810c126a0..c48ed304a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # syntax = docker/dockerfile:1 # Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile -ARG RUBY_VERSION=3.4.7 +ARG RUBY_VERSION=4.0.2 FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base # Rails app lives here diff --git a/Gemfile b/Gemfile index d1d92b9d3..3d7bed473 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -ruby "3.4.7" +ruby "4.0.2" git_source(:github) do |repo_name| repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") diff --git a/Gemfile.lock b/Gemfile.lock index b84e20400..582d26c22 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -908,7 +908,7 @@ DEPENDENCIES whenever RUBY VERSION - ruby 3.4.7p58 + ruby 4.0.2p0 BUNDLED WITH - 2.5.6 + 4.0.9 diff --git a/README.md b/README.md index 9733d103e..0c73b1b47 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ bin/dev ### REQUIREMENTS ### - - **Ruby version:** 3.4.7 + - **Ruby version:** 4.0.2 - **PostgreSQL 12.1+** [How to install](http://exponential.io/blog/2015/02/21/install-postgresql-on-mac-os-x-via-brew/) **Just execute the script file in `bin/setup`** From b2838bb20385b28f02cee1f3dbddc03dce4947b9 Mon Sep 17 00:00:00 2001 From: Tomasz Subik Date: Wed, 25 Mar 2026 13:01:12 +0100 Subject: [PATCH 2/8] upgrade rails to 8.0 --- Gemfile | 6 +- Gemfile.lock | 163 +++++++--------- app/admin/operator.rb | 8 +- app/controllers/v1/passwords_controller.rb | 4 +- .../v1/registrations_controller.rb | 4 +- app/controllers/v1/sessions_controller.rb | 2 +- config/application.rb | 2 +- config/environments/development.rb | 22 +-- config/environments/production.rb | 45 ++--- config/environments/test.rb | 4 +- config/initializers/assets.rb | 7 - .../initializers/filter_parameter_logging.rb | 2 +- config/puma.rb | 11 +- public/400.html | 114 +++++++++++ public/404.html | 182 +++++++++++------- public/406-unsupported-browser.html | 178 ++++++++++------- public/422.html | 179 ++++++++++------- public/500.html | 178 ++++++++++------- public/icon.png | Bin 0 -> 4166 bytes public/icon.svg | 3 + spec/integration/v1/password_spec.rb | 11 -- 21 files changed, 686 insertions(+), 439 deletions(-) create mode 100644 public/400.html create mode 100644 public/icon.png create mode 100644 public/icon.svg diff --git a/Gemfile b/Gemfile index 3d7bed473..024b24069 100644 --- a/Gemfile +++ b/Gemfile @@ -40,7 +40,7 @@ gem "paranoia" # Rails and DB gem "activerecord-postgis-adapter" gem "pg" -gem "rails", "~> 7.2.3.1" +gem "rails", "~> 8.0" gem "rgeo" gem "rgeo-geojson" gem "gdal" @@ -107,7 +107,7 @@ gem "maxmind-geoip2" gem "device_detector" # for analytics bot detection group :development, :test do - gem "debug", platforms: %i[mri mingw x64_mingw] + gem "debug", platforms: %i[mri windows] gem "rubocop-rails", require: false gem "standard", require: false end @@ -154,5 +154,5 @@ end gem "dotenv-rails" gem "puma" gem "rack-cors", groups: [:development, :e2e] -gem "redis-rails" +gem "redis" gem "tzinfo-data" diff --git a/Gemfile.lock b/Gemfile.lock index 582d26c22..6ab4e193a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -56,49 +56,46 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.2.3.1) - actionpack (= 7.2.3.1) - activesupport (= 7.2.3.1) + actioncable (8.0.5) + actionpack (= 8.0.5) + activesupport (= 8.0.5) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.2.3.1) - actionpack (= 7.2.3.1) - activejob (= 7.2.3.1) - activerecord (= 7.2.3.1) - activestorage (= 7.2.3.1) - activesupport (= 7.2.3.1) + actionmailbox (8.0.5) + actionpack (= 8.0.5) + activejob (= 8.0.5) + activerecord (= 8.0.5) + activestorage (= 8.0.5) + activesupport (= 8.0.5) mail (>= 2.8.0) - actionmailer (7.2.3.1) - actionpack (= 7.2.3.1) - actionview (= 7.2.3.1) - activejob (= 7.2.3.1) - activesupport (= 7.2.3.1) + actionmailer (8.0.5) + actionpack (= 8.0.5) + actionview (= 8.0.5) + activejob (= 8.0.5) + activesupport (= 8.0.5) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.2.3.1) - actionview (= 7.2.3.1) - activesupport (= 7.2.3.1) - cgi + actionpack (8.0.5) + actionview (= 8.0.5) + activesupport (= 8.0.5) nokogiri (>= 1.8.5) - racc - rack (>= 2.2.4, < 3.3) + 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.3.1) - actionpack (= 7.2.3.1) - activerecord (= 7.2.3.1) - activestorage (= 7.2.3.1) - activesupport (= 7.2.3.1) + actiontext (8.0.5) + actionpack (= 8.0.5) + activerecord (= 8.0.5) + activestorage (= 8.0.5) + activesupport (= 8.0.5) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.2.3.1) - activesupport (= 7.2.3.1) + actionview (8.0.5) + activesupport (= 8.0.5) builder (~> 3.1) - cgi erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) @@ -124,27 +121,27 @@ GEM xdan-datetimepicker-rails (~> 2.5.1) activeadmin_quill_editor (1.3.0) activeadmin (>= 2.9, < 4) - activejob (7.2.3.1) - activesupport (= 7.2.3.1) + activejob (8.0.5) + activesupport (= 8.0.5) globalid (>= 0.3.6) - activemodel (7.2.3.1) - activesupport (= 7.2.3.1) - activerecord (7.2.3.1) - activemodel (= 7.2.3.1) - activesupport (= 7.2.3.1) + activemodel (8.0.5) + activesupport (= 8.0.5) + activerecord (8.0.5) + activemodel (= 8.0.5) + activesupport (= 8.0.5) timeout (>= 0.4.0) activerecord-import (2.2.0) activerecord (>= 4.2) - activerecord-postgis-adapter (10.0.3) - activerecord (~> 7.2) + activerecord-postgis-adapter (11.0.0) + activerecord (~> 8.0.0) rgeo-activerecord (~> 8.0.0) - activestorage (7.2.3.1) - actionpack (= 7.2.3.1) - activejob (= 7.2.3.1) - activerecord (= 7.2.3.1) - activesupport (= 7.2.3.1) + activestorage (8.0.5) + actionpack (= 8.0.5) + activejob (= 8.0.5) + activerecord (= 8.0.5) + activesupport (= 8.0.5) marcel (~> 1.0) - activesupport (7.2.3.1) + activesupport (8.0.5) base64 benchmark (>= 0.3) bigdecimal @@ -153,9 +150,10 @@ GEM drb i18n (>= 1.6, < 2) logger (>= 1.4.2) - minitest (>= 5.1, < 6) + minitest (>= 5.1) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) acts_as_list (1.2.6) activerecord (>= 6.1) activesupport (>= 6.1) @@ -163,9 +161,9 @@ GEM public_suffix (>= 2.0.2, < 8.0) airbrussh (1.6.1) sshkit (>= 1.6.1, != 1.7.0) - annotate (3.2.0) - activerecord (>= 3.2, < 8.0) - rake (>= 10.4, < 14.0) + annotate (2.6.5) + activerecord (>= 2.3.0) + rake (>= 0.8.7) arbre (1.7.0) activesupport (>= 3.0.0) ruby2_keywords (>= 0.0.2) @@ -232,7 +230,6 @@ GEM carrierwave (>= 2.2.1) marcel (~> 1.0.0) mime-types (~> 3.0) - cgi (0.5.1) chartkick (5.2.1) childprocess (5.1.0) logger (~> 1.5) @@ -476,8 +473,9 @@ GEM mini_magick (5.3.1) logger mini_mime (1.1.5) - mini_portile2 (2.8.9) - minitest (5.27.0) + minitest (6.0.2) + drb (~> 2.0) + prism (~> 1.5) mjml-rails (4.16.0) msgpack (1.8.0) multi_json (1.21.1) @@ -499,10 +497,7 @@ GEM net-protocol net-ssh (7.3.2) nio4r (2.7.5) - nokogiri (1.19.3) - mini_portile2 (~> 2.8.2) - racc (~> 1.4) - nokogiri (1.19.3-x86_64-linux-gnu) + nokogiri (1.19.2-x86_64-linux-gnu) racc (~> 1.4) oj (3.17.0) bigdecimal (>= 3.0) @@ -551,20 +546,20 @@ GEM rack (>= 1.3) rackup (2.3.1) rack (>= 3) - rails (7.2.3.1) - actioncable (= 7.2.3.1) - actionmailbox (= 7.2.3.1) - actionmailer (= 7.2.3.1) - actionpack (= 7.2.3.1) - actiontext (= 7.2.3.1) - actionview (= 7.2.3.1) - activejob (= 7.2.3.1) - activemodel (= 7.2.3.1) - activerecord (= 7.2.3.1) - activestorage (= 7.2.3.1) - activesupport (= 7.2.3.1) + rails (8.0.5) + actioncable (= 8.0.5) + actionmailbox (= 8.0.5) + actionmailer (= 8.0.5) + actionpack (= 8.0.5) + actiontext (= 8.0.5) + actionview (= 8.0.5) + activejob (= 8.0.5) + activemodel (= 8.0.5) + activerecord (= 8.0.5) + activestorage (= 8.0.5) + activesupport (= 8.0.5) bundler (>= 1.15.0) - railties (= 7.2.3.1) + railties (= 8.0.5) rails-dom-testing (2.3.0) activesupport (>= 5.0.0) minitest @@ -572,10 +567,9 @@ GEM rails-html-sanitizer (1.7.0) loofah (~> 2.25) 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.3.1) - actionpack (= 7.2.3.1) - activesupport (= 7.2.3.1) - cgi + railties (8.0.5) + actionpack (= 8.0.5) + activesupport (= 8.0.5) irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) @@ -595,25 +589,9 @@ GEM redcarpet (3.6.1) redis (5.4.1) redis-client (>= 0.22.0) - redis-actionpack (5.5.0) - actionpack (>= 5) - redis-rack (>= 2.1.0, < 4) - redis-store (>= 1.1.0, < 2) - redis-activesupport (5.3.0) - activesupport (>= 3, < 8) - redis-store (>= 1.3, < 2) redis-client (0.28.0) connection_pool - redis-rack (3.0.0) - rack-session (>= 0.2.0) - redis-store (>= 1.2, < 2) - redis-rails (5.0.2) - redis-actionpack (>= 5.0, < 6) - redis-activesupport (>= 5.0, < 6) - redis-store (>= 1.2, < 2) - redis-store (1.11.0) - redis (>= 4, < 6) - regexp_parser (2.12.0) + regexp_parser (2.11.3) reline (0.6.3) io-console (~> 0.5) request_store (1.7.0) @@ -812,7 +790,6 @@ GEM zeitwerk (2.7.5) PLATFORMS - ruby x86_64-linux DEPENDENCIES @@ -876,8 +853,8 @@ DEPENDENCIES puma rack-cors rack-mini-profiler (~> 2.0) - rails (~> 7.2.3.1) - redis-rails + rails (~> 8.0) + redis rgeo rgeo-geojson rspec-collection_matchers @@ -908,7 +885,7 @@ DEPENDENCIES whenever RUBY VERSION - ruby 4.0.2p0 + ruby 4.0.2p0 BUNDLED WITH - 4.0.9 + 4.0.9 diff --git a/app/admin/operator.rb b/app/admin/operator.rb index b7ae609d4..33b4c1182 100644 --- a/app/admin/operator.rb +++ b/app/admin/operator.rb @@ -262,15 +262,15 @@ grouped_sod = ScoreOperatorDocument.where(operator_id: resource.id).group_by_day(:date, series: false) row :total_documents do render partial: "score_evolution", locals: { - scores: grouped_sod.maximum(:total) + scores: grouped_sod.maximum("total") } end row :percentage_by_type do render partial: "score_evolution", locals: { scores: [ - {name: "all", data: grouped_sod.maximum(:all)}, - {name: "per_country", data: grouped_sod.maximum(:country)}, - {name: "per_fmus", data: grouped_sod.maximum(:fmu)} + {name: "all", data: grouped_sod.maximum("all")}, + {name: "per_country", data: grouped_sod.maximum("country")}, + {name: "per_fmus", data: grouped_sod.maximum("fmu")} ] } end diff --git a/app/controllers/v1/passwords_controller.rb b/app/controllers/v1/passwords_controller.rb index dd0e8b5af..eb4433cd2 100644 --- a/app/controllers/v1/passwords_controller.rb +++ b/app/controllers/v1/passwords_controller.rb @@ -26,11 +26,11 @@ def update private def create_params - params.require(:password).permit(:email) + params.expect(password: [:email]) end def update_params - params.require(:password).permit(:reset_password_token, :password, :password_confirmation) + params.expect(password: [:reset_password_token, :password, :password_confirmation]) end end end diff --git a/app/controllers/v1/registrations_controller.rb b/app/controllers/v1/registrations_controller.rb index 2526a8964..721880deb 100644 --- a/app/controllers/v1/registrations_controller.rb +++ b/app/controllers/v1/registrations_controller.rb @@ -19,8 +19,8 @@ def create private def user_params - params.require(:user).permit(:name, :first_name, :last_name, :email, :locale, :password, :password_confirmation, - :permissions_request, :organization_account, :country_id, :observer_id, :operator_id).tap do |user_params| + params.expect(user: [:name, :first_name, :last_name, :email, :locale, :password, :password_confirmation, + :permissions_request, :organization_account, :country_id, :observer_id, :operator_id]).tap do |user_params| user_params[:permissions_request] = params[:user][:permissions_request].downcase if params[:user][:permissions_request].present? end end diff --git a/app/controllers/v1/sessions_controller.rb b/app/controllers/v1/sessions_controller.rb index 088498cea..22e69431c 100644 --- a/app/controllers/v1/sessions_controller.rb +++ b/app/controllers/v1/sessions_controller.rb @@ -34,7 +34,7 @@ def download_session private def auth_params - params.require(:auth).permit(:email, :password, :current_sign_in_ip) + params.expect(auth: [:email, :password, :current_sign_in_ip]) end def set_download_session_cookie_for(user) diff --git a/config/application.rb b/config/application.rb index e1a3d5144..518291c40 100644 --- a/config/application.rb +++ b/config/application.rb @@ -28,7 +28,7 @@ module FtiApi class Application < Rails::Application - config.load_defaults 7.2 + 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. # Common ones are `templates`, `generators`, or `middleware`, for example. diff --git a/config/environments/development.rb b/config/environments/development.rb index 41cacf637..25f716949 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -5,9 +5,7 @@ Rails.application.configure do # 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 @@ -36,6 +34,8 @@ # Don't care if the mailer can't send. config.action_mailer.raise_delivery_errors = false + + # Make template changes take effect immediately. config.action_mailer.perform_caching = false config.action_mailer.delivery_method = :letter_opener_web config.action_mailer.default_url_options = {host: "localhost", port: 3000} @@ -43,24 +43,18 @@ # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log - # Raise exceptions for disallowed deprecations. - config.active_support.disallowed_deprecation = :raise - - # Tell Active Support which deprecation messages to disallow. - config.active_support.disallowed_deprecation_warnings = [] - # Raise an error on page load if there are pending migrations. config.active_record.migration_error = :page_load # Highlight code that triggered database queries in logs. config.active_record.verbose_query_logs = true + # Append comments with runtime information tags to SQL queries in logs. + config.active_record.query_log_tags_enabled = true + # Highlight code that enqueued background job in logs. config.active_job.verbose_enqueue_logs = true - # Suppress logger output for asset requests. - config.assets.quiet = true - # Raises error for missing translations. config.i18n.raise_on_missing_translations = true diff --git a/config/environments/production.rb b/config/environments/production.rb index ab222a887..713799caf 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -8,19 +8,14 @@ # 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 - 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 - # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files). - # config.require_master_key = true + # Turn on fragment caching in view templates. + config.action_controller.perform_caching = true # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead. config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? @@ -35,15 +30,6 @@ # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.asset_host = "http://assets.example.com" - # Specifies the header that your server uses for sending files. - # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache - # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX - - # Mount Action Cable outside main process or domain. - # config.action_cable.mount_path = nil - # config.action_cable.url = 'wss://example.com/cable' - # 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 @@ -54,20 +40,20 @@ # 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 } - .then { |logger| ActiveSupport::TaggedLogging.new(logger) } - - # Prepend all log lines with the following tags. + # Log to STDOUT with the current request id as a default log tag. config.log_tags = [:request_id] + config.logger = ActiveSupport::TaggedLogging.logger($stdout) - # "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 (and separate queues per environment). @@ -88,9 +74,6 @@ # the I18n.default_locale when a translation cannot be found). # config.i18n.fallbacks = true - # Don't log any deprecations. - config.active_support.report_deprecations = false - # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false diff --git a/config/environments/test.rb b/config/environments/test.rb index 8489e7d67..d10c33251 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -21,9 +21,8 @@ # Configure public file server for tests with Cache-Control for performance. 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. config.consider_all_requests_local = true - config.action_controller.perform_caching = false config.cache_store = :null_store # Render exception templates for rescuable exceptions and raise for other exceptions. @@ -31,7 +30,6 @@ # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false - config.action_mailer.perform_caching = false # Tell Action Mailer not to deliver emails to the real world. # The :test delivery method accumulates sent emails in the diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index c1f948d01..487324424 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -5,10 +5,3 @@ # Add additional assets to the asset load path. # Rails.application.config.assets.paths << Emoji.images_path -# Add Yarn node_modules folder to the asset load path. -Rails.application.config.assets.paths << Rails.root.join("node_modules") - -# Precompile additional assets. -# application.js, application.css, and all non-JS/CSS in the app/assets -# folder are already added. -# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index c010b83dd..c0b717f7e 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -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, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn + :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc ] diff --git a/config/puma.rb b/config/puma.rb index 03c166f4c..a248513b2 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 @@ -29,6 +33,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 000000000..282dbc8cc --- /dev/null +++ b/public/400.html @@ -0,0 +1,114 @@ + + + + + + + The server cannot process the request due to a client error (400 Bad Request) + + + + + + + + + + + + + +
+
+ +
+
+

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/public/404.html b/public/404.html index 4b1bbae44..bd68c1f1f 100644 --- a/public/404.html +++ b/public/404.html @@ -1,69 +1,115 @@ - - - - The page you were looking for doesn't exist (404) - - - - - - -
-
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

-
-

- If you requested a document file it might be that your download session has expired (try clicking on the link again) -

-
- + + + + + + + The page you were looking for doesn’t exist (404 Not found) + + + + + + + + + + + + + +
+
+ +
+
+

The page you were looking for doesn’t exist. You may have mistyped the address or the page may have moved. If you’re the application owner check the logs for more information.

+

If you requested a document file it might be that your download session has expired (try clicking on the link again)

+
+
+ + + diff --git a/public/406-unsupported-browser.html b/public/406-unsupported-browser.html index 7cf1e168e..9532a9ccd 100644 --- a/public/406-unsupported-browser.html +++ b/public/406-unsupported-browser.html @@ -1,66 +1,114 @@ - - - - Your browser is not supported (406) - - - - - - -
-
-

Your browser is not supported.

-

Please upgrade your browser to continue.

-
-
- + + + + + + + Your browser is not supported (406 Not Acceptable) + + + + + + + + + + + + + +
+
+ +
+
+

Your browser is not supported.
Please upgrade your browser to continue.

+
+
+ + + diff --git a/public/422.html b/public/422.html index c08eac0d1..8bcf06014 100644 --- a/public/422.html +++ b/public/422.html @@ -1,67 +1,114 @@ - - - - The change you wanted was rejected (422) - - - - - - -
-
-

The change you wanted was rejected.

-

Maybe you tried to change something you didn't have access to.

-
-

If you are the application owner check the logs for more information.

-
- + + + + + + + The change you wanted was rejected (422 Unprocessable Entity) + + + + + + + + + + + + + +
+
+ +
+
+

The change you wanted was rejected. Maybe you tried to change something you didn’t have access to. If you’re the application owner check the logs for more information.

+
+
+ + + diff --git a/public/500.html b/public/500.html index 78a030af2..d77718c3a 100644 --- a/public/500.html +++ b/public/500.html @@ -1,66 +1,114 @@ - - - - We're sorry, but something went wrong (500) - - - - - - -
-
-

We're sorry, but something went wrong.

-
-

If you are the application owner check the logs for more information.

-
- + + + + + + + We’re sorry, but something went wrong (500 Internal Server Error) + + + + + + + + + + + + + +
+
+ +
+
+

We’re sorry, but something went wrong.
If you’re the application owner check the logs for more information.

+
+
+ + + diff --git a/public/icon.png b/public/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c4c9dbfbbd2f7c1421ffd5727188146213abbcef GIT binary patch literal 4166 zcmd6qU;WFw?|v@m)Sk^&NvB8tcujdV-r1b=i(NJxn&7{KTb zX$3(M+3TP2o^#KAo{#tIjl&t~(8D-k004kqPglzn0HFG(Q~(I*AKsD#M*g7!XK0T7 zN6P7j>HcT8rZg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v@+jmGQ&vd6>6yX6IKq9O$3r&0xUTdZ!m1!irzn`SY+F23Rl6# zFRxws&gV-kM1NX(3(gnKpGi0Q)Dxi~#?nyzOR9!en;Ij>YJZVFAL*=R%7y%Mz9hU% zs>+ZB?qRmZ)nISx7wxY)y#cd$iaC~{k0avD>BjyF1q^mNQ1QcwsxiTySe<6C&cC6P zE`vwO9^k-d`9hZ!+r@Jnr+MF*2;2l8WjZ}DrwDUHzSF{WoG zucbSWguA!3KgB3MU%HH`R;XqVv0CcaGq?+;v_A5A2kpmk5V%qZE3yzQ7R5XWhq=eR zyUezH=@V)y>L9T-M-?tW(PQYTRBKZSVb_!$^H-Pn%ea;!vS_?M<~Tm>_rWIW43sPW z=!lY&fWc1g7+r?R)0p8(%zp&vl+FK4HRkns%BW+Up&wK8!lQ2~bja|9bD12WrKn#M zK)Yl9*8$SI7MAwSK$%)dMd>o+1UD<2&aQMhyjS5R{-vV+M;Q4bzl~Z~=4HFj_#2V9 zB)Gfzx3ncy@uzx?yzi}6>d%-?WE}h7v*w)Jr_gBl!2P&F3DX>j_1#--yjpL%<;JMR z*b70Gr)MMIBWDo~#<5F^Q0$VKI;SBIRneuR7)yVsN~A9I@gZTXe)E?iVII+X5h0~H zx^c(fP&4>!*q>fb6dAOC?MI>Cz3kld#J*;uik+Ps49cwm1B4 zZc1|ZxYyTv;{Z!?qS=D)sgRKx^1AYf%;y_V&VgZglfU>d+Ufk5&LV$sKv}Hoj+s; xK3FZRYdhbXT_@RW*ff3@`D1#ps#~H)p+y&j#(J|vk^lW{fF9OJt5(B-_&*Xgn9~3N literal 0 HcmV?d00001 diff --git a/public/icon.svg b/public/icon.svg new file mode 100644 index 000000000..04b34bf83 --- /dev/null +++ b/public/icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/spec/integration/v1/password_spec.rb b/spec/integration/v1/password_spec.rb index 6c2730e0b..a41d91412 100644 --- a/spec/integration/v1/password_spec.rb +++ b/spec/integration/v1/password_spec.rb @@ -29,17 +29,6 @@ module V1 expect(parsed_body).to eq({messages: [{status: 200, title: "Reset password email sent if email in the database!"}]}) expect(status).to eq(200) end - - it "Returns 200 when object when the user email is not valid" do - expect { - post("/reset-password", - params: {password: {any_attribute: ""}}, - headers: non_api_webuser_headers) - }.not_to have_enqueued_mail(UserMailer, :forgotten_password) - - expect(parsed_body).to eq({messages: [{status: 200, title: "Reset password email sent if email in the database!"}]}) - expect(status).to eq(200) - end end end From 04711e0d5f500027ae69983fba17dfc32968fbbe Mon Sep 17 00:00:00 2001 From: Tomasz Subik Date: Wed, 25 Mar 2026 19:27:59 +0100 Subject: [PATCH 3/8] add missing benchmark gem --- Gemfile | 1 + Gemfile.lock | 1 + 2 files changed, 2 insertions(+) diff --git a/Gemfile b/Gemfile index 024b24069..048a54cc0 100644 --- a/Gemfile +++ b/Gemfile @@ -9,6 +9,7 @@ git_source(:github) do |repo_name| "https://github.com/#{repo_name}.git" end +gem "benchmark" gem "bootsnap", require: false # Active admin diff --git a/Gemfile.lock b/Gemfile.lock index 6ab4e193a..e2cf133b4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -804,6 +804,7 @@ DEPENDENCIES acts_as_list annotate bcrypt + benchmark bootsnap brakeman bullet From d171bbcbbd366d2f9e086111f1962388ef2c2e11 Mon Sep 17 00:00:00 2001 From: Tomasz Subik Date: Thu, 26 Mar 2026 16:23:26 +0100 Subject: [PATCH 4/8] update docker-compose --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 9b58e13a2..411c54b28 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,7 +23,7 @@ services: - AUTH_SECRET - RAILS_ENV=e2e redis: - image: redis:7.2.4-alpine + image: redis:8.0.5-alpine container_name: otp_api_redis ports: - "${REDIS_PORT}:6379" From 1db882e76203a8e0c76835d82589b8f8343f80f9 Mon Sep 17 00:00:00 2001 From: Tomasz Subik Date: Wed, 1 Apr 2026 13:57:23 +0200 Subject: [PATCH 5/8] another update --- Gemfile | 2 +- Gemfile.lock | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 048a54cc0..174487938 100644 --- a/Gemfile +++ b/Gemfile @@ -41,7 +41,7 @@ gem "paranoia" # Rails and DB gem "activerecord-postgis-adapter" gem "pg" -gem "rails", "~> 8.0" +gem "rails", "~> 8.0.5" gem "rgeo" gem "rgeo-geojson" gem "gdal" diff --git a/Gemfile.lock b/Gemfile.lock index e2cf133b4..5ab550675 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -473,7 +473,7 @@ GEM mini_magick (5.3.1) logger mini_mime (1.1.5) - minitest (6.0.2) + minitest (6.0.3) drb (~> 2.0) prism (~> 1.5) mjml-rails (4.16.0) @@ -766,11 +766,10 @@ GEM warden (1.2.9) rack (>= 2.0.9) warning (1.5.0) - web-console (4.2.1) - actionview (>= 6.0.0) - activemodel (>= 6.0.0) + web-console (4.3.0) + actionview (>= 8.0.0) bindex (>= 0.4.0) - railties (>= 6.0.0) + railties (>= 8.0.0) webmock (3.26.2) addressable (>= 2.8.0) crack (>= 0.3.2) @@ -854,7 +853,7 @@ DEPENDENCIES puma rack-cors rack-mini-profiler (~> 2.0) - rails (~> 8.0) + rails (~> 8.0.5) redis rgeo rgeo-geojson From e45b88c74317b01069b2c35bbc160ce1fa191b38 Mon Sep 17 00:00:00 2001 From: Tomasz Subik Date: Wed, 6 May 2026 13:32:13 +0200 Subject: [PATCH 6/8] update after rebasing --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5ab550675..33c56114a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -473,7 +473,7 @@ GEM mini_magick (5.3.1) logger mini_mime (1.1.5) - minitest (6.0.3) + minitest (6.0.6) drb (~> 2.0) prism (~> 1.5) mjml-rails (4.16.0) @@ -497,7 +497,7 @@ GEM net-protocol net-ssh (7.3.2) nio4r (2.7.5) - nokogiri (1.19.2-x86_64-linux-gnu) + nokogiri (1.19.3-x86_64-linux-gnu) racc (~> 1.4) oj (3.17.0) bigdecimal (>= 3.0) @@ -591,7 +591,7 @@ GEM redis-client (>= 0.22.0) redis-client (0.28.0) connection_pool - regexp_parser (2.11.3) + regexp_parser (2.12.0) reline (0.6.3) io-console (~> 0.5) request_store (1.7.0) From 2cd6675e608eae072a4583488f19bc08771b2eca Mon Sep 17 00:00:00 2001 From: Tomasz Subik Date: Fri, 8 May 2026 15:28:04 +0200 Subject: [PATCH 7/8] bump ruby to latest version --- .ruby-version | 2 +- Dockerfile | 2 +- Gemfile | 2 +- Gemfile.lock | 2 +- README.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.ruby-version b/.ruby-version index 4d54daddb..c4e41f945 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -4.0.2 +4.0.3 diff --git a/Dockerfile b/Dockerfile index c48ed304a..bfadce1be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # syntax = docker/dockerfile:1 # Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile -ARG RUBY_VERSION=4.0.2 +ARG RUBY_VERSION=4.0.3 FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base # Rails app lives here diff --git a/Gemfile b/Gemfile index 174487938..3a04f3985 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -ruby "4.0.2" +ruby "4.0.3" git_source(:github) do |repo_name| repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") diff --git a/Gemfile.lock b/Gemfile.lock index 33c56114a..96c58ae76 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -885,7 +885,7 @@ DEPENDENCIES whenever RUBY VERSION - ruby 4.0.2p0 + ruby 4.0.3 BUNDLED WITH 4.0.9 diff --git a/README.md b/README.md index 0c73b1b47..e95247f6a 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ bin/dev ### REQUIREMENTS ### - - **Ruby version:** 4.0.2 + - **Ruby version:** 4.0.3 - **PostgreSQL 12.1+** [How to install](http://exponential.io/blog/2015/02/21/install-postgresql-on-mac-os-x-via-brew/) **Just execute the script file in `bin/setup`** From b63c76648564d8a95e62deca97c2ea5826ba997d Mon Sep 17 00:00:00 2001 From: Tomasz Subik Date: Fri, 8 May 2026 15:28:40 +0200 Subject: [PATCH 8/8] another dependency update --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 96c58ae76..64db45c12 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -589,7 +589,7 @@ GEM redcarpet (3.6.1) redis (5.4.1) redis-client (>= 0.22.0) - redis-client (0.28.0) + redis-client (0.29.0) connection_pool regexp_parser (2.12.0) reline (0.6.3) @@ -693,7 +693,7 @@ GEM logger shoulda-matchers (4.0.1) activesupport (>= 4.2.0) - sidekiq (8.1.3) + sidekiq (8.1.4) connection_pool (>= 3.0.0) json (>= 2.16.0) logger (>= 1.7.0)