]> git.openstreetmap.org Git - rails.git/commitdiff
Update to rails 6.0.1
authorTom Hughes <tom@compton.nu>
Tue, 20 Aug 2019 19:38:42 +0000 (20:38 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 24 Nov 2019 11:05:02 +0000 (11:05 +0000)
18 files changed:
Gemfile
Gemfile.lock
bin/setup
config/environments/development.rb
config/environments/production.rb
config/environments/test.rb
config/initializers/active_storage.rb
config/initializers/assets.rb
config/initializers/content_security_policy.rb
config/initializers/cors.rb
config/initializers/field_error.rb
config/initializers/new_framework_defaults_5_2.rb [new file with mode: 0644]
config/initializers/new_framework_defaults_6_0.rb [new file with mode: 0644]
config/initializers/wrap_parameters.rb
config/puma.rb
db/structure.sql
test/controllers/api/traces_controller_test.rb
test/controllers/traces_controller_test.rb

diff --git a/Gemfile b/Gemfile
index fb5d56f24654fc19872111237aa0cbb57beda6cc..8ccc5026b4ecb1b15a74eca2bd1a7a2de5a7840a 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -1,7 +1,7 @@
 source "https://rubygems.org"
 
 # Require rails
 source "https://rubygems.org"
 
 # Require rails
-gem "rails", "5.2.3"
+gem "rails", "6.0.1"
 
 # Require things which have moved to gems in ruby 1.9
 gem "bigdecimal", "~> 1.1.0", :platforms => :ruby_19
 
 # Require things which have moved to gems in ruby 1.9
 gem "bigdecimal", "~> 1.1.0", :platforms => :ruby_19
@@ -21,9 +21,6 @@ gem "sassc-rails"
 # Use Uglifier as compressor for JavaScript assets
 gem "uglifier", ">= 1.3.0"
 
 # Use Uglifier as compressor for JavaScript assets
 gem "uglifier", ">= 1.3.0"
 
-# Use CoffeeScript for .js.coffee assets and views
-gem "coffee-rails", "~> 4.2"
-
 # Use jquery as the JavaScript library
 gem "jquery-rails"
 
 # Use jquery as the JavaScript library
 gem "jquery-rails"
 
@@ -31,7 +28,7 @@ gem "jquery-rails"
 gem "jbuilder", "~> 2.7"
 
 # Reduces boot times through caching; required in config/boot.rb
 gem "jbuilder", "~> 2.7"
 
 # Reduces boot times through caching; required in config/boot.rb
-gem "bootsnap", ">= 1.1.0", :require => false
+gem "bootsnap", ">= 1.4.2", :require => false
 
 # Use R2 for RTL conversion
 gem "r2", "~> 0.2.7"
 
 # Use R2 for RTL conversion
 gem "r2", "~> 0.2.7"
@@ -46,7 +43,7 @@ gem "image_optim_rails"
 gem "active_record_union"
 gem "activerecord-import"
 gem "cancancan"
 gem "active_record_union"
 gem "activerecord-import"
 gem "cancancan"
-gem "composite_primary_keys", "~> 11.1.0"
+gem "composite_primary_keys", "~> 12.0.0"
 gem "config"
 gem "delayed_job_active_record"
 gem "dynamic_form"
 gem "config"
 gem "delayed_job_active_record"
 gem "dynamic_form"
@@ -151,10 +148,11 @@ end
 
 # Needed in development as well so rake can see konacha tasks
 group :development, :test do
 
 # Needed in development as well so rake can see konacha tasks
 group :development, :test do
-  gem "capybara", "~> 2.13"
+  gem "capybara", ">= 2.15"
   gem "coveralls", :require => false
   gem "erb_lint", :require => false
   gem "factory_bot_rails"
   gem "poltergeist"
   gem "coveralls", :require => false
   gem "erb_lint", :require => false
   gem "factory_bot_rails"
   gem "poltergeist"
-  gem "puma", "~> 3.7"
+  gem "puma", "~> 3.11"
+  gem "selenium-webdriver"
 end
 end
index 7d06ac98d0c101eabdae00d5f0ecd897a7d22995..e9dd8af4b1443787d343840ce90d4d1b26050b34 100644 (file)
@@ -4,57 +4,70 @@ GEM
     SystemTimer (1.2.3)
     aasm (5.0.6)
       concurrent-ruby (~> 1.0)
     SystemTimer (1.2.3)
     aasm (5.0.6)
       concurrent-ruby (~> 1.0)
-    actioncable (5.2.3)
-      actionpack (= 5.2.3)
+    actioncable (6.0.1)
+      actionpack (= 6.0.1)
       nio4r (~> 2.0)
       websocket-driver (>= 0.6.1)
       nio4r (~> 2.0)
       websocket-driver (>= 0.6.1)
-    actionmailer (5.2.3)
-      actionpack (= 5.2.3)
-      actionview (= 5.2.3)
-      activejob (= 5.2.3)
+    actionmailbox (6.0.1)
+      actionpack (= 6.0.1)
+      activejob (= 6.0.1)
+      activerecord (= 6.0.1)
+      activestorage (= 6.0.1)
+      activesupport (= 6.0.1)
+      mail (>= 2.7.1)
+    actionmailer (6.0.1)
+      actionpack (= 6.0.1)
+      actionview (= 6.0.1)
+      activejob (= 6.0.1)
       mail (~> 2.5, >= 2.5.4)
       rails-dom-testing (~> 2.0)
       mail (~> 2.5, >= 2.5.4)
       rails-dom-testing (~> 2.0)
-    actionpack (5.2.3)
-      actionview (= 5.2.3)
-      activesupport (= 5.2.3)
+    actionpack (6.0.1)
+      actionview (= 6.0.1)
+      activesupport (= 6.0.1)
       rack (~> 2.0)
       rack-test (>= 0.6.3)
       rails-dom-testing (~> 2.0)
       rack (~> 2.0)
       rack-test (>= 0.6.3)
       rails-dom-testing (~> 2.0)
-      rails-html-sanitizer (~> 1.0, >= 1.0.2)
-    actionview (5.2.3)
-      activesupport (= 5.2.3)
+      rails-html-sanitizer (~> 1.0, >= 1.2.0)
+    actiontext (6.0.1)
+      actionpack (= 6.0.1)
+      activerecord (= 6.0.1)
+      activestorage (= 6.0.1)
+      activesupport (= 6.0.1)
+      nokogiri (>= 1.8.5)
+    actionview (6.0.1)
+      activesupport (= 6.0.1)
       builder (~> 3.1)
       erubi (~> 1.4)
       rails-dom-testing (~> 2.0)
       builder (~> 3.1)
       erubi (~> 1.4)
       rails-dom-testing (~> 2.0)
-      rails-html-sanitizer (~> 1.0, >= 1.0.3)
+      rails-html-sanitizer (~> 1.1, >= 1.2.0)
     active_record_union (1.3.0)
       activerecord (>= 4.0)
     active_record_union (1.3.0)
       activerecord (>= 4.0)
-    activejob (5.2.3)
-      activesupport (= 5.2.3)
+    activejob (6.0.1)
+      activesupport (= 6.0.1)
       globalid (>= 0.3.6)
       globalid (>= 0.3.6)
-    activemodel (5.2.3)
-      activesupport (= 5.2.3)
-    activerecord (5.2.3)
-      activemodel (= 5.2.3)
-      activesupport (= 5.2.3)
-      arel (>= 9.0)
+    activemodel (6.0.1)
+      activesupport (= 6.0.1)
+    activerecord (6.0.1)
+      activemodel (= 6.0.1)
+      activesupport (= 6.0.1)
     activerecord-import (1.0.3)
       activerecord (>= 3.2)
     activerecord-import (1.0.3)
       activerecord (>= 3.2)
-    activestorage (5.2.3)
-      actionpack (= 5.2.3)
-      activerecord (= 5.2.3)
+    activestorage (6.0.1)
+      actionpack (= 6.0.1)
+      activejob (= 6.0.1)
+      activerecord (= 6.0.1)
       marcel (~> 0.3.1)
       marcel (~> 0.3.1)
-    activesupport (5.2.3)
+    activesupport (6.0.1)
       concurrent-ruby (~> 1.0, >= 1.0.2)
       i18n (>= 0.7, < 2)
       minitest (~> 5.1)
       tzinfo (~> 1.1)
       concurrent-ruby (~> 1.0, >= 1.0.2)
       i18n (>= 0.7, < 2)
       minitest (~> 5.1)
       tzinfo (~> 1.1)
+      zeitwerk (~> 2.2)
     addressable (2.7.0)
       public_suffix (>= 2.0.2, < 5.0)
     annotate (3.0.3)
       activerecord (>= 3.2, < 7.0)
       rake (>= 10.4, < 14.0)
     addressable (2.7.0)
       public_suffix (>= 2.0.2, < 5.0)
     annotate (3.0.3)
       activerecord (>= 3.2, < 7.0)
       rake (>= 10.4, < 14.0)
-    arel (9.0.0)
     ast (2.4.0)
     autoprefixer-rails (8.6.5)
       execjs
     ast (2.4.0)
     autoprefixer-rails (8.6.5)
       execjs
@@ -98,24 +111,19 @@ GEM
     cancancan (3.0.1)
     canonical-rails (0.2.6)
       rails (>= 4.1, < 6.1)
     cancancan (3.0.1)
     canonical-rails (0.2.6)
       rails (>= 4.1, < 6.1)
-    capybara (2.18.0)
+    capybara (3.29.0)
       addressable
       mini_mime (>= 0.1.3)
       addressable
       mini_mime (>= 0.1.3)
-      nokogiri (>= 1.3.3)
-      rack (>= 1.0.0)
-      rack-test (>= 0.5.4)
-      xpath (>= 2.0, < 4.0)
+      nokogiri (~> 1.8)
+      rack (>= 1.6.0)
+      rack-test (>= 0.6.3)
+      regexp_parser (~> 1.5)
+      xpath (~> 3.2)
+    childprocess (3.0.0)
     cliver (0.3.2)
     coderay (1.1.2)
     cliver (0.3.2)
     coderay (1.1.2)
-    coffee-rails (4.2.2)
-      coffee-script (>= 2.2.0)
-      railties (>= 4.0.0)
-    coffee-script (2.4.1)
-      coffee-script-source
-      execjs
-    coffee-script-source (1.12.2)
-    composite_primary_keys (11.1.0)
-      activerecord (~> 5.2.1)
+    composite_primary_keys (12.0.0)
+      activerecord (~> 6.0.0)
     concurrent-ruby (1.1.5)
     config (2.0.0)
       activesupport (>= 4.2)
     concurrent-ruby (1.1.5)
     config (2.0.0)
       activesupport (>= 4.2)
@@ -326,18 +334,20 @@ GEM
     rack-test (1.1.0)
       rack (>= 1.0, < 3)
     rack-uri_sanitizer (0.0.2)
     rack-test (1.1.0)
       rack (>= 1.0, < 3)
     rack-uri_sanitizer (0.0.2)
-    rails (5.2.3)
-      actioncable (= 5.2.3)
-      actionmailer (= 5.2.3)
-      actionpack (= 5.2.3)
-      actionview (= 5.2.3)
-      activejob (= 5.2.3)
-      activemodel (= 5.2.3)
-      activerecord (= 5.2.3)
-      activestorage (= 5.2.3)
-      activesupport (= 5.2.3)
+    rails (6.0.1)
+      actioncable (= 6.0.1)
+      actionmailbox (= 6.0.1)
+      actionmailer (= 6.0.1)
+      actionpack (= 6.0.1)
+      actiontext (= 6.0.1)
+      actionview (= 6.0.1)
+      activejob (= 6.0.1)
+      activemodel (= 6.0.1)
+      activerecord (= 6.0.1)
+      activestorage (= 6.0.1)
+      activesupport (= 6.0.1)
       bundler (>= 1.3.0)
       bundler (>= 1.3.0)
-      railties (= 5.2.3)
+      railties (= 6.0.1)
       sprockets-rails (>= 2.0.0)
     rails-controller-testing (1.0.4)
       actionpack (>= 5.0.1.x)
       sprockets-rails (>= 2.0.0)
     rails-controller-testing (1.0.4)
       actionpack (>= 5.0.1.x)
@@ -351,17 +361,18 @@ GEM
     rails-i18n (4.0.2)
       i18n (~> 0.6)
       rails (>= 4.0)
     rails-i18n (4.0.2)
       i18n (~> 0.6)
       rails (>= 4.0)
-    railties (5.2.3)
-      actionpack (= 5.2.3)
-      activesupport (= 5.2.3)
+    railties (6.0.1)
+      actionpack (= 6.0.1)
+      activesupport (= 6.0.1)
       method_source
       rake (>= 0.8.7)
       method_source
       rake (>= 0.8.7)
-      thor (>= 0.19.0, < 2.0)
+      thor (>= 0.20.3, < 2.0)
     rainbow (3.0.0)
     rake (13.0.1)
     rb-fsevent (0.10.3)
     rb-inotify (0.10.0)
       ffi (~> 1.0)
     rainbow (3.0.0)
     rake (13.0.1)
     rb-fsevent (0.10.3)
     rb-inotify (0.10.0)
       ffi (~> 1.0)
+    regexp_parser (1.6.0)
     request_store (1.4.1)
       rack (>= 1.4)
     rinku (2.0.6)
     request_store (1.4.1)
       rack (>= 1.4)
     rinku (2.0.6)
@@ -381,6 +392,7 @@ GEM
       rubocop (>= 0.72.0)
     ruby-openid (2.9.2)
     ruby-progressbar (1.10.1)
       rubocop (>= 0.72.0)
     ruby-openid (2.9.2)
     ruby-progressbar (1.10.1)
+    rubyzip (2.0.0)
     safe_yaml (1.0.5)
     sanitize (5.1.0)
       crass (~> 1.0.2)
     safe_yaml (1.0.5)
     sanitize (5.1.0)
       crass (~> 1.0.2)
@@ -395,6 +407,9 @@ GEM
       sprockets-rails
       tilt
     secure_headers (6.1.1)
       sprockets-rails
       tilt
     secure_headers (6.1.1)
+    selenium-webdriver (3.142.6)
+      childprocess (>= 0.5, < 4.0)
+      rubyzip (>= 1.2.2)
     simplecov (0.16.1)
       docile (~> 1.1)
       json (>= 1.8, < 3)
     simplecov (0.16.1)
       docile (~> 1.1)
       json (>= 1.8, < 3)
@@ -433,6 +448,7 @@ GEM
     websocket-extensions (0.1.4)
     xpath (3.2.0)
       nokogiri (~> 1.8)
     websocket-extensions (0.1.4)
     xpath (3.2.0)
       nokogiri (~> 1.8)
+    zeitwerk (2.2.1)
 
 PLATFORMS
   ruby
 
 PLATFORMS
   ruby
@@ -448,14 +464,13 @@ DEPENDENCIES
   better_errors
   bigdecimal (~> 1.1.0)
   binding_of_caller
   better_errors
   bigdecimal (~> 1.1.0)
   binding_of_caller
-  bootsnap (>= 1.1.0)
+  bootsnap (>= 1.4.2)
   browser
   bzip2-ffi
   cancancan
   canonical-rails
   browser
   bzip2-ffi
   cancancan
   canonical-rails
-  capybara (~> 2.13)
-  coffee-rails (~> 4.2)
-  composite_primary_keys (~> 11.1.0)
+  capybara (>= 2.15)
+  composite_primary_keys (~> 12.0.0)
   config
   coveralls
   dalli
   config
   coveralls
   dalli
@@ -496,12 +511,12 @@ DEPENDENCIES
   pg
   poltergeist
   psych
   pg
   poltergeist
   psych
-  puma (~> 3.7)
+  puma (~> 3.11)
   quad_tile (~> 1.0.1)
   r2 (~> 0.2.7)
   rack-cors
   rack-uri_sanitizer
   quad_tile (~> 1.0.1)
   r2 (~> 0.2.7)
   rack-cors
   rack-uri_sanitizer
-  rails (= 5.2.3)
+  rails (= 6.0.1)
   rails-controller-testing
   rails-i18n (~> 4.0.0)
   rinku (>= 2.0.6)
   rails-controller-testing
   rails-i18n (~> 4.0.0)
   rinku (>= 2.0.6)
@@ -512,6 +527,7 @@ DEPENDENCIES
   sanitize
   sassc-rails
   secure_headers
   sanitize
   sassc-rails
   secure_headers
+  selenium-webdriver
   strong_migrations
   uglifier (>= 1.3.0)
   validates_email_format_of (>= 1.5.1)
   strong_migrations
   uglifier (>= 1.3.0)
   validates_email_format_of (>= 1.5.1)
index ebdfd0277c784e92604855de13adda30c32203f5..9944e82a33e1e1b5e4739905632d745da75b3ab1 100755 (executable)
--- a/bin/setup
+++ b/bin/setup
@@ -1,6 +1,5 @@
 #!/usr/bin/env ruby
 require "fileutils"
 #!/usr/bin/env ruby
 require "fileutils"
-include FileUtils
 
 # path to your application root.
 APP_ROOT = File.expand_path("..", __dir__)
 
 # 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
 
   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")
 
   # 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')
   # 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 =="
   # 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"
 
   puts "\n== Removing old logs and tempfiles =="
   system! "bin/rails log:clear tmp:clear"
index 9a3976f76dd83f20c6754a8f2334b108a008f5da..e54e3bf06a18a988faa6dd7dddd2c8d9edce5cd8 100644 (file)
@@ -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
   # 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 = {
 
     config.cache_store = :memory_store
     config.public_file_server.headers = {
@@ -27,7 +28,7 @@ Rails.application.configure do
     config.cache_store = :null_store
   end
 
     config.cache_store = :null_store
   end
 
-  # Store uploaded files on the local file system (see config/storage.yml for options)
+  # Store uploaded files on the local file system (see config/storage.yml for options).
   config.active_storage.service = :local
 
   # Don't care if the mailer can't send.
   config.active_storage.service = :local
 
   # Don't care if the mailer can't send.
@@ -52,10 +53,10 @@ Rails.application.configure do
   # Suppress logger output for asset requests.
   config.assets.quiet = true
 
   # Suppress logger output for asset requests.
   config.assets.quiet = true
 
-  # Export translations automatically
+  # Export translations automatically.
   config.middleware.use I18n::JS::Middleware
 
   config.middleware.use I18n::JS::Middleware
 
-  # Raises error for missing translations
+  # Raises error for missing translations.
   # config.action_view.raise_on_missing_translations = true
 
   # Use an evented file watcher to asynchronously detect changes in source code,
   # config.action_view.raise_on_missing_translations = true
 
   # Use an evented file watcher to asynchronously detect changes in source code,
index ba781e5af68ef5d91d8b26faa328634e4dbb06e7..4016be615f300a88036e6266e3cf6864da5ac6d3 100644 (file)
@@ -22,15 +22,12 @@ Rails.application.configure do
   # Apache or NGINX already handles this.
   config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
 
   # Apache or NGINX already handles this.
   config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
 
-  # Compress JavaScripts and CSS.
-  config.assets.js_compressor = :uglifier
+  # Compress CSS using a preprocessor.
   # config.assets.css_compressor = :sass
 
   # Do not fallback to assets pipeline if a precompiled asset is missed.
   config.assets.compile = false
 
   # config.assets.css_compressor = :sass
 
   # Do not fallback to assets pipeline if a precompiled asset is missed.
   config.assets.compile = false
 
-  # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
-
   # Enable serving of images, stylesheets, and JavaScripts from an asset server.
   # config.action_controller.asset_host = 'http://assets.example.com'
 
   # Enable serving of images, stylesheets, and JavaScripts from an asset server.
   # config.action_controller.asset_host = 'http://assets.example.com'
 
@@ -38,10 +35,10 @@ Rails.application.configure do
   # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
   # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
 
   # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
   # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
 
-  # Store uploaded files on the local file system (see config/storage.yml for options)
+  # Store uploaded files on the local file system (see config/storage.yml for options).
   config.active_storage.service = Settings.storage_service.to_sym
 
   config.active_storage.service = Settings.storage_service.to_sym
 
-  # Mount Action Cable outside main process or domain
+  # 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.*/ ]
   # 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.*/ ]
@@ -62,9 +59,10 @@ Rails.application.configure do
   # Use a different cache store in production.
   # config.cache_store = :mem_cache_store
 
   # Use a different cache store in production.
   # config.cache_store = :mem_cache_store
 
-  # Use a real queuing backend for Active Job (and separate queues per environment)
+  # Use a real queuing backend for Active Job (and separate queues per environment).
   # config.active_job.queue_adapter     = :resque
   # config.active_job.queue_adapter     = :resque
-  # config.active_job.queue_name_prefix = "openstreetmap_#{Rails.env}"
+  # config.active_job.queue_name_prefix = "openstreetmap_production"
+
   config.action_mailer.perform_caching = false
 
   # Configure caching of static assets
   config.action_mailer.perform_caching = false
 
   # Configure caching of static assets
@@ -97,6 +95,27 @@ Rails.application.configure do
   # Do not dump schema after migrations.
   config.active_record.dump_schema_after_migration = false unless Settings.status == "database_offline"
 
   # Do not dump schema after migrations.
   config.active_record.dump_schema_after_migration = false unless Settings.status == "database_offline"
 
+  # Inserts middleware to perform automatic connection switching.
+  # The `database_selector` hash is used to pass options to the DatabaseSelector
+  # middleware. The `delay` is used to determine how long to wait after a write
+  # to send a subsequent read to the primary.
+  #
+  # The `database_resolver` class is used by the middleware to determine which
+  # database is appropriate to use based on the time delay.
+  #
+  # The `database_resolver_context` class is used by the middleware to set
+  # timestamps for the last write to the primary. The resolver uses the context
+  # class timestamps to determine how long to wait before reading from the
+  # replica.
+  #
+  # By default Rails will store a last write timestamp in the session. The
+  # DatabaseSelector middleware is designed as such you can define your own
+  # strategy for connection switching and pass that into the middleware through
+  # these configuration options.
+  # config.active_record.database_selector = { delay: 2.seconds }
+  # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
+  # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
+
   # Enable autoloading of dependencies.
   config.enable_dependency_loading = true
 
   # Enable autoloading of dependencies.
   config.enable_dependency_loading = true
 
index 38975deef664b54cb6332be608fb142fa7c3fe8a..fad06fe51cd83e9510843b365d39fcd6bd0c8422 100644 (file)
@@ -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.
 
 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
   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
   # 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
 
   # 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
 
   # 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
   config.active_storage.service = :test
 
   config.action_mailer.perform_caching = false
@@ -41,12 +43,12 @@ Rails.application.configure do
   # Print deprecation notices to the stderr.
   config.active_support.deprecation = :stderr
 
   # Print deprecation notices to the stderr.
   config.active_support.deprecation = :stderr
 
-  # Export translations automatically
+  # Export translations automatically.
   config.middleware.use I18n::JS::Middleware
 
   config.middleware.use I18n::JS::Middleware
 
-  # Raises error for missing translations
+  # Raises error for missing translations.
   config.action_view.raise_on_missing_translations = true
 
   config.action_view.raise_on_missing_translations = true
 
-  # Use the test adapter for ActiveJob during testing
+  # Use the test adapter for ActiveJob during testing.
   config.active_job.queue_adapter = :test
 end
   config.active_job.queue_adapter = :test
 end
index bc909108058cf927dc623dab7b515aead9aedd8d..361e2edee8a8bfd2820c2e6ce1f1d2f0340d9150 100644 (file)
@@ -1,5 +1,5 @@
-Rails.application.config.active_storage.queue = :storage
-Rails.application.config.active_storage.variable_content_types << "image/bmp"
+Rails.application.config.active_storage.queues.analysis = :storage
+Rails.application.config.active_storage.queues.purge = :storage
 
 Rails.configuration.after_initialize do
   require "active_storage/service/s3_service"
 
 Rails.configuration.after_initialize do
   require "active_storage/service/s3_service"
@@ -32,5 +32,5 @@ Rails.configuration.after_initialize do
     ActiveStorage::Variant.prepend(OpenStreetMap::ActiveStorage::Variant)
   end
 
     ActiveStorage::Variant.prepend(OpenStreetMap::ActiveStorage::Variant)
   end
 
-  ActiveStorage::Service.url_expires_in = 1.week
+  ActiveStorage.service_urls_expire_in = 1.week
 end
 end
index 255ae108e2a96b5eade11fcbb11d041dd608f5bf..15644963510fff77f0782ad83745b64362a8f937 100644 (file)
@@ -9,8 +9,6 @@ Rails.application.config.assets.manifest = Rails.root.join("tmp", "manifest.json
 # Add additional assets to the asset load path.
 Rails.application.config.assets.paths << Rails.root.join("config")
 
 # Add additional assets to the asset load path.
 Rails.application.config.assets.paths << Rails.root.join("config")
 
-# 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")
 
 # Add Yarn node_modules folder to the asset load path.
 Rails.application.config.assets.paths << Rails.root.join("node_modules")
 
index d3bcaa5ec84ac0761911dcdc0a7bf1c67f44a392..35d0f26fcdc9416ca1e1ae6501393c7154853250 100644 (file)
@@ -11,6 +11,8 @@
 #   policy.object_src  :none
 #   policy.script_src  :self, :https
 #   policy.style_src   :self, :https
 #   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"
 
 #   # 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) }
 
 # 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
 # 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
index 2bd558d2f3f24ec4f4f9884cb9b1cf4c815505dc..7992ecdce015631749f425209dd83802b54ede21 100644 (file)
@@ -1,4 +1,4 @@
-require "rack/cors"
+# Be sure to restart your server when you modify this file.
 
 # Mark CORS responses as uncacheable as we don't want a browser to
 # try and reuse a response that had a different origin, even with
 
 # Mark CORS responses as uncacheable as we don't want a browser to
 # try and reuse a response that had a different origin, even with
@@ -18,7 +18,7 @@ end
 # so browser-requests should be similarly permitted. (Though the API does not
 # require any custom headers, Ajax frameworks may automatically add headers
 # such as X-Requested-By to requests.)
 # so browser-requests should be similarly permitted. (Though the API does not
 # require any custom headers, Ajax frameworks may automatically add headers
 # such as X-Requested-By to requests.)
-Rails.configuration.middleware.use OpenStreetMap::Cors do
+Rails.application.config.middleware.insert_before 0, OpenStreetMap::Cors do
   allow do
     origins "*"
     resource "/oauth/*", :headers => :any, :methods => [:get, :post]
   allow do
     origins "*"
     resource "/oauth/*", :headers => :any, :methods => [:get, :post]
index a3e3d3aaceb3a25845a8763bfbee8d4630e9d636..34b224296cce6506a9f4240fc33083867a2fc404 100644 (file)
@@ -4,6 +4,6 @@ ActionView::Base.field_error_proc = proc do |html_tag, _instance|
   if class_attr_index
     html_tag.insert class_attr_index + 7, "field_with_errors "
   else
   if class_attr_index
     html_tag.insert class_attr_index + 7, "field_with_errors "
   else
-    html_tag.insert html_tag.index(%r{/?>}), ' class="field_with_errors"'
+    html_tag.insert html_tag.index(%r{/?>}), ' class="field_with_errors"'.html_safe
   end
 end
   end
 end
diff --git a/config/initializers/new_framework_defaults_5_2.rb b/config/initializers/new_framework_defaults_5_2.rb
new file mode 100644 (file)
index 0000000..c383d07
--- /dev/null
@@ -0,0 +1,38 @@
+# Be sure to restart your server when you modify this file.
+#
+# This file contains migration options to ease your Rails 5.2 upgrade.
+#
+# Once upgraded flip defaults one by one to migrate to the new default.
+#
+# Read the Guide for Upgrading Ruby on Rails for more info on each option.
+
+# Make Active Record use stable #cache_key alongside new #cache_version method.
+# This is needed for recyclable cache keys.
+# Rails.application.config.active_record.cache_versioning = true
+
+# Use AES-256-GCM authenticated encryption for encrypted cookies.
+# Also, embed cookie expiry in signed or encrypted cookies for increased security.
+#
+# This option is not backwards compatible with earlier Rails versions.
+# It's best enabled when your entire app is migrated and stable on 5.2.
+#
+# Existing cookies will be converted on read then written with the new scheme.
+# Rails.application.config.action_dispatch.use_authenticated_cookie_encryption = true
+
+# Use AES-256-GCM authenticated encryption as default cipher for encrypting messages
+# instead of AES-256-CBC, when use_authenticated_message_encryption is set to true.
+# Rails.application.config.active_support.use_authenticated_message_encryption = true
+
+# Add default protection from forgery to ActionController::Base instead of in
+# ApplicationController.
+# Rails.application.config.action_controller.default_protect_from_forgery = true
+
+# Store boolean values are in sqlite3 databases as 1 and 0 instead of 't' and
+# 'f' after migrating old data.
+# Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
+
+# Use SHA-1 instead of MD5 to generate non-sensitive digests, such as the ETag header.
+# Rails.application.config.active_support.use_sha1_digests = true
+
+# Make `form_with` generate id attributes for any generated HTML tags.
+# Rails.application.config.action_view.form_with_generates_ids = true
diff --git a/config/initializers/new_framework_defaults_6_0.rb b/config/initializers/new_framework_defaults_6_0.rb
new file mode 100644 (file)
index 0000000..92240ef
--- /dev/null
@@ -0,0 +1,45 @@
+# Be sure to restart your server when you modify this file.
+#
+# This file contains migration options to ease your Rails 6.0 upgrade.
+#
+# Once upgraded flip defaults one by one to migrate to the new default.
+#
+# Read the Guide for Upgrading Ruby on Rails for more info on each option.
+
+# Don't force requests from old versions of IE to be UTF-8 encoded.
+# Rails.application.config.action_view.default_enforce_utf8 = false
+
+# Embed purpose and expiry metadata inside signed and encrypted
+# cookies for increased security.
+#
+# This option is not backwards compatible with earlier Rails versions.
+# It's best enabled when your entire app is migrated and stable on 6.0.
+# Rails.application.config.action_dispatch.use_cookies_with_metadata = true
+
+# Change the return value of `ActionDispatch::Response#content_type` to Content-Type header without modification.
+# Rails.application.config.action_dispatch.return_only_media_type_on_content_type = false
+
+# Return false instead of self when enqueuing is aborted from a callback.
+# Rails.application.config.active_job.return_false_on_aborted_enqueue = true
+
+# Send Active Storage analysis and purge jobs to dedicated queues.
+# Rails.application.config.active_storage.queues.analysis = :active_storage_analysis
+# Rails.application.config.active_storage.queues.purge    = :active_storage_purge
+
+# When assigning to a collection of attachments declared via `has_many_attached`, replace existing
+# attachments instead of appending. Use #attach to add new attachments without replacing existing ones.
+# Rails.application.config.active_storage.replace_on_assign_to_many = true
+
+# Use ActionMailer::MailDeliveryJob for sending parameterized and normal mail.
+#
+# The default delivery jobs (ActionMailer::Parameterized::DeliveryJob, ActionMailer::DeliveryJob),
+# will be removed in Rails 6.1. This setting is not backwards compatible with earlier Rails versions.
+# If you send mail in the background, job workers need to have a copy of
+# MailDeliveryJob to ensure all delivery jobs are processed properly.
+# Make sure your entire app is migrated and stable on 6.0 before using this setting.
+# Rails.application.config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob"
+
+# Enable the same cache key to be reused when the object being cached of type
+# `ActiveRecord::Relation` changes by moving the volatile information (max updated at and count)
+# of the relation's cache key into the cache version to support recycling cache key.
+# Rails.application.config.active_record.collection_cache_versioning = true
index cf733efd119893abd444b9d75c53b3f09e77d4a4..bbfc3961bffef15dabb35fe0de4c409d6efb58c5 100644 (file)
@@ -10,5 +10,5 @@ end
 
 # To enable root element in JSON for ActiveRecord objects.
 # ActiveSupport.on_load(:active_record) do
 
 # To enable root element in JSON for ActiveRecord objects.
 # ActiveSupport.on_load(:active_record) do
-#  self.include_root_in_json = true
+#   self.include_root_in_json = true
 # end
 # end
index a5eccf816b2f63b7022c72adeeb2fa79b6f6f1c3..5ed44377449e9c5102f0ac5ab01c646097886a70 100644 (file)
@@ -4,8 +4,9 @@
 # the maximum value specified for Puma. Default is set to 5 threads for minimum
 # and maximum; this matches the default thread size of Active Record.
 #
 # the maximum value specified for Puma. Default is set to 5 threads for minimum
 # and maximum; this matches the default thread size of Active Record.
 #
-threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
-threads threads_count, threads_count
+max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
+min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
+threads min_threads_count, max_threads_count
 
 # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
 #
 
 # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
 #
@@ -15,8 +16,11 @@ port        ENV.fetch("PORT") { 3000 }
 #
 environment ENV.fetch("RAILS_ENV") { "development" }
 
 #
 environment ENV.fetch("RAILS_ENV") { "development" }
 
+# Specifies the `pidfile` that Puma will use.
+pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
+
 # Specifies the number of `workers` to boot in clustered mode.
 # Specifies the number of `workers` to boot in clustered mode.
-# Workers are forked webserver processes. If using threads and workers together
+# Workers are forked web server processes. If using threads and workers together
 # the concurrency of the application would be max `threads` * `workers`.
 # Workers do not work on JRuby or Windows (both of which do not support
 # processes).
 # the concurrency of the application would be max `threads` * `workers`.
 # Workers do not work on JRuby or Windows (both of which do not support
 # processes).
index 78e58d4be5ba0b3394b42232cf3d62ebdb2d5ece..d0e8c21e3ba32f4213835b506e57efb9b523608a 100644 (file)
@@ -320,8 +320,8 @@ ALTER SEQUENCE public.active_storage_blobs_id_seq OWNED BY public.active_storage
 CREATE TABLE public.ar_internal_metadata (
     key character varying NOT NULL,
     value character varying,
 CREATE TABLE public.ar_internal_metadata (
     key character varying NOT NULL,
     value character varying,
-    created_at timestamp without time zone NOT NULL,
-    updated_at timestamp without time zone NOT NULL
+    created_at timestamp(6) without time zone NOT NULL,
+    updated_at timestamp(6) without time zone NOT NULL
 );
 
 
 );
 
 
index 820829aadc6f21a79e230bd3207867834262a53e..cc191c08359a3e7a1b32e2684898714f2f54989e 100644 (file)
@@ -337,7 +337,7 @@ module Api
       assert_response :success
       assert_equal digest, Digest::MD5.hexdigest(response.body)
       assert_equal content_type, response.content_type
       assert_response :success
       assert_equal digest, Digest::MD5.hexdigest(response.body)
       assert_equal content_type, response.content_type
-      assert_equal "attachment; filename=\"#{trace.id}.#{extension}\"", @response.header["Content-Disposition"]
+      assert_equal "attachment; filename=\"#{trace.id}.#{extension}\"; filename*=UTF-8''#{trace.id}.#{extension}", @response.header["Content-Disposition"]
     end
 
     ##
     end
 
     ##
index 84a6557946eb598d6be0e1a1d2de212bfbd32148..c27d3c3db420920da1d3552f9a359c4e9b9ac439 100644 (file)
@@ -737,7 +737,7 @@ class TracesControllerTest < ActionController::TestCase
     assert_response :success
     assert_equal digest, Digest::MD5.hexdigest(response.body)
     assert_equal content_type, response.content_type
     assert_response :success
     assert_equal digest, Digest::MD5.hexdigest(response.body)
     assert_equal content_type, response.content_type
-    assert_equal "attachment; filename=\"#{trace.id}.#{extension}\"", @response.header["Content-Disposition"]
+    assert_equal "attachment; filename=\"#{trace.id}.#{extension}\"; filename*=UTF-8''#{trace.id}.#{extension}", @response.header["Content-Disposition"]
   end
 
   def check_trace_picture(trace)
   end
 
   def check_trace_picture(trace)