diff --git a/Gemfile b/Gemfile index ece28562..6a09613e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'http://rubygems.org' ruby '2.6.10' -gem 'rails', '= 5.2.8.1' +gem 'rails', '= 6.0.6.1' # Our database is MySQL, in both development and production. gem 'mysql2', '~> 0.5.5' @@ -24,7 +24,7 @@ gem 'devise', '~> 4.9', '>= 4.9.2' gem 'will_paginate', '~> 4.0' # For translation, both for the site UI and for Neopets data. -gem 'rails-i18n', '~> 5.1', '>= 5.1.3' +gem 'rails-i18n', '~> 7.0', '>= 7.0.7' gem 'http_accept_language', '~> 2.1', '>= 2.1.1' gem 'globalize', '~> 6.2', '>= 6.2.1' diff --git a/Gemfile.lock b/Gemfile.lock index e10c7475..01dc16ef 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,50 +7,63 @@ GIT GEM remote: http://rubygems.org/ specs: - actioncable (5.2.8.1) - actionpack (= 5.2.8.1) + actioncable (6.0.6.1) + actionpack (= 6.0.6.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.8.1) - actionpack (= 5.2.8.1) - actionview (= 5.2.8.1) - activejob (= 5.2.8.1) + actionmailbox (6.0.6.1) + actionpack (= 6.0.6.1) + activejob (= 6.0.6.1) + activerecord (= 6.0.6.1) + activestorage (= 6.0.6.1) + activesupport (= 6.0.6.1) + mail (>= 2.7.1) + actionmailer (6.0.6.1) + actionpack (= 6.0.6.1) + actionview (= 6.0.6.1) + activejob (= 6.0.6.1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.2.8.1) - actionview (= 5.2.8.1) - activesupport (= 5.2.8.1) + actionpack (6.0.6.1) + actionview (= 6.0.6.1) + activesupport (= 6.0.6.1) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.8.1) - activesupport (= 5.2.8.1) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.0.6.1) + actionpack (= 6.0.6.1) + activerecord (= 6.0.6.1) + activestorage (= 6.0.6.1) + activesupport (= 6.0.6.1) + nokogiri (>= 1.8.5) + actionview (6.0.6.1) + activesupport (= 6.0.6.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.2.8.1) - activesupport (= 5.2.8.1) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.0.6.1) + activesupport (= 6.0.6.1) globalid (>= 0.3.6) - activemodel (5.2.8.1) - activesupport (= 5.2.8.1) - activerecord (5.2.8.1) - activemodel (= 5.2.8.1) - activesupport (= 5.2.8.1) - arel (>= 9.0) - activestorage (5.2.8.1) - actionpack (= 5.2.8.1) - activerecord (= 5.2.8.1) - marcel (~> 1.0.0) - activesupport (5.2.8.1) + activemodel (6.0.6.1) + activesupport (= 6.0.6.1) + activerecord (6.0.6.1) + activemodel (= 6.0.6.1) + activesupport (= 6.0.6.1) + activestorage (6.0.6.1) + actionpack (= 6.0.6.1) + activejob (= 6.0.6.1) + activerecord (= 6.0.6.1) + marcel (~> 1.0) + activesupport (6.0.6.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) + zeitwerk (~> 2.2, >= 2.2.2) addressable (2.8.4) public_suffix (>= 2.0.2, < 6.0) - arel (9.0.0) babel-source (5.8.35) babel-transpiler (0.7.0) babel-source (>= 4.0, < 6) @@ -108,8 +121,8 @@ GEM factory_girl (~> 4.9.0) railties (>= 3.0.0) ffi (1.12.2) - globalid (0.4.2) - activesupport (>= 4.2.0) + globalid (1.1.0) + activesupport (>= 5.0) globalize (6.2.1) activemodel (>= 4.2, < 7.1) activerecord (>= 4.2, < 7.1) @@ -181,18 +194,20 @@ GEM rack (>= 1.0, < 4) rack-test (2.1.0) rack (>= 1.3) - rails (5.2.8.1) - actioncable (= 5.2.8.1) - actionmailer (= 5.2.8.1) - actionpack (= 5.2.8.1) - actionview (= 5.2.8.1) - activejob (= 5.2.8.1) - activemodel (= 5.2.8.1) - activerecord (= 5.2.8.1) - activestorage (= 5.2.8.1) - activesupport (= 5.2.8.1) + rails (6.0.6.1) + actioncable (= 6.0.6.1) + actionmailbox (= 6.0.6.1) + actionmailer (= 6.0.6.1) + actionpack (= 6.0.6.1) + actiontext (= 6.0.6.1) + actionview (= 6.0.6.1) + activejob (= 6.0.6.1) + activemodel (= 6.0.6.1) + activerecord (= 6.0.6.1) + activestorage (= 6.0.6.1) + activesupport (= 6.0.6.1) bundler (>= 1.3.0) - railties (= 5.2.8.1) + railties (= 6.0.6.1) sprockets-rails (>= 2.0.0) rails-dom-testing (2.1.1) activesupport (>= 5.0.0) @@ -200,15 +215,15 @@ GEM nokogiri (>= 1.6) rails-html-sanitizer (1.5.0) loofah (~> 2.19, >= 2.19.1) - rails-i18n (5.1.3) + rails-i18n (7.0.7) i18n (>= 0.7, < 2) - railties (>= 5.0, < 6) - railties (5.2.8.1) - actionpack (= 5.2.8.1) - activesupport (= 5.2.8.1) + railties (>= 6.0.0, < 8) + railties (6.0.6.1) + actionpack (= 6.0.6.1) + activesupport (= 6.0.6.1) method_source rake (>= 0.8.7) - thor (>= 0.19.0, < 2.0) + thor (>= 0.20.3, < 2.0) rake (13.0.6) rb-fsevent (0.11.2) rb-inotify (0.10.1) @@ -224,9 +239,9 @@ GEM actionview (>= 5) request_store (1.5.1) rack (>= 1.4) - responders (2.4.1) - actionpack (>= 4.2.0, < 6.0) - railties (>= 4.2.0, < 6.0) + responders (3.1.0) + actionpack (>= 5.2) + railties (>= 5.2) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) @@ -251,8 +266,8 @@ GEM crass (~> 1.0.2) nokogiri (>= 1.12.0) sass (3.4.25) - sass-rails (5.0.7) - railties (>= 4.0.0, < 6) + sass-rails (5.0.8) + railties (>= 5.2.0) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) @@ -260,9 +275,9 @@ GEM sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) sprockets (>= 3.0.0) temple (0.8.2) thor (1.2.2) @@ -287,6 +302,7 @@ GEM websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) will_paginate (4.0.0) + zeitwerk (2.6.11) PLATFORMS ruby @@ -310,8 +326,8 @@ DEPENDENCIES openneo-auth-signatory (~> 0.1.0) parallel (~> 1.23) rack-attack (~> 6.7) - rails (= 5.2.8.1) - rails-i18n (~> 5.1, >= 5.1.3) + rails (= 6.0.6.1) + rails-i18n (~> 7.0, >= 7.0.7) rdiscount (~> 2.2, >= 2.2.7.1) react-rails (~> 2.7, >= 2.7.1) record_tag_helper (~> 1.0, >= 1.0.1) diff --git a/bin/rails b/bin/rails index 728cd85a..07396602 100755 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,4 @@ #!/usr/bin/env ruby -APP_PATH = File.expand_path('../../config/application', __FILE__) +APP_PATH = File.expand_path('../config/application', __dir__) require_relative '../config/boot' require 'rails/commands' diff --git a/bin/setup b/bin/setup index 94fd4d79..5853b5ea 100755 --- a/bin/setup +++ b/bin/setup @@ -1,6 +1,5 @@ #!/usr/bin/env ruby require 'fileutils' -include FileUtils # path to your application root. APP_ROOT = File.expand_path('..', __dir__) @@ -9,24 +8,25 @@ def system!(*args) system(*args) || abort("\n== Command #{args} failed ==") end -chdir APP_ROOT do - # This script is a starting point to setup your application. +FileUtils.chdir APP_ROOT do + # This script is a way to setup or update your development environment automatically. + # This script is idempotent, so that you can run it at anytime and get an expectable outcome. # Add necessary setup steps to this file. puts '== Installing dependencies ==' system! 'gem install bundler --conservative' system('bundle check') || system!('bundle install') - # Install JavaScript dependencies if using Yarn + # Install JavaScript dependencies # system('bin/yarn') # puts "\n== Copying sample files ==" # unless File.exist?('config/database.yml') - # cp 'config/database.yml.sample', 'config/database.yml' + # FileUtils.cp 'config/database.yml.sample', 'config/database.yml' # end puts "\n== Preparing database ==" - system! 'bin/rails db:setup' + system! 'bin/rails db:prepare' puts "\n== Removing old logs and tempfiles ==" system! 'bin/rails log:clear tmp:clear' diff --git a/config/application.rb b/config/application.rb index f73b5abd..5c9904be 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,4 +1,4 @@ -require File.expand_path('../boot', __FILE__) +require_relative 'boot' require 'rails/all' @@ -9,7 +9,7 @@ Bundler.require(*Rails.groups) module OpenneoImpressItems class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 5.0 + config.load_defaults 6.0 # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers diff --git a/config/cable.yml b/config/cable.yml index 0a32d945..c16ed4cc 100644 --- a/config/cable.yml +++ b/config/cable.yml @@ -2,7 +2,7 @@ development: adapter: async test: - adapter: async + adapter: test production: adapter: redis diff --git a/config/environments/development.rb b/config/environments/development.rb index 14498c13..629c9652 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -16,6 +16,7 @@ Rails.application.configure do # Run rails dev:cache to toggle caching. if Rails.root.join('tmp', 'caching-dev.txt').exist? config.action_controller.perform_caching = true + config.action_controller.enable_fragment_cache_logging = true config.cache_store = :memory_store config.public_file_server.headers = { diff --git a/config/environments/production.rb b/config/environments/production.rb index bec9a666..03347c73 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,4 +1,4 @@ -OpenneoImpressItems::Application.configure do +Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. diff --git a/config/environments/test.rb b/config/environments/test.rb index 0a38fd3c..470dee4b 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,10 +1,11 @@ +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! config.cache_classes = true # Do not eager load code on boot. This avoids loading your whole application @@ -21,6 +22,7 @@ Rails.application.configure do # Show full error reports and disable caching. config.consider_all_requests_local = true config.action_controller.perform_caching = false + config.cache_store = :null_store # Raise exceptions instead of rendering exception templates. config.action_dispatch.show_exceptions = false @@ -28,7 +30,7 @@ Rails.application.configure do # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false - # 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.action_mailer.perform_caching = false @@ -41,6 +43,6 @@ Rails.application.configure do # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr - # Raises error for missing translations + # Raises error for missing translations. # config.action_view.raise_on_missing_translations = true end diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index d3bcaa5e..35d0f26f 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -11,6 +11,8 @@ # policy.object_src :none # policy.script_src :self, :https # policy.style_src :self, :https +# # If you are using webpack-dev-server then specify webpack-dev-server host +# policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development? # # Specify URI for violation reports # # policy.report_uri "/csp-violation-report-endpoint" @@ -19,6 +21,9 @@ # If you are using UJS then enable automatic nonce generation # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } +# Set the nonce only to specific directives +# Rails.application.config.content_security_policy_nonce_directives = %w(script-src) + # Report CSP violations to a specified URI # For further information see the following documentation: # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb index 1389e86a..5a6a32d3 100644 --- a/config/initializers/cookies_serializer.rb +++ b/config/initializers/cookies_serializer.rb @@ -2,4 +2,4 @@ # Specify a serializer for the signed and encrypted cookie jars. # Valid options are :json, :marshal, and :hybrid. -Rails.application.config.action_dispatch.cookies_serializer = :marshal +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/vendor/cache/actioncable-5.2.8.1.gem b/vendor/cache/actioncable-5.2.8.1.gem deleted file mode 100644 index 03a234e4..00000000 Binary files a/vendor/cache/actioncable-5.2.8.1.gem and /dev/null differ diff --git a/vendor/cache/actioncable-6.0.6.1.gem b/vendor/cache/actioncable-6.0.6.1.gem new file mode 100644 index 00000000..7af82a26 Binary files /dev/null and b/vendor/cache/actioncable-6.0.6.1.gem differ diff --git a/vendor/cache/actionmailbox-6.0.6.1.gem b/vendor/cache/actionmailbox-6.0.6.1.gem new file mode 100644 index 00000000..bf553240 Binary files /dev/null and b/vendor/cache/actionmailbox-6.0.6.1.gem differ diff --git a/vendor/cache/actionmailer-5.2.8.1.gem b/vendor/cache/actionmailer-5.2.8.1.gem deleted file mode 100644 index 34273454..00000000 Binary files a/vendor/cache/actionmailer-5.2.8.1.gem and /dev/null differ diff --git a/vendor/cache/actionmailer-6.0.6.1.gem b/vendor/cache/actionmailer-6.0.6.1.gem new file mode 100644 index 00000000..5f265bd6 Binary files /dev/null and b/vendor/cache/actionmailer-6.0.6.1.gem differ diff --git a/vendor/cache/actionpack-5.2.8.1.gem b/vendor/cache/actionpack-5.2.8.1.gem deleted file mode 100644 index af9b590c..00000000 Binary files a/vendor/cache/actionpack-5.2.8.1.gem and /dev/null differ diff --git a/vendor/cache/actionpack-6.0.6.1.gem b/vendor/cache/actionpack-6.0.6.1.gem new file mode 100644 index 00000000..177e10b9 Binary files /dev/null and b/vendor/cache/actionpack-6.0.6.1.gem differ diff --git a/vendor/cache/actiontext-6.0.6.1.gem b/vendor/cache/actiontext-6.0.6.1.gem new file mode 100644 index 00000000..7ee6f1b2 Binary files /dev/null and b/vendor/cache/actiontext-6.0.6.1.gem differ diff --git a/vendor/cache/actionview-5.2.8.1.gem b/vendor/cache/actionview-5.2.8.1.gem deleted file mode 100644 index 32173ca8..00000000 Binary files a/vendor/cache/actionview-5.2.8.1.gem and /dev/null differ diff --git a/vendor/cache/actionview-6.0.6.1.gem b/vendor/cache/actionview-6.0.6.1.gem new file mode 100644 index 00000000..361280b4 Binary files /dev/null and b/vendor/cache/actionview-6.0.6.1.gem differ diff --git a/vendor/cache/activejob-5.2.8.1.gem b/vendor/cache/activejob-5.2.8.1.gem deleted file mode 100644 index 5a1b5a8b..00000000 Binary files a/vendor/cache/activejob-5.2.8.1.gem and /dev/null differ diff --git a/vendor/cache/activejob-6.0.6.1.gem b/vendor/cache/activejob-6.0.6.1.gem new file mode 100644 index 00000000..66a75ff6 Binary files /dev/null and b/vendor/cache/activejob-6.0.6.1.gem differ diff --git a/vendor/cache/activemodel-5.2.8.1.gem b/vendor/cache/activemodel-5.2.8.1.gem deleted file mode 100644 index 76680a70..00000000 Binary files a/vendor/cache/activemodel-5.2.8.1.gem and /dev/null differ diff --git a/vendor/cache/activemodel-6.0.6.1.gem b/vendor/cache/activemodel-6.0.6.1.gem new file mode 100644 index 00000000..acf40e97 Binary files /dev/null and b/vendor/cache/activemodel-6.0.6.1.gem differ diff --git a/vendor/cache/activerecord-5.2.8.1.gem b/vendor/cache/activerecord-5.2.8.1.gem deleted file mode 100644 index 9ff23846..00000000 Binary files a/vendor/cache/activerecord-5.2.8.1.gem and /dev/null differ diff --git a/vendor/cache/activerecord-6.0.6.1.gem b/vendor/cache/activerecord-6.0.6.1.gem new file mode 100644 index 00000000..0d55bbaa Binary files /dev/null and b/vendor/cache/activerecord-6.0.6.1.gem differ diff --git a/vendor/cache/activestorage-5.2.8.1.gem b/vendor/cache/activestorage-5.2.8.1.gem deleted file mode 100644 index f655d1b2..00000000 Binary files a/vendor/cache/activestorage-5.2.8.1.gem and /dev/null differ diff --git a/vendor/cache/activestorage-6.0.6.1.gem b/vendor/cache/activestorage-6.0.6.1.gem new file mode 100644 index 00000000..e20eb615 Binary files /dev/null and b/vendor/cache/activestorage-6.0.6.1.gem differ diff --git a/vendor/cache/activesupport-5.2.8.1.gem b/vendor/cache/activesupport-5.2.8.1.gem deleted file mode 100644 index 4f8d3934..00000000 Binary files a/vendor/cache/activesupport-5.2.8.1.gem and /dev/null differ diff --git a/vendor/cache/activesupport-6.0.6.1.gem b/vendor/cache/activesupport-6.0.6.1.gem new file mode 100644 index 00000000..c053e417 Binary files /dev/null and b/vendor/cache/activesupport-6.0.6.1.gem differ diff --git a/vendor/cache/arel-9.0.0.gem b/vendor/cache/arel-9.0.0.gem deleted file mode 100644 index a2c51af4..00000000 Binary files a/vendor/cache/arel-9.0.0.gem and /dev/null differ diff --git a/vendor/cache/globalid-0.4.2.gem b/vendor/cache/globalid-0.4.2.gem deleted file mode 100644 index 8dcf8e31..00000000 Binary files a/vendor/cache/globalid-0.4.2.gem and /dev/null differ diff --git a/vendor/cache/globalid-1.1.0.gem b/vendor/cache/globalid-1.1.0.gem new file mode 100644 index 00000000..01f9aa3b Binary files /dev/null and b/vendor/cache/globalid-1.1.0.gem differ diff --git a/vendor/cache/rails-5.2.8.1.gem b/vendor/cache/rails-5.2.8.1.gem deleted file mode 100644 index 64186b8f..00000000 Binary files a/vendor/cache/rails-5.2.8.1.gem and /dev/null differ diff --git a/vendor/cache/rails-6.0.6.1.gem b/vendor/cache/rails-6.0.6.1.gem new file mode 100644 index 00000000..47cc00bc Binary files /dev/null and b/vendor/cache/rails-6.0.6.1.gem differ diff --git a/vendor/cache/rails-i18n-5.1.3.gem b/vendor/cache/rails-i18n-5.1.3.gem deleted file mode 100644 index 44e2b1e6..00000000 Binary files a/vendor/cache/rails-i18n-5.1.3.gem and /dev/null differ diff --git a/vendor/cache/rails-i18n-7.0.7.gem b/vendor/cache/rails-i18n-7.0.7.gem new file mode 100644 index 00000000..93b740cc Binary files /dev/null and b/vendor/cache/rails-i18n-7.0.7.gem differ diff --git a/vendor/cache/railties-5.2.8.1.gem b/vendor/cache/railties-5.2.8.1.gem deleted file mode 100644 index 4e3b802e..00000000 Binary files a/vendor/cache/railties-5.2.8.1.gem and /dev/null differ diff --git a/vendor/cache/railties-6.0.6.1.gem b/vendor/cache/railties-6.0.6.1.gem new file mode 100644 index 00000000..ead13d26 Binary files /dev/null and b/vendor/cache/railties-6.0.6.1.gem differ diff --git a/vendor/cache/responders-2.4.1.gem b/vendor/cache/responders-2.4.1.gem deleted file mode 100644 index a749cb13..00000000 Binary files a/vendor/cache/responders-2.4.1.gem and /dev/null differ diff --git a/vendor/cache/responders-3.1.0.gem b/vendor/cache/responders-3.1.0.gem new file mode 100644 index 00000000..0e60d68b Binary files /dev/null and b/vendor/cache/responders-3.1.0.gem differ diff --git a/vendor/cache/sass-rails-5.0.7.gem b/vendor/cache/sass-rails-5.0.7.gem deleted file mode 100644 index 7363b9e9..00000000 Binary files a/vendor/cache/sass-rails-5.0.7.gem and /dev/null differ diff --git a/vendor/cache/sass-rails-5.0.8.gem b/vendor/cache/sass-rails-5.0.8.gem new file mode 100644 index 00000000..4d22c136 Binary files /dev/null and b/vendor/cache/sass-rails-5.0.8.gem differ diff --git a/vendor/cache/sprockets-rails-3.2.2.gem b/vendor/cache/sprockets-rails-3.2.2.gem deleted file mode 100644 index 8d2c00be..00000000 Binary files a/vendor/cache/sprockets-rails-3.2.2.gem and /dev/null differ diff --git a/vendor/cache/sprockets-rails-3.4.2.gem b/vendor/cache/sprockets-rails-3.4.2.gem new file mode 100644 index 00000000..64591bff Binary files /dev/null and b/vendor/cache/sprockets-rails-3.4.2.gem differ diff --git a/vendor/cache/zeitwerk-2.6.11.gem b/vendor/cache/zeitwerk-2.6.11.gem new file mode 100644 index 00000000..5b8fbc4a Binary files /dev/null and b/vendor/cache/zeitwerk-2.6.11.gem differ