mirror of
https://github.com/internetee/registry.git
synced 2025-06-12 15:44:45 +02:00
Merge pull request #1571 from internetee/update-rails-to-5.2
Update to Rails 5.2
This commit is contained in:
commit
09936f2b70
9 changed files with 177 additions and 70 deletions
8
Gemfile
8
Gemfile
|
@ -1,8 +1,8 @@
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
# core
|
# core
|
||||||
gem 'iso8601', '0.12.1' # for dates and times
|
gem 'iso8601', '0.12.1' # for dates and times
|
||||||
gem 'rails', '~> 5.1.7'
|
gem 'rails', '~> 5.2.4.2'
|
||||||
gem 'rest-client'
|
gem 'rest-client'
|
||||||
gem 'uglifier'
|
gem 'uglifier'
|
||||||
|
|
||||||
|
@ -10,10 +10,10 @@ gem 'uglifier'
|
||||||
gem 'figaro', '1.1.1'
|
gem 'figaro', '1.1.1'
|
||||||
|
|
||||||
# model related
|
# model related
|
||||||
gem 'paper_trail', '~> 8.1'
|
gem 'paper_trail', '~> 9.2'
|
||||||
gem 'pg', '1.2.2'
|
gem 'pg', '1.2.2'
|
||||||
# 1.8 is for Rails < 5.0
|
# 1.8 is for Rails < 5.0
|
||||||
gem 'ransack', '~> 1.8'
|
gem 'ransack', '~> 2.3'
|
||||||
gem 'validates_email_format_of', '1.6.3' # validates email against RFC 2822 and RFC 3696
|
gem 'validates_email_format_of', '1.6.3' # validates email against RFC 2822 and RFC 3696
|
||||||
|
|
||||||
# 0.7.3 is the latest for Rails 4.2, however, it is absent on Rubygems server
|
# 0.7.3 is the latest for Rails 4.2, however, it is absent on Rubygems server
|
||||||
|
|
110
Gemfile.lock
110
Gemfile.lock
|
@ -68,39 +68,43 @@ GIT
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actioncable (5.1.7)
|
actioncable (5.2.4.2)
|
||||||
actionpack (= 5.1.7)
|
actionpack (= 5.2.4.2)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
websocket-driver (~> 0.6.1)
|
websocket-driver (>= 0.6.1)
|
||||||
actionmailer (5.1.7)
|
actionmailer (5.2.4.2)
|
||||||
actionpack (= 5.1.7)
|
actionpack (= 5.2.4.2)
|
||||||
actionview (= 5.1.7)
|
actionview (= 5.2.4.2)
|
||||||
activejob (= 5.1.7)
|
activejob (= 5.2.4.2)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
actionpack (5.1.7)
|
actionpack (5.2.4.2)
|
||||||
actionview (= 5.1.7)
|
actionview (= 5.2.4.2)
|
||||||
activesupport (= 5.1.7)
|
activesupport (= 5.2.4.2)
|
||||||
rack (~> 2.0)
|
rack (~> 2.0, >= 2.0.8)
|
||||||
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.0.2)
|
||||||
actionview (5.1.7)
|
actionview (5.2.4.2)
|
||||||
activesupport (= 5.1.7)
|
activesupport (= 5.2.4.2)
|
||||||
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.0, >= 1.0.3)
|
||||||
activejob (5.1.7)
|
activejob (5.2.4.2)
|
||||||
activesupport (= 5.1.7)
|
activesupport (= 5.2.4.2)
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
activemodel (5.1.7)
|
activemodel (5.2.4.2)
|
||||||
activesupport (= 5.1.7)
|
activesupport (= 5.2.4.2)
|
||||||
activerecord (5.1.7)
|
activerecord (5.2.4.2)
|
||||||
activemodel (= 5.1.7)
|
activemodel (= 5.2.4.2)
|
||||||
activesupport (= 5.1.7)
|
activesupport (= 5.2.4.2)
|
||||||
arel (~> 8.0)
|
arel (>= 9.0)
|
||||||
activesupport (5.1.7)
|
activestorage (5.2.4.2)
|
||||||
|
actionpack (= 5.2.4.2)
|
||||||
|
activerecord (= 5.2.4.2)
|
||||||
|
marcel (~> 0.3.1)
|
||||||
|
activesupport (5.2.4.2)
|
||||||
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)
|
||||||
|
@ -114,7 +118,7 @@ GEM
|
||||||
akami (1.3.1)
|
akami (1.3.1)
|
||||||
gyoku (>= 0.4.0)
|
gyoku (>= 0.4.0)
|
||||||
nokogiri
|
nokogiri
|
||||||
arel (8.0.0)
|
arel (9.0.0)
|
||||||
autodoc (0.7.3)
|
autodoc (0.7.3)
|
||||||
actionpack
|
actionpack
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
|
@ -247,15 +251,18 @@ GEM
|
||||||
keystores (0.4.0)
|
keystores (0.4.0)
|
||||||
libxml-ruby (3.1.0)
|
libxml-ruby (3.1.0)
|
||||||
logger (1.4.2)
|
logger (1.4.2)
|
||||||
loofah (2.4.0)
|
loofah (2.5.0)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
mail (2.7.1)
|
mail (2.7.1)
|
||||||
mini_mime (>= 0.1.1)
|
mini_mime (>= 0.1.1)
|
||||||
|
marcel (0.3.3)
|
||||||
|
mimemagic (~> 0.3.2)
|
||||||
method_source (0.8.2)
|
method_source (0.8.2)
|
||||||
mime-types (3.3.1)
|
mime-types (3.3.1)
|
||||||
mime-types-data (~> 3.2015)
|
mime-types-data (~> 3.2015)
|
||||||
mime-types-data (3.2019.1009)
|
mime-types-data (3.2019.1009)
|
||||||
|
mimemagic (0.3.4)
|
||||||
mina (0.3.1)
|
mina (0.3.1)
|
||||||
open4 (~> 1.3.4)
|
open4 (~> 1.3.4)
|
||||||
rake
|
rake
|
||||||
|
@ -283,11 +290,15 @@ GEM
|
||||||
nori (2.6.0)
|
nori (2.6.0)
|
||||||
open4 (1.3.4)
|
open4 (1.3.4)
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
paper_trail (8.1.2)
|
paper_trail (9.2.0)
|
||||||
activerecord (>= 4.2, < 5.2)
|
activerecord (>= 4.2, < 5.3)
|
||||||
|
paper_trail-association_tracking (< 2)
|
||||||
request_store (~> 1.1)
|
request_store (~> 1.1)
|
||||||
|
paper_trail-association_tracking (1.1.1)
|
||||||
pdfkit (0.8.4.1)
|
pdfkit (0.8.4.1)
|
||||||
pg (1.2.2)
|
pg (1.2.2)
|
||||||
|
polyamorous (2.3.2)
|
||||||
|
activerecord (>= 5.2.1)
|
||||||
pry (0.10.1)
|
pry (0.10.1)
|
||||||
coderay (~> 1.1.0)
|
coderay (~> 1.1.0)
|
||||||
method_source (~> 0.8.1)
|
method_source (~> 0.8.1)
|
||||||
|
@ -308,17 +319,18 @@ GEM
|
||||||
rack-test (1.1.0)
|
rack-test (1.1.0)
|
||||||
rack (>= 1.0, < 3)
|
rack (>= 1.0, < 3)
|
||||||
railroady (1.3.0)
|
railroady (1.3.0)
|
||||||
rails (5.1.7)
|
rails (5.2.4.2)
|
||||||
actioncable (= 5.1.7)
|
actioncable (= 5.2.4.2)
|
||||||
actionmailer (= 5.1.7)
|
actionmailer (= 5.2.4.2)
|
||||||
actionpack (= 5.1.7)
|
actionpack (= 5.2.4.2)
|
||||||
actionview (= 5.1.7)
|
actionview (= 5.2.4.2)
|
||||||
activejob (= 5.1.7)
|
activejob (= 5.2.4.2)
|
||||||
activemodel (= 5.1.7)
|
activemodel (= 5.2.4.2)
|
||||||
activerecord (= 5.1.7)
|
activerecord (= 5.2.4.2)
|
||||||
activesupport (= 5.1.7)
|
activestorage (= 5.2.4.2)
|
||||||
|
activesupport (= 5.2.4.2)
|
||||||
bundler (>= 1.3.0)
|
bundler (>= 1.3.0)
|
||||||
railties (= 5.1.7)
|
railties (= 5.2.4.2)
|
||||||
sprockets-rails (>= 2.0.0)
|
sprockets-rails (>= 2.0.0)
|
||||||
rails-dom-testing (2.0.3)
|
rails-dom-testing (2.0.3)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
|
@ -327,18 +339,18 @@ GEM
|
||||||
loofah (~> 2.3)
|
loofah (~> 2.3)
|
||||||
rails-settings-cached (0.7.2)
|
rails-settings-cached (0.7.2)
|
||||||
rails (>= 4.2.0)
|
rails (>= 4.2.0)
|
||||||
railties (5.1.7)
|
railties (5.2.4.2)
|
||||||
actionpack (= 5.1.7)
|
actionpack (= 5.2.4.2)
|
||||||
activesupport (= 5.1.7)
|
activesupport (= 5.2.4.2)
|
||||||
method_source
|
method_source
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.18.1, < 2.0)
|
thor (>= 0.19.0, < 2.0)
|
||||||
rake (13.0.1)
|
rake (13.0.1)
|
||||||
ransack (1.8.10)
|
ransack (2.3.2)
|
||||||
actionpack (>= 3.0, < 5.2)
|
activerecord (>= 5.2.1)
|
||||||
activerecord (>= 3.0, < 5.2)
|
activesupport (>= 5.2.1)
|
||||||
activesupport (>= 3.0, < 5.2)
|
|
||||||
i18n
|
i18n
|
||||||
|
polyamorous (= 2.3.2)
|
||||||
rb-fsevent (0.10.3)
|
rb-fsevent (0.10.3)
|
||||||
rb-inotify (0.10.1)
|
rb-inotify (0.10.1)
|
||||||
ffi (~> 1.0)
|
ffi (~> 1.0)
|
||||||
|
@ -425,7 +437,7 @@ GEM
|
||||||
thor (0.20.3)
|
thor (0.20.3)
|
||||||
thread_safe (0.3.6)
|
thread_safe (0.3.6)
|
||||||
tilt (2.0.10)
|
tilt (2.0.10)
|
||||||
tzinfo (1.2.6)
|
tzinfo (1.2.7)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
uglifier (4.2.0)
|
uglifier (4.2.0)
|
||||||
execjs (>= 0.3.0, < 3)
|
execjs (>= 0.3.0, < 3)
|
||||||
|
@ -448,7 +460,7 @@ GEM
|
||||||
addressable (>= 2.3.6)
|
addressable (>= 2.3.6)
|
||||||
crack (>= 0.3.2)
|
crack (>= 0.3.2)
|
||||||
hashdiff (>= 0.4.0, < 2.0.0)
|
hashdiff (>= 0.4.0, < 2.0.0)
|
||||||
websocket-driver (0.6.5)
|
websocket-driver (0.7.1)
|
||||||
websocket-extensions (>= 0.1.0)
|
websocket-extensions (>= 0.1.0)
|
||||||
websocket-extensions (0.1.4)
|
websocket-extensions (0.1.4)
|
||||||
whenever (0.9.4)
|
whenever (0.9.4)
|
||||||
|
@ -493,7 +505,7 @@ DEPENDENCIES
|
||||||
minitest (~> 5.14)
|
minitest (~> 5.14)
|
||||||
money-rails
|
money-rails
|
||||||
nokogiri
|
nokogiri
|
||||||
paper_trail (~> 8.1)
|
paper_trail (~> 9.2)
|
||||||
pdfkit
|
pdfkit
|
||||||
pg (= 1.2.2)
|
pg (= 1.2.2)
|
||||||
pry (= 0.10.1)
|
pry (= 0.10.1)
|
||||||
|
@ -501,9 +513,9 @@ DEPENDENCIES
|
||||||
que
|
que
|
||||||
que-web
|
que-web
|
||||||
railroady (= 1.3.0)
|
railroady (= 1.3.0)
|
||||||
rails (~> 5.1.7)
|
rails (~> 5.2.4.2)
|
||||||
rails-settings-cached (= 0.7.2)
|
rails-settings-cached (= 0.7.2)
|
||||||
ransack (~> 1.8)
|
ransack (~> 2.3)
|
||||||
rest-client
|
rest-client
|
||||||
sass-rails (= 5.0.6)
|
sass-rails (= 5.0.6)
|
||||||
sdoc (= 0.4.1)
|
sdoc (= 0.4.1)
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
class DomainStatus < ApplicationRecord
|
class DomainStatus < ApplicationRecord
|
||||||
include Versions # version/domain_status_version.rb
|
|
||||||
include EppErrors
|
include EppErrors
|
||||||
|
|
||||||
belongs_to :domain
|
belongs_to :domain
|
||||||
|
|
||||||
# Requests to delete the object MUST be rejected.
|
# Requests to delete the object MUST be rejected.
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __dir__)
|
||||||
load Gem.bin_path('bundler', 'bundle')
|
load Gem.bin_path('bundler', 'bundle')
|
||||||
|
|
12
bin/setup
12
bin/setup
|
@ -1,9 +1,11 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'pathname'
|
require 'pathname'
|
||||||
include FileUtils
|
include FileUtils
|
||||||
|
|
||||||
# path to your application root.
|
# path to your application root.
|
||||||
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
APP_ROOT = Pathname.new File.expand_path('../../', __dir__)
|
||||||
|
|
||||||
def system!(*args)
|
def system!(*args)
|
||||||
system(*args) || abort("\n== Command #{args} failed ==")
|
system(*args) || abort("\n== Command #{args} failed ==")
|
||||||
|
@ -20,10 +22,10 @@ chdir APP_ROOT do
|
||||||
# Install JavaScript dependencies if using Yarn
|
# Install JavaScript dependencies if using Yarn
|
||||||
# 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')
|
||||||
system! 'cp config/database.yml.sample config/database.yml'
|
system! '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:setup'
|
||||||
|
|
16
bin/yarn
16
bin/yarn
|
@ -1,11 +1,9 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
VENDOR_PATH = File.expand_path('..', __dir__)
|
APP_ROOT = File.expand_path('..', __dir__)
|
||||||
Dir.chdir(VENDOR_PATH) do
|
Dir.chdir(APP_ROOT) do
|
||||||
begin
|
exec 'yarnpkg', *ARGV
|
||||||
exec "yarnpkg #{ARGV.join(" ")}"
|
rescue Errno::ENOENT
|
||||||
rescue Errno::ENOENT
|
$stderr.puts 'Yarn executable was not detected in the system.'
|
||||||
$stderr.puts "Yarn executable was not detected in the system."
|
$stderr.puts 'Download Yarn at https://yarnpkg.com/en/docs/install'
|
||||||
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
exit 1
|
||||||
exit 1
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
25
config/initializers/content_security_policy.rb
Normal file
25
config/initializers/content_security_policy.rb
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
|
# Define an application-wide content security policy
|
||||||
|
# For further information see the following documentation
|
||||||
|
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
|
||||||
|
|
||||||
|
# Rails.application.config.content_security_policy do |policy|
|
||||||
|
# policy.default_src :self, :https
|
||||||
|
# policy.font_src :self, :https, :data
|
||||||
|
# policy.img_src :self, :https, :data
|
||||||
|
# policy.object_src :none
|
||||||
|
# policy.script_src :self, :https
|
||||||
|
# policy.style_src :self, :https
|
||||||
|
|
||||||
|
# # Specify URI for violation reports
|
||||||
|
# # policy.report_uri "/csp-violation-report-endpoint"
|
||||||
|
# end
|
||||||
|
|
||||||
|
# If you are using UJS then enable automatic nonce generation
|
||||||
|
# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
|
||||||
|
|
||||||
|
# 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
|
||||||
|
# Rails.application.config.content_security_policy_report_only = true
|
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
|
34
config/storage.yml
Normal file
34
config/storage.yml
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
test:
|
||||||
|
service: Disk
|
||||||
|
root: <%= Rails.root.join("tmp/storage") %>
|
||||||
|
|
||||||
|
local:
|
||||||
|
service: Disk
|
||||||
|
root: <%= Rails.root.join("storage") %>
|
||||||
|
|
||||||
|
# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
|
||||||
|
# amazon:
|
||||||
|
# service: S3
|
||||||
|
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
|
||||||
|
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
|
||||||
|
# region: us-east-1
|
||||||
|
# bucket: your_own_bucket
|
||||||
|
|
||||||
|
# Remember not to checkin your GCS keyfile to a repository
|
||||||
|
# google:
|
||||||
|
# service: GCS
|
||||||
|
# project: your_project
|
||||||
|
# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
|
||||||
|
# bucket: your_own_bucket
|
||||||
|
|
||||||
|
# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
|
||||||
|
# microsoft:
|
||||||
|
# service: AzureStorage
|
||||||
|
# storage_account_name: your_account_name
|
||||||
|
# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
|
||||||
|
# container: your_container_name
|
||||||
|
|
||||||
|
# mirror:
|
||||||
|
# service: Mirror
|
||||||
|
# primary: local
|
||||||
|
# mirrors: [ amazon, google, microsoft ]
|
Loading…
Add table
Add a link
Reference in a new issue