Update to rails 6.0.1
This commit is contained in:
parent
b6ecdb7507
commit
22cd2314e5
18 changed files with 236 additions and 110 deletions
14
Gemfile
14
Gemfile
|
@ -1,7 +1,7 @@
|
||||||
source "https://rubygems.org"
|
source "https://rubygems.org"
|
||||||
|
|
||||||
# Require rails
|
# Require rails
|
||||||
gem "rails", "5.2.3"
|
gem "rails", "6.0.1"
|
||||||
|
|
||||||
# Require things which have moved to gems in ruby 1.9
|
# Require things which have moved to gems in ruby 1.9
|
||||||
gem "bigdecimal", "~> 1.1.0", :platforms => :ruby_19
|
gem "bigdecimal", "~> 1.1.0", :platforms => :ruby_19
|
||||||
|
@ -21,9 +21,6 @@ gem "sassc-rails"
|
||||||
# Use Uglifier as compressor for JavaScript assets
|
# Use Uglifier as compressor for JavaScript assets
|
||||||
gem "uglifier", ">= 1.3.0"
|
gem "uglifier", ">= 1.3.0"
|
||||||
|
|
||||||
# Use CoffeeScript for .js.coffee assets and views
|
|
||||||
gem "coffee-rails", "~> 4.2"
|
|
||||||
|
|
||||||
# Use jquery as the JavaScript library
|
# Use jquery as the JavaScript library
|
||||||
gem "jquery-rails"
|
gem "jquery-rails"
|
||||||
|
|
||||||
|
@ -31,7 +28,7 @@ gem "jquery-rails"
|
||||||
gem "jbuilder", "~> 2.7"
|
gem "jbuilder", "~> 2.7"
|
||||||
|
|
||||||
# Reduces boot times through caching; required in config/boot.rb
|
# 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
|
# Use R2 for RTL conversion
|
||||||
gem "r2", "~> 0.2.7"
|
gem "r2", "~> 0.2.7"
|
||||||
|
@ -46,7 +43,7 @@ gem "image_optim_rails"
|
||||||
gem "active_record_union"
|
gem "active_record_union"
|
||||||
gem "activerecord-import"
|
gem "activerecord-import"
|
||||||
gem "cancancan"
|
gem "cancancan"
|
||||||
gem "composite_primary_keys", "~> 11.1.0"
|
gem "composite_primary_keys", "~> 12.0.0"
|
||||||
gem "config"
|
gem "config"
|
||||||
gem "delayed_job_active_record"
|
gem "delayed_job_active_record"
|
||||||
gem "dynamic_form"
|
gem "dynamic_form"
|
||||||
|
@ -151,10 +148,11 @@ end
|
||||||
|
|
||||||
# Needed in development as well so rake can see konacha tasks
|
# Needed in development as well so rake can see konacha tasks
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem "capybara", "~> 2.13"
|
gem "capybara", ">= 2.15"
|
||||||
gem "coveralls", :require => false
|
gem "coveralls", :require => false
|
||||||
gem "erb_lint", :require => false
|
gem "erb_lint", :require => false
|
||||||
gem "factory_bot_rails"
|
gem "factory_bot_rails"
|
||||||
gem "poltergeist"
|
gem "poltergeist"
|
||||||
gem "puma", "~> 3.7"
|
gem "puma", "~> 3.11"
|
||||||
|
gem "selenium-webdriver"
|
||||||
end
|
end
|
||||||
|
|
138
Gemfile.lock
138
Gemfile.lock
|
@ -4,57 +4,70 @@ GEM
|
||||||
SystemTimer (1.2.3)
|
SystemTimer (1.2.3)
|
||||||
aasm (5.0.6)
|
aasm (5.0.6)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
actioncable (5.2.3)
|
actioncable (6.0.1)
|
||||||
actionpack (= 5.2.3)
|
actionpack (= 6.0.1)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
websocket-driver (>= 0.6.1)
|
websocket-driver (>= 0.6.1)
|
||||||
actionmailer (5.2.3)
|
actionmailbox (6.0.1)
|
||||||
actionpack (= 5.2.3)
|
actionpack (= 6.0.1)
|
||||||
actionview (= 5.2.3)
|
activejob (= 6.0.1)
|
||||||
activejob (= 5.2.3)
|
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)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
actionpack (5.2.3)
|
actionpack (6.0.1)
|
||||||
actionview (= 5.2.3)
|
actionview (= 6.0.1)
|
||||||
activesupport (= 5.2.3)
|
activesupport (= 6.0.1)
|
||||||
rack (~> 2.0)
|
rack (~> 2.0)
|
||||||
rack-test (>= 0.6.3)
|
rack-test (>= 0.6.3)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
||||||
actionview (5.2.3)
|
actiontext (6.0.1)
|
||||||
activesupport (= 5.2.3)
|
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)
|
builder (~> 3.1)
|
||||||
erubi (~> 1.4)
|
erubi (~> 1.4)
|
||||||
rails-dom-testing (~> 2.0)
|
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)
|
active_record_union (1.3.0)
|
||||||
activerecord (>= 4.0)
|
activerecord (>= 4.0)
|
||||||
activejob (5.2.3)
|
activejob (6.0.1)
|
||||||
activesupport (= 5.2.3)
|
activesupport (= 6.0.1)
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
activemodel (5.2.3)
|
activemodel (6.0.1)
|
||||||
activesupport (= 5.2.3)
|
activesupport (= 6.0.1)
|
||||||
activerecord (5.2.3)
|
activerecord (6.0.1)
|
||||||
activemodel (= 5.2.3)
|
activemodel (= 6.0.1)
|
||||||
activesupport (= 5.2.3)
|
activesupport (= 6.0.1)
|
||||||
arel (>= 9.0)
|
|
||||||
activerecord-import (1.0.3)
|
activerecord-import (1.0.3)
|
||||||
activerecord (>= 3.2)
|
activerecord (>= 3.2)
|
||||||
activestorage (5.2.3)
|
activestorage (6.0.1)
|
||||||
actionpack (= 5.2.3)
|
actionpack (= 6.0.1)
|
||||||
activerecord (= 5.2.3)
|
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)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
i18n (>= 0.7, < 2)
|
i18n (>= 0.7, < 2)
|
||||||
minitest (~> 5.1)
|
minitest (~> 5.1)
|
||||||
tzinfo (~> 1.1)
|
tzinfo (~> 1.1)
|
||||||
|
zeitwerk (~> 2.2)
|
||||||
addressable (2.7.0)
|
addressable (2.7.0)
|
||||||
public_suffix (>= 2.0.2, < 5.0)
|
public_suffix (>= 2.0.2, < 5.0)
|
||||||
annotate (3.0.3)
|
annotate (3.0.3)
|
||||||
activerecord (>= 3.2, < 7.0)
|
activerecord (>= 3.2, < 7.0)
|
||||||
rake (>= 10.4, < 14.0)
|
rake (>= 10.4, < 14.0)
|
||||||
arel (9.0.0)
|
|
||||||
ast (2.4.0)
|
ast (2.4.0)
|
||||||
autoprefixer-rails (8.6.5)
|
autoprefixer-rails (8.6.5)
|
||||||
execjs
|
execjs
|
||||||
|
@ -98,24 +111,19 @@ GEM
|
||||||
cancancan (3.0.1)
|
cancancan (3.0.1)
|
||||||
canonical-rails (0.2.6)
|
canonical-rails (0.2.6)
|
||||||
rails (>= 4.1, < 6.1)
|
rails (>= 4.1, < 6.1)
|
||||||
capybara (2.18.0)
|
capybara (3.29.0)
|
||||||
addressable
|
addressable
|
||||||
mini_mime (>= 0.1.3)
|
mini_mime (>= 0.1.3)
|
||||||
nokogiri (>= 1.3.3)
|
nokogiri (~> 1.8)
|
||||||
rack (>= 1.0.0)
|
rack (>= 1.6.0)
|
||||||
rack-test (>= 0.5.4)
|
rack-test (>= 0.6.3)
|
||||||
xpath (>= 2.0, < 4.0)
|
regexp_parser (~> 1.5)
|
||||||
|
xpath (~> 3.2)
|
||||||
|
childprocess (3.0.0)
|
||||||
cliver (0.3.2)
|
cliver (0.3.2)
|
||||||
coderay (1.1.2)
|
coderay (1.1.2)
|
||||||
coffee-rails (4.2.2)
|
composite_primary_keys (12.0.0)
|
||||||
coffee-script (>= 2.2.0)
|
activerecord (~> 6.0.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)
|
|
||||||
concurrent-ruby (1.1.5)
|
concurrent-ruby (1.1.5)
|
||||||
config (2.0.0)
|
config (2.0.0)
|
||||||
activesupport (>= 4.2)
|
activesupport (>= 4.2)
|
||||||
|
@ -326,18 +334,20 @@ GEM
|
||||||
rack-test (1.1.0)
|
rack-test (1.1.0)
|
||||||
rack (>= 1.0, < 3)
|
rack (>= 1.0, < 3)
|
||||||
rack-uri_sanitizer (0.0.2)
|
rack-uri_sanitizer (0.0.2)
|
||||||
rails (5.2.3)
|
rails (6.0.1)
|
||||||
actioncable (= 5.2.3)
|
actioncable (= 6.0.1)
|
||||||
actionmailer (= 5.2.3)
|
actionmailbox (= 6.0.1)
|
||||||
actionpack (= 5.2.3)
|
actionmailer (= 6.0.1)
|
||||||
actionview (= 5.2.3)
|
actionpack (= 6.0.1)
|
||||||
activejob (= 5.2.3)
|
actiontext (= 6.0.1)
|
||||||
activemodel (= 5.2.3)
|
actionview (= 6.0.1)
|
||||||
activerecord (= 5.2.3)
|
activejob (= 6.0.1)
|
||||||
activestorage (= 5.2.3)
|
activemodel (= 6.0.1)
|
||||||
activesupport (= 5.2.3)
|
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)
|
sprockets-rails (>= 2.0.0)
|
||||||
rails-controller-testing (1.0.4)
|
rails-controller-testing (1.0.4)
|
||||||
actionpack (>= 5.0.1.x)
|
actionpack (>= 5.0.1.x)
|
||||||
|
@ -351,17 +361,18 @@ GEM
|
||||||
rails-i18n (4.0.2)
|
rails-i18n (4.0.2)
|
||||||
i18n (~> 0.6)
|
i18n (~> 0.6)
|
||||||
rails (>= 4.0)
|
rails (>= 4.0)
|
||||||
railties (5.2.3)
|
railties (6.0.1)
|
||||||
actionpack (= 5.2.3)
|
actionpack (= 6.0.1)
|
||||||
activesupport (= 5.2.3)
|
activesupport (= 6.0.1)
|
||||||
method_source
|
method_source
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.19.0, < 2.0)
|
thor (>= 0.20.3, < 2.0)
|
||||||
rainbow (3.0.0)
|
rainbow (3.0.0)
|
||||||
rake (13.0.1)
|
rake (13.0.1)
|
||||||
rb-fsevent (0.10.3)
|
rb-fsevent (0.10.3)
|
||||||
rb-inotify (0.10.0)
|
rb-inotify (0.10.0)
|
||||||
ffi (~> 1.0)
|
ffi (~> 1.0)
|
||||||
|
regexp_parser (1.6.0)
|
||||||
request_store (1.4.1)
|
request_store (1.4.1)
|
||||||
rack (>= 1.4)
|
rack (>= 1.4)
|
||||||
rinku (2.0.6)
|
rinku (2.0.6)
|
||||||
|
@ -381,6 +392,7 @@ GEM
|
||||||
rubocop (>= 0.72.0)
|
rubocop (>= 0.72.0)
|
||||||
ruby-openid (2.9.2)
|
ruby-openid (2.9.2)
|
||||||
ruby-progressbar (1.10.1)
|
ruby-progressbar (1.10.1)
|
||||||
|
rubyzip (2.0.0)
|
||||||
safe_yaml (1.0.5)
|
safe_yaml (1.0.5)
|
||||||
sanitize (5.1.0)
|
sanitize (5.1.0)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
|
@ -395,6 +407,9 @@ GEM
|
||||||
sprockets-rails
|
sprockets-rails
|
||||||
tilt
|
tilt
|
||||||
secure_headers (6.1.1)
|
secure_headers (6.1.1)
|
||||||
|
selenium-webdriver (3.142.6)
|
||||||
|
childprocess (>= 0.5, < 4.0)
|
||||||
|
rubyzip (>= 1.2.2)
|
||||||
simplecov (0.16.1)
|
simplecov (0.16.1)
|
||||||
docile (~> 1.1)
|
docile (~> 1.1)
|
||||||
json (>= 1.8, < 3)
|
json (>= 1.8, < 3)
|
||||||
|
@ -433,6 +448,7 @@ GEM
|
||||||
websocket-extensions (0.1.4)
|
websocket-extensions (0.1.4)
|
||||||
xpath (3.2.0)
|
xpath (3.2.0)
|
||||||
nokogiri (~> 1.8)
|
nokogiri (~> 1.8)
|
||||||
|
zeitwerk (2.2.1)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
@ -448,14 +464,13 @@ DEPENDENCIES
|
||||||
better_errors
|
better_errors
|
||||||
bigdecimal (~> 1.1.0)
|
bigdecimal (~> 1.1.0)
|
||||||
binding_of_caller
|
binding_of_caller
|
||||||
bootsnap (>= 1.1.0)
|
bootsnap (>= 1.4.2)
|
||||||
browser
|
browser
|
||||||
bzip2-ffi
|
bzip2-ffi
|
||||||
cancancan
|
cancancan
|
||||||
canonical-rails
|
canonical-rails
|
||||||
capybara (~> 2.13)
|
capybara (>= 2.15)
|
||||||
coffee-rails (~> 4.2)
|
composite_primary_keys (~> 12.0.0)
|
||||||
composite_primary_keys (~> 11.1.0)
|
|
||||||
config
|
config
|
||||||
coveralls
|
coveralls
|
||||||
dalli
|
dalli
|
||||||
|
@ -496,12 +511,12 @@ DEPENDENCIES
|
||||||
pg
|
pg
|
||||||
poltergeist
|
poltergeist
|
||||||
psych
|
psych
|
||||||
puma (~> 3.7)
|
puma (~> 3.11)
|
||||||
quad_tile (~> 1.0.1)
|
quad_tile (~> 1.0.1)
|
||||||
r2 (~> 0.2.7)
|
r2 (~> 0.2.7)
|
||||||
rack-cors
|
rack-cors
|
||||||
rack-uri_sanitizer
|
rack-uri_sanitizer
|
||||||
rails (= 5.2.3)
|
rails (= 6.0.1)
|
||||||
rails-controller-testing
|
rails-controller-testing
|
||||||
rails-i18n (~> 4.0.0)
|
rails-i18n (~> 4.0.0)
|
||||||
rinku (>= 2.0.6)
|
rinku (>= 2.0.6)
|
||||||
|
@ -512,6 +527,7 @@ DEPENDENCIES
|
||||||
sanitize
|
sanitize
|
||||||
sassc-rails
|
sassc-rails
|
||||||
secure_headers
|
secure_headers
|
||||||
|
selenium-webdriver
|
||||||
strong_migrations
|
strong_migrations
|
||||||
uglifier (>= 1.3.0)
|
uglifier (>= 1.3.0)
|
||||||
validates_email_format_of (>= 1.5.1)
|
validates_email_format_of (>= 1.5.1)
|
||||||
|
|
12
bin/setup
12
bin/setup
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
require "fileutils"
|
require "fileutils"
|
||||||
include FileUtils
|
|
||||||
|
|
||||||
# path to your application root.
|
# path to your application root.
|
||||||
APP_ROOT = File.expand_path("..", __dir__)
|
APP_ROOT = File.expand_path("..", __dir__)
|
||||||
|
@ -9,24 +8,25 @@ def system!(*args)
|
||||||
system(*args) || abort("\n== Command #{args} failed ==")
|
system(*args) || abort("\n== Command #{args} failed ==")
|
||||||
end
|
end
|
||||||
|
|
||||||
chdir APP_ROOT do
|
FileUtils.chdir APP_ROOT do
|
||||||
# This script is a starting point to setup your application.
|
# 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.
|
# Add necessary setup steps to this file.
|
||||||
|
|
||||||
puts "== Installing dependencies =="
|
puts "== Installing dependencies =="
|
||||||
system! "gem install bundler --conservative"
|
system! "gem install bundler --conservative"
|
||||||
system("bundle check") || system!("bundle install")
|
system("bundle check") || system!("bundle install")
|
||||||
|
|
||||||
# Install JavaScript dependencies if using Yarn
|
# Install JavaScript dependencies
|
||||||
# system('bin/yarn')
|
# system('bin/yarn')
|
||||||
|
|
||||||
# puts "\n== Copying sample files =="
|
# puts "\n== Copying sample files =="
|
||||||
# unless File.exist?('config/database.yml')
|
# unless File.exist?('config/database.yml')
|
||||||
# cp 'config/database.yml.sample', 'config/database.yml'
|
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
|
||||||
# end
|
# end
|
||||||
|
|
||||||
puts "\n== Preparing database =="
|
puts "\n== Preparing database =="
|
||||||
system! "bin/rails db:setup"
|
system! "bin/rails db:prepare"
|
||||||
|
|
||||||
puts "\n== Removing old logs and tempfiles =="
|
puts "\n== Removing old logs and tempfiles =="
|
||||||
system! "bin/rails log:clear tmp:clear"
|
system! "bin/rails log:clear tmp:clear"
|
||||||
|
|
|
@ -16,6 +16,7 @@ Rails.application.configure do
|
||||||
# Run rails dev:cache to toggle caching.
|
# Run rails dev:cache to toggle caching.
|
||||||
if Rails.root.join("tmp", "caching-dev.txt").exist?
|
if Rails.root.join("tmp", "caching-dev.txt").exist?
|
||||||
config.action_controller.perform_caching = true
|
config.action_controller.perform_caching = true
|
||||||
|
config.action_controller.enable_fragment_cache_logging = true
|
||||||
|
|
||||||
config.cache_store = :memory_store
|
config.cache_store = :memory_store
|
||||||
config.public_file_server.headers = {
|
config.public_file_server.headers = {
|
||||||
|
@ -27,7 +28,7 @@ Rails.application.configure do
|
||||||
config.cache_store = :null_store
|
config.cache_store = :null_store
|
||||||
end
|
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
|
config.active_storage.service = :local
|
||||||
|
|
||||||
# Don't care if the mailer can't send.
|
# Don't care if the mailer can't send.
|
||||||
|
@ -52,10 +53,10 @@ Rails.application.configure do
|
||||||
# Suppress logger output for asset requests.
|
# Suppress logger output for asset requests.
|
||||||
config.assets.quiet = true
|
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
|
# config.action_view.raise_on_missing_translations = true
|
||||||
|
|
||||||
# Use an evented file watcher to asynchronously detect changes in source code,
|
# Use an evented file watcher to asynchronously detect changes in source code,
|
||||||
|
|
|
@ -22,15 +22,12 @@ Rails.application.configure do
|
||||||
# Apache or NGINX already handles this.
|
# Apache or NGINX already handles this.
|
||||||
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
|
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
|
||||||
|
|
||||||
# Compress JavaScripts and CSS.
|
# Compress CSS using a preprocessor.
|
||||||
config.assets.js_compressor = :uglifier
|
|
||||||
# config.assets.css_compressor = :sass
|
# config.assets.css_compressor = :sass
|
||||||
|
|
||||||
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
||||||
config.assets.compile = false
|
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.
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
||||||
# config.action_controller.asset_host = 'http://assets.example.com'
|
# 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-Sendfile' # for Apache
|
||||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
# 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.mount_path = nil
|
||||||
# config.action_cable.url = 'wss://example.com/cable'
|
# config.action_cable.url = 'wss://example.com/cable'
|
||||||
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
|
# 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.
|
# Use a different cache store in production.
|
||||||
# config.cache_store = :mem_cache_store
|
# 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
|
config.action_mailer.perform_caching = false
|
||||||
|
|
||||||
# Configure caching of static assets
|
# Configure caching of static assets
|
||||||
|
@ -97,6 +95,27 @@ Rails.application.configure do
|
||||||
# Do not dump schema after migrations.
|
# Do not dump schema after migrations.
|
||||||
config.active_record.dump_schema_after_migration = false unless Settings.status == "database_offline"
|
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.
|
# Enable autoloading of dependencies.
|
||||||
config.enable_dependency_loading = true
|
config.enable_dependency_loading = true
|
||||||
|
|
||||||
|
|
|
@ -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
|
Rails.application.configure do
|
||||||
# Settings specified here will take precedence over those in config/application.rb.
|
# 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
|
config.cache_classes = true
|
||||||
|
|
||||||
# Do not eager load code on boot. This avoids loading your whole application
|
# 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.
|
# Show full error reports and disable caching.
|
||||||
config.consider_all_requests_local = true
|
config.consider_all_requests_local = true
|
||||||
config.action_controller.perform_caching = false
|
config.action_controller.perform_caching = false
|
||||||
|
config.cache_store = :null_store
|
||||||
|
|
||||||
# Raise exceptions instead of rendering exception templates.
|
# Raise exceptions instead of rendering exception templates.
|
||||||
config.action_dispatch.show_exceptions = false
|
config.action_dispatch.show_exceptions = false
|
||||||
|
@ -28,7 +30,7 @@ Rails.application.configure do
|
||||||
# Disable request forgery protection in test environment.
|
# Disable request forgery protection in test environment.
|
||||||
config.action_controller.allow_forgery_protection = false
|
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.active_storage.service = :test
|
||||||
|
|
||||||
config.action_mailer.perform_caching = false
|
config.action_mailer.perform_caching = false
|
||||||
|
@ -41,12 +43,12 @@ Rails.application.configure do
|
||||||
# Print deprecation notices to the stderr.
|
# Print deprecation notices to the stderr.
|
||||||
config.active_support.deprecation = :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
|
config.active_job.queue_adapter = :test
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Rails.application.config.active_storage.queue = :storage
|
Rails.application.config.active_storage.queues.analysis = :storage
|
||||||
Rails.application.config.active_storage.variable_content_types << "image/bmp"
|
Rails.application.config.active_storage.queues.purge = :storage
|
||||||
|
|
||||||
Rails.configuration.after_initialize do
|
Rails.configuration.after_initialize do
|
||||||
require "active_storage/service/s3_service"
|
require "active_storage/service/s3_service"
|
||||||
|
@ -32,5 +32,5 @@ Rails.configuration.after_initialize do
|
||||||
ActiveStorage::Variant.prepend(OpenStreetMap::ActiveStorage::Variant)
|
ActiveStorage::Variant.prepend(OpenStreetMap::ActiveStorage::Variant)
|
||||||
end
|
end
|
||||||
|
|
||||||
ActiveStorage::Service.url_expires_in = 1.week
|
ActiveStorage.service_urls_expire_in = 1.week
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,8 +9,6 @@ Rails.application.config.assets.manifest = Rails.root.join("tmp", "manifest.json
|
||||||
# Add additional assets to the asset load path.
|
# Add additional assets to the asset load path.
|
||||||
Rails.application.config.assets.paths << Rails.root.join("config")
|
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.
|
# Add Yarn node_modules folder to the asset load path.
|
||||||
Rails.application.config.assets.paths << Rails.root.join("node_modules")
|
Rails.application.config.assets.paths << Rails.root.join("node_modules")
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
# policy.object_src :none
|
# policy.object_src :none
|
||||||
# policy.script_src :self, :https
|
# policy.script_src :self, :https
|
||||||
# policy.style_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
|
# # Specify URI for violation reports
|
||||||
# # policy.report_uri "/csp-violation-report-endpoint"
|
# # policy.report_uri "/csp-violation-report-endpoint"
|
||||||
|
@ -19,6 +21,9 @@
|
||||||
# If you are using UJS then enable automatic nonce generation
|
# If you are using UJS then enable automatic nonce generation
|
||||||
# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
|
# 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
|
# Report CSP violations to a specified URI
|
||||||
# For further information see the following documentation:
|
# For further information see the following documentation:
|
||||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
|
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
|
||||||
|
|
|
@ -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
|
# 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
|
# 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
|
# so browser-requests should be similarly permitted. (Though the API does not
|
||||||
# require any custom headers, Ajax frameworks may automatically add headers
|
# require any custom headers, Ajax frameworks may automatically add headers
|
||||||
# such as X-Requested-By to requests.)
|
# 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
|
allow do
|
||||||
origins "*"
|
origins "*"
|
||||||
resource "/oauth/*", :headers => :any, :methods => [:get, :post]
|
resource "/oauth/*", :headers => :any, :methods => [:get, :post]
|
||||||
|
|
|
@ -4,6 +4,6 @@ ActionView::Base.field_error_proc = proc do |html_tag, _instance|
|
||||||
if class_attr_index
|
if class_attr_index
|
||||||
html_tag.insert class_attr_index + 7, "field_with_errors "
|
html_tag.insert class_attr_index + 7, "field_with_errors "
|
||||||
else
|
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
|
||||||
|
|
38
config/initializers/new_framework_defaults_5_2.rb
Normal file
38
config/initializers/new_framework_defaults_5_2.rb
Normal file
|
@ -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
|
45
config/initializers/new_framework_defaults_6_0.rb
Normal file
45
config/initializers/new_framework_defaults_6_0.rb
Normal file
|
@ -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
|
|
@ -10,5 +10,5 @@ end
|
||||||
|
|
||||||
# To enable root element in JSON for ActiveRecord objects.
|
# To enable root element in JSON for ActiveRecord objects.
|
||||||
# ActiveSupport.on_load(:active_record) do
|
# ActiveSupport.on_load(:active_record) do
|
||||||
# self.include_root_in_json = true
|
# self.include_root_in_json = true
|
||||||
# end
|
# end
|
||||||
|
|
|
@ -4,8 +4,9 @@
|
||||||
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
# 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.
|
# and maximum; this matches the default thread size of Active Record.
|
||||||
#
|
#
|
||||||
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
|
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
|
||||||
threads threads_count, threads_count
|
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`.
|
# the concurrency of the application would be max `threads` * `workers`.
|
||||||
# Workers do not work on JRuby or Windows (both of which do not support
|
# Workers do not work on JRuby or Windows (both of which do not support
|
||||||
# processes).
|
# processes).
|
||||||
|
|
|
@ -320,8 +320,8 @@ ALTER SEQUENCE public.active_storage_blobs_id_seq OWNED BY public.active_storage
|
||||||
CREATE TABLE public.ar_internal_metadata (
|
CREATE TABLE public.ar_internal_metadata (
|
||||||
key character varying NOT NULL,
|
key character varying NOT NULL,
|
||||||
value character varying,
|
value character varying,
|
||||||
created_at timestamp without time zone NOT NULL,
|
created_at timestamp(6) without time zone NOT NULL,
|
||||||
updated_at timestamp without time zone NOT NULL
|
updated_at timestamp(6) without time zone NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -337,7 +337,7 @@ module Api
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_equal digest, Digest::MD5.hexdigest(response.body)
|
assert_equal digest, Digest::MD5.hexdigest(response.body)
|
||||||
assert_equal content_type, response.content_type
|
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
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
|
@ -737,7 +737,7 @@ class TracesControllerTest < ActionController::TestCase
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_equal digest, Digest::MD5.hexdigest(response.body)
|
assert_equal digest, Digest::MD5.hexdigest(response.body)
|
||||||
assert_equal content_type, response.content_type
|
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
|
||||||
|
|
||||||
def check_trace_picture(trace)
|
def check_trace_picture(trace)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue