Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Neff <benjamin@coding4coffee.ch>2022-07-17 03:09:38 +0300
committerBenjamin Neff <benjamin@coding4coffee.ch>2022-07-20 22:27:41 +0300
commitfe84d3e1017132790b4b4206562857eccafe4a10 (patch)
tree9f95f8c0a4336ed7d081f76cede8fcdcf568e58c
parent1ef3c83a0a6fccecc4336812e8ef8e0b817d0c57 (diff)
Upgrade to rails 6.1
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock126
-rwxr-xr-xbin/rails4
-rwxr-xr-xbin/rake4
-rwxr-xr-xbin/setup6
-rw-r--r--config.ru5
-rw-r--r--config/application.rb21
-rw-r--r--config/environment.rb2
-rw-r--r--config/environments/development.rb20
-rw-r--r--config/environments/production.rb18
-rw-r--r--config/environments/test.rb13
-rw-r--r--config/initializers/assets.rb5
-rw-r--r--config/initializers/backtrace_silencers.rb7
-rw-r--r--config/initializers/filter_parameter_logging.rb4
-rw-r--r--spec/helpers/application_helper_spec.rb6
15 files changed, 144 insertions, 99 deletions
diff --git a/Gemfile b/Gemfile
index 06aa176ca..d0763bdd4 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,7 +2,7 @@
source "https://rubygems.org"
-gem "rails", "6.0.5.1"
+gem "rails", "6.1.6.1"
# Legacy Rails features, remove me!
# responders (class level)
diff --git a/Gemfile.lock b/Gemfile.lock
index fe1f5cc44..7003feff2 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -2,38 +2,40 @@ GEM
remote: https://rubygems.org/
remote: https://gems.diasporafoundation.org/
specs:
- actioncable (6.0.5.1)
- actionpack (= 6.0.5.1)
+ actioncable (6.1.6.1)
+ actionpack (= 6.1.6.1)
+ activesupport (= 6.1.6.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
- actionmailbox (6.0.5.1)
- actionpack (= 6.0.5.1)
- activejob (= 6.0.5.1)
- activerecord (= 6.0.5.1)
- activestorage (= 6.0.5.1)
- activesupport (= 6.0.5.1)
+ actionmailbox (6.1.6.1)
+ actionpack (= 6.1.6.1)
+ activejob (= 6.1.6.1)
+ activerecord (= 6.1.6.1)
+ activestorage (= 6.1.6.1)
+ activesupport (= 6.1.6.1)
mail (>= 2.7.1)
- actionmailer (6.0.5.1)
- actionpack (= 6.0.5.1)
- actionview (= 6.0.5.1)
- activejob (= 6.0.5.1)
+ actionmailer (6.1.6.1)
+ actionpack (= 6.1.6.1)
+ actionview (= 6.1.6.1)
+ activejob (= 6.1.6.1)
+ activesupport (= 6.1.6.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
- actionpack (6.0.5.1)
- actionview (= 6.0.5.1)
- activesupport (= 6.0.5.1)
- rack (~> 2.0, >= 2.0.8)
+ actionpack (6.1.6.1)
+ actionview (= 6.1.6.1)
+ activesupport (= 6.1.6.1)
+ rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
- actiontext (6.0.5.1)
- actionpack (= 6.0.5.1)
- activerecord (= 6.0.5.1)
- activestorage (= 6.0.5.1)
- activesupport (= 6.0.5.1)
+ actiontext (6.1.6.1)
+ actionpack (= 6.1.6.1)
+ activerecord (= 6.1.6.1)
+ activestorage (= 6.1.6.1)
+ activesupport (= 6.1.6.1)
nokogiri (>= 1.8.5)
- actionview (6.0.5.1)
- activesupport (= 6.0.5.1)
+ actionview (6.1.6.1)
+ activesupport (= 6.1.6.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
@@ -41,27 +43,29 @@ GEM
active_model_serializers (0.9.8)
activemodel (>= 3.2)
concurrent-ruby (~> 1.0)
- activejob (6.0.5.1)
- activesupport (= 6.0.5.1)
+ activejob (6.1.6.1)
+ activesupport (= 6.1.6.1)
globalid (>= 0.3.6)
- activemodel (6.0.5.1)
- activesupport (= 6.0.5.1)
- activerecord (6.0.5.1)
- activemodel (= 6.0.5.1)
- activesupport (= 6.0.5.1)
+ activemodel (6.1.6.1)
+ activesupport (= 6.1.6.1)
+ activerecord (6.1.6.1)
+ activemodel (= 6.1.6.1)
+ activesupport (= 6.1.6.1)
activerecord-import (1.4.0)
activerecord (>= 4.2)
- activestorage (6.0.5.1)
- actionpack (= 6.0.5.1)
- activejob (= 6.0.5.1)
- activerecord (= 6.0.5.1)
+ activestorage (6.1.6.1)
+ actionpack (= 6.1.6.1)
+ activejob (= 6.1.6.1)
+ activerecord (= 6.1.6.1)
+ activesupport (= 6.1.6.1)
marcel (~> 1.0)
- activesupport (6.0.5.1)
+ mini_mime (>= 1.1.0)
+ activesupport (6.1.6.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
- i18n (>= 0.7, < 2)
- minitest (~> 5.1)
- tzinfo (~> 1.1)
- zeitwerk (~> 2.2, >= 2.2.2)
+ i18n (>= 1.6, < 2)
+ minitest (>= 5.1)
+ tzinfo (~> 2.0)
+ zeitwerk (~> 2.3)
acts-as-taggable-on (8.1.0)
activerecord (>= 5.0, < 6.2)
acts_as_api (1.0.1)
@@ -515,20 +519,20 @@ GEM
rack
rack-test (2.0.2)
rack (>= 1.3)
- rails (6.0.5.1)
- actioncable (= 6.0.5.1)
- actionmailbox (= 6.0.5.1)
- actionmailer (= 6.0.5.1)
- actionpack (= 6.0.5.1)
- actiontext (= 6.0.5.1)
- actionview (= 6.0.5.1)
- activejob (= 6.0.5.1)
- activemodel (= 6.0.5.1)
- activerecord (= 6.0.5.1)
- activestorage (= 6.0.5.1)
- activesupport (= 6.0.5.1)
- bundler (>= 1.3.0)
- railties (= 6.0.5.1)
+ rails (6.1.6.1)
+ actioncable (= 6.1.6.1)
+ actionmailbox (= 6.1.6.1)
+ actionmailer (= 6.1.6.1)
+ actionpack (= 6.1.6.1)
+ actiontext (= 6.1.6.1)
+ actionview (= 6.1.6.1)
+ activejob (= 6.1.6.1)
+ activemodel (= 6.1.6.1)
+ activerecord (= 6.1.6.1)
+ activestorage (= 6.1.6.1)
+ activesupport (= 6.1.6.1)
+ bundler (>= 1.15.0)
+ railties (= 6.1.6.1)
sprockets-rails (>= 2.0.0)
rails-assets-autosize (4.0.2)
rails-assets-backbone (1.3.3)
@@ -592,12 +596,12 @@ GEM
rails-timeago (2.20.0)
actionpack (>= 5.2)
activesupport (>= 5.2)
- railties (6.0.5.1)
- actionpack (= 6.0.5.1)
- activesupport (= 6.0.5.1)
+ railties (6.1.6.1)
+ actionpack (= 6.1.6.1)
+ activesupport (= 6.1.6.1)
method_source
- rake (>= 0.8.7)
- thor (>= 0.20.3, < 2.0)
+ rake (>= 12.2)
+ thor (~> 1.0)
rainbow (3.1.1)
raindrops (0.20.0)
rake (12.3.3)
@@ -741,8 +745,8 @@ GEM
unf (~> 0.1.0)
typhoeus (1.4.0)
ethon (>= 0.9.0)
- tzinfo (1.2.9)
- thread_safe (~> 0.1)
+ tzinfo (2.0.4)
+ concurrent-ruby (~> 1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
@@ -865,7 +869,7 @@ DEPENDENCIES
rack-piwik (= 0.3.0)
rack-rewrite (= 1.5.1)
rack-ssl (= 1.4.1)
- rails (= 6.0.5.1)
+ rails (= 6.1.6.1)
rails-assets-autosize (= 4.0.2)!
rails-assets-backbone (= 1.3.3)!
rails-assets-blueimp-gallery (= 2.33.0)!
diff --git a/bin/rails b/bin/rails
index 073966023..6fb4e4051 100755
--- a/bin/rails
+++ b/bin/rails
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../config/application', __dir__)
-require_relative '../config/boot'
-require 'rails/commands'
+require_relative "../config/boot"
+require "rails/commands"
diff --git a/bin/rake b/bin/rake
index 17240489f..4fbf10b96 100755
--- a/bin/rake
+++ b/bin/rake
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
-require_relative '../config/boot'
-require 'rake'
+require_relative "../config/boot"
+require "rake"
Rake.application.run
diff --git a/bin/setup b/bin/setup
index 0e39e8cb1..57923026c 100755
--- a/bin/setup
+++ b/bin/setup
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
-require 'fileutils'
+require "fileutils"
# path to your application root.
APP_ROOT = File.expand_path('..', __dir__)
@@ -9,8 +9,8 @@ def system!(*args)
end
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.
+ # This script is a way to set up or update your development environment automatically.
+ # This script is idempotent, so that you can run it at any time and get an expectable outcome.
# Add necessary setup steps to this file.
puts '== Installing dependencies =='
diff --git a/config.ru b/config.ru
index adee85194..99723cf22 100644
--- a/config.ru
+++ b/config.ru
@@ -6,7 +6,7 @@
# This file is used by Rack-based servers to start the application.
-require ::File.expand_path("../config/environment", __FILE__)
+require_relative "config/environment"
# Kill unicorn workers really aggressively (at 300mb)
if defined?(Unicorn)
@@ -18,4 +18,5 @@ if defined?(Unicorn)
end
use Rack::Deflater
-run Diaspora::Application
+run Rails.application
+Rails.application.load_server
diff --git a/config/application.rb b/config/application.rb
index a798f40ce..7594255f8 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -1,8 +1,8 @@
# frozen_string_literal: true
-require_relative 'boot'
+require_relative "boot"
-require 'rails/all'
+require "rails/all"
require_relative "bundler_helper"
@@ -16,16 +16,19 @@ require_relative 'asset_sync'
module Diaspora
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
- config.load_defaults 6.0
-
- # Settings in config/environments/* take precedence over those specified here.
- # Application configuration can go into files in config/initializers
- # -- all .rb files in that directory are automatically loaded after loading
- # the framework and any gems in your application.
+ config.load_defaults 6.1
# Use classic autoloader for now
config.autoloader = :classic
+ # Configuration for the application, engines, and railties goes here.
+ #
+ # These settings can be overridden in specific environments using the files
+ # in config/environments, which are processed later.
+ #
+ # config.time_zone = "Central Time (US & Canada)"
+ # config.eager_load_paths << Rails.root.join("extras")
+
# Custom directories with classes and modules you want to be autoloadable.
config.autoload_paths += %W[#{config.root}/app]
config.autoload_once_paths += %W[#{config.root}/lib]
@@ -58,8 +61,6 @@ module Diaspora
}
config.action_mailer.asset_host = AppConfig.pod_uri.to_s
- config.action_view.raise_on_missing_translations = true
-
config.middleware.use Rack::OAuth2::Server::Resource::Bearer, "OpenID Connect" do |req|
Api::OpenidConnect::OAuthAccessToken
.valid(Time.zone.now.utc).find_by(token: req.access_token) || req.invalid_token!
diff --git a/config/environment.rb b/config/environment.rb
index d5abe5580..7df99e89c 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
# Load the Rails application.
-require_relative 'application'
+require_relative "application"
# Initialize the Rails application.
Rails.application.initialize!
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 8358d6b51..4342f872a 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -1,10 +1,12 @@
# frozen_string_literal: true
+require "active_support/core_ext/integer/time"
+
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
- # In the development environment your application's code is reloaded on
- # every request. This slows down response time but is perfect for development
+ # In the development environment your application's code is reloaded any time
+ # it changes. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
@@ -41,6 +43,12 @@ Rails.application.configure do
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
+ # Raise exceptions for disallowed deprecations.
+ config.active_support.disallowed_deprecation = :raise
+
+ # Tell Active Support which deprecation messages to disallow.
+ config.active_support.disallowed_deprecation_warnings = []
+
# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
@@ -62,12 +70,18 @@ Rails.application.configure do
config.show_log_configuration = true
# Raises error for missing translations.
- # config.action_view.raise_on_missing_translations = true
+ config.i18n.raise_on_missing_translations = true
+
+ # Annotate rendered view with file names.
+ # config.action_view.annotate_rendered_view_with_filenames = true
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
+ # Uncomment if you wish to allow Action Cable access from any origin.
+ # config.action_cable.disable_request_forgery_protection = true
+
# Allow the host configured in the diaspora.toml to access the development server
config.hosts << AppConfig.pod_uri.host
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 60b0ba0f3..f3f927a8f 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -1,5 +1,7 @@
# frozen_string_literal: true
+require "active_support/core_ext/integer/time"
+
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
@@ -32,12 +34,9 @@ Rails.application.configure do
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
- # Generate digests for assets URLs.
- config.assets.digest = true
-
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
if AppConfig.environment.assets.host.present?
- config.action_controller.asset_host = AppConfig.environment.assets.host.get
+ config.asset_host = AppConfig.environment.assets.host.get
end
# Specifies the header that your server uses for sending files.
@@ -55,7 +54,8 @@ Rails.application.configure do
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
- # Log level
+ # Include generic and useful information about system operation, but avoid logging too much
+ # information to avoid inadvertent exposure of personally identifiable information (PII).
config.log_level = :info
# Prepend all log lines with the following tags.
@@ -87,11 +87,17 @@ Rails.application.configure do
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
+ # Log disallowed deprecations.
+ config.active_support.disallowed_deprecation = :log
+
+ # Tell Active Support which deprecation messages to disallow.
+ config.active_support.disallowed_deprecation_warnings = []
+
# Use default logging formatter so that PID and timestamp are not suppressed.
# config.log_formatter = ::Logger::Formatter.new
# Use a different logger for distributed setups.
- # require 'syslog/logger'
+ # require "syslog/logger"
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
# if ENV["RAILS_LOG_TO_STDOUT"].present?
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 0762db9fd..d629f1e6c 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -1,5 +1,7 @@
# frozen_string_literal: true
+require "active_support/core_ext/integer/time"
+
# 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
@@ -60,11 +62,20 @@ Rails.application.configure do
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
+ # Raise exceptions for disallowed deprecations.
+ config.active_support.disallowed_deprecation = :raise
+
+ # Tell Active Support which deprecation messages to disallow.
+ config.active_support.disallowed_deprecation_warnings = []
+
# Set the logging destination(s)
config.log_to = %w[file]
# Raises error for missing translations.
- # config.action_view.raise_on_missing_translations = true
+ config.i18n.raise_on_missing_translations = true
+
+ # Annotate rendered view with file names.
+ # config.action_view.annotate_rendered_view_with_filenames = true
# for fixture_builder
ENV["FIXTURES_PATH"] = "spec/fixtures"
diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb
index 0874787e3..81c84e115 100644
--- a/config/initializers/assets.rb
+++ b/config/initializers/assets.rb
@@ -25,4 +25,9 @@ Rails.application.config.assets.version = "1.0"
# Add Yarn node_modules folder to the asset load path.
# Rails.application.config.assets.paths << Rails.root.join("node_modules")
+# Precompile additional assets.
+# application.js, application.css, and all non-JS/CSS in the app/assets
+# folder are already added.
+# Rails.application.config.assets.precompile += %w( admin.js admin.css )
+
Rails.application.config.public_file_server.enabled = AppConfig.environment.assets.serve?
diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb
index d0f0d3b5d..9290b5041 100644
--- a/config/initializers/backtrace_silencers.rb
+++ b/config/initializers/backtrace_silencers.rb
@@ -2,7 +2,8 @@
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
-# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
+# Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) }
-# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
-# Rails.backtrace_cleaner.remove_silencers!
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code
+# by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'".
+Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"]
diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb
index dde581019..94e395494 100644
--- a/config/initializers/filter_parameter_logging.rb
+++ b/config/initializers/filter_parameter_logging.rb
@@ -3,4 +3,6 @@
# Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
-Rails.application.config.filter_parameters += %i[password otp_attempt message text bio]
+Rails.application.config.filter_parameters += %i[
+ password passw secret token _key crypt salt certificate otp otp_attempt ssn message text bio
+]
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb
index feb94673c..bf9f1d10f 100644
--- a/spec/helpers/application_helper_spec.rb
+++ b/spec/helpers/application_helper_spec.rb
@@ -48,9 +48,9 @@ describe ApplicationHelper, :type => :helper do
end
it "returns false if the service is already connected" do
- @current_user.services << FactoryGirl.build(:service, provider: "service")
- expect(AppConfig).to receive(:show_service?).with("service", alice).and_return(true)
- expect(service_unconnected?("service")).to be false
+ @current_user.services << FactoryGirl.build(:service)
+ expect(AppConfig).to receive(:show_service?).with("twitter", alice).and_return(true)
+ expect(service_unconnected?("twitter")).to be false
end
it "returns false if the the service shouldn't be shown" do