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..174487938 100644 --- a/Gemfile +++ b/Gemfile @@ -2,13 +2,14 @@ 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?("/") "https://github.com/#{repo_name}.git" end +gem "benchmark" gem "bootsnap", require: false # Active admin @@ -40,7 +41,7 @@ gem "paranoia" # Rails and DB gem "activerecord-postgis-adapter" gem "pg" -gem "rails", "~> 7.2.3.1" +gem "rails", "~> 8.0.5" gem "rgeo" gem "rgeo-geojson" gem "gdal" @@ -107,7 +108,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 +155,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 b84e20400..33c56114a 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.6) + drb (~> 2.0) + prism (~> 1.5) mjml-rails (4.16.0) msgpack (1.8.0) multi_json (1.21.1) @@ -499,9 +497,6 @@ 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) racc (~> 1.4) oj (3.17.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,24 +589,8 @@ 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) reline (0.6.3) io-console (~> 0.5) @@ -788,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) @@ -812,7 +789,6 @@ GEM zeitwerk (2.7.5) PLATFORMS - ruby x86_64-linux DEPENDENCIES @@ -827,6 +803,7 @@ DEPENDENCIES acts_as_list annotate bcrypt + benchmark bootsnap brakeman bullet @@ -876,8 +853,8 @@ DEPENDENCIES puma rack-cors rack-mini-profiler (~> 2.0) - rails (~> 7.2.3.1) - redis-rails + rails (~> 8.0.5) + redis rgeo rgeo-geojson rspec-collection_matchers @@ -908,7 +885,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`** 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/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" 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 000000000..c4c9dbfbb Binary files /dev/null and b/public/icon.png differ 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