From e78f476c58a0239b09d6167cdc2ae369ec472d86 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 12 Mar 2021 05:25:24 +0100 Subject: [PATCH 01/18] Remove subscription_expires_at leftover from OStatus (#15857) --- app/models/account.rb | 8 ++---- ...e_subscription_expires_at_from_accounts.rb | 7 +++++ db/schema.rb | 3 +-- spec/models/account_spec.rb | 27 ------------------- 4 files changed, 10 insertions(+), 35 deletions(-) create mode 100644 db/post_migrate/20210308133107_remove_subscription_expires_at_from_accounts.rb diff --git a/app/models/account.rb b/app/models/account.rb index 6f5bc6295c..d85fd1f6e9 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -27,7 +27,6 @@ # header_file_size :integer # header_updated_at :datetime # avatar_remote_url :string -# subscription_expires_at :datetime # locked :boolean default(FALSE), not null # header_remote_url :string default(""), not null # last_webfingered_at :datetime @@ -55,6 +54,8 @@ # class Account < ApplicationRecord + self.ignored_columns = %w(subscription_expires_at) + USERNAME_RE = /[a-z0-9_]+([a-z0-9_\.-]+[a-z0-9_]+)?/i MENTION_RE = /(?<=^|[^\/[:word:]])@((#{USERNAME_RE})(?:@[[:word:]\.\-]+[a-z0-9]+)?)/i @@ -93,7 +94,6 @@ class Account < ApplicationRecord scope :remote, -> { where.not(domain: nil) } scope :local, -> { where(domain: nil) } - scope :expiring, ->(time) { remote.where.not(subscription_expires_at: nil).where('subscription_expires_at < ?', time) } scope :partitioned, -> { order(Arel.sql('row_number() over (partition by domain)')) } scope :silenced, -> { where.not(silenced_at: nil) } scope :suspended, -> { where.not(suspended_at: nil) } @@ -190,10 +190,6 @@ class Account < ApplicationRecord "acct:#{local_username_and_domain}" end - def subscribed? - subscription_expires_at.present? - end - def searchable? !(suspended? || moved?) end diff --git a/db/post_migrate/20210308133107_remove_subscription_expires_at_from_accounts.rb b/db/post_migrate/20210308133107_remove_subscription_expires_at_from_accounts.rb new file mode 100644 index 0000000000..53e24ef261 --- /dev/null +++ b/db/post_migrate/20210308133107_remove_subscription_expires_at_from_accounts.rb @@ -0,0 +1,7 @@ +class RemoveSubscriptionExpiresAtFromAccounts < ActiveRecord::Migration[5.0] + def change + safety_assured do + remove_column :accounts, :subscription_expires_at, :datetime, null: true, default: nil + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 4b85fce8dc..4edaf56515 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2021_02_21_045109) do +ActiveRecord::Schema.define(version: 2021_03_08_133107) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -166,7 +166,6 @@ ActiveRecord::Schema.define(version: 2021_02_21_045109) do t.integer "header_file_size" t.datetime "header_updated_at" t.string "avatar_remote_url" - t.datetime "subscription_expires_at" t.boolean "locked", default: false, null: false t.string "header_remote_url", default: "", null: false t.datetime "last_webfingered_at" diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb index 1d000ed4d2..03d6f5fb0f 100644 --- a/spec/models/account_spec.rb +++ b/spec/models/account_spec.rb @@ -134,18 +134,6 @@ RSpec.describe Account, type: :model do end end - describe '#subscribed?' do - it 'returns false when no subscription expiration information is present' do - account = Fabricate(:account, subscription_expires_at: nil) - expect(account.subscribed?).to be false - end - - it 'returns true when subscription expiration has been set' do - account = Fabricate(:account, subscription_expires_at: 30.days.from_now) - expect(account.subscribed?).to be true - end - end - describe '#possibly_stale?' do let(:account) { Fabricate(:account, last_webfingered_at: last_webfingered_at) } @@ -707,21 +695,6 @@ RSpec.describe Account, type: :model do end end - describe 'expiring' do - it 'returns remote accounts with followers whose subscription expiration date is past or not given' do - local = Fabricate(:account, domain: nil) - matches = [ - { domain: 'remote', subscription_expires_at: '2000-01-01T00:00:00Z' }, - ].map(&method(:Fabricate).curry(2).call(:account)) - matches.each(&local.method(:follow!)) - Fabricate(:account, domain: 'remote', subscription_expires_at: nil) - local.follow!(Fabricate(:account, domain: 'remote', subscription_expires_at: '2000-01-03T00:00:00Z')) - local.follow!(Fabricate(:account, domain: nil, subscription_expires_at: nil)) - - expect(Account.expiring('2000-01-02T00:00:00Z').recent).to eq matches.reverse - end - end - describe 'remote' do it 'returns an array of accounts who have a domain' do account_1 = Fabricate(:account, domain: nil) From f05b0ab58aae3a5dd7abe01cf160806eec2c3b0a Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 12 Mar 2021 05:25:50 +0100 Subject: [PATCH 02/18] =?UTF-8?q?Fix=20not=20being=20able=20to=20change=20?= =?UTF-8?q?world=20filter=20expiration=20back=20to=20=E2=80=9CNever?= =?UTF-8?q?=E2=80=9D=20(#15858)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #15849 --- app/models/concerns/expireable.rb | 2 +- app/views/filters/_fields.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/concerns/expireable.rb b/app/models/concerns/expireable.rb index a66a4661b1..4d902abcba 100644 --- a/app/models/concerns/expireable.rb +++ b/app/models/concerns/expireable.rb @@ -17,7 +17,7 @@ module Expireable end def expires_in=(interval) - self.expires_at = interval.to_i.seconds.from_now if interval.present? + self.expires_at = interval.present? ? interval.to_i.seconds.from_now : nil @expires_in = interval end diff --git a/app/views/filters/_fields.html.haml b/app/views/filters/_fields.html.haml index fb94a07fce..84dcdcca51 100644 --- a/app/views/filters/_fields.html.haml +++ b/app/views/filters/_fields.html.haml @@ -2,7 +2,7 @@ .fields-row__column.fields-row__column-6.fields-group = f.input :phrase, as: :string, wrapper: :with_label, hint: false .fields-row__column.fields-row__column-6.fields-group - = f.input :expires_in, wrapper: :with_label, collection: [30.minutes, 1.hour, 6.hours, 12.hours, 1.day, 1.week].map(&:to_i), label_method: lambda { |i| I18n.t("invites.expires_in.#{i}") }, prompt: I18n.t('invites.expires_in_prompt') + = f.input :expires_in, wrapper: :with_label, collection: [30.minutes, 1.hour, 6.hours, 12.hours, 1.day, 1.week].map(&:to_i), label_method: lambda { |i| I18n.t("invites.expires_in.#{i}") }, include_blank: I18n.t('invites.expires_in_prompt') .fields-group = f.input :context, wrapper: :with_block_label, collection: CustomFilter::VALID_CONTEXTS, as: :check_boxes, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', label_method: lambda { |context| I18n.t("filters.contexts.#{context}") }, include_blank: false From f015e191793aa48695c76de6e0d43e20684e29fe Mon Sep 17 00:00:00 2001 From: gol-cha Date: Fri, 12 Mar 2021 13:32:49 +0900 Subject: [PATCH 03/18] Remove IE11 from browserslist (#15779) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 42fd6d4ed7..d4453db851 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ }, "browserslist": [ "last 2 versions", - "IE >= 11", + "not IE 11", "iOS >= 9", "not dead" ], From 32cf85aa922c2815f3f08b13f1c7abaad0a79c95 Mon Sep 17 00:00:00 2001 From: Shlee Date: Fri, 12 Mar 2021 12:33:35 +0800 Subject: [PATCH 04/18] Update Dockerfile (#15869) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 84e6435f3e..1b89a97b74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM ubuntu:20.04 as build-dep SHELL ["/usr/bin/bash", "-c"] # Install Node v12 (LTS) -ENV NODE_VER="12.20.1" +ENV NODE_VER="12.21.0" RUN ARCH= && \ dpkgArch="$(dpkg --print-architecture)" && \ case "${dpkgArch##*-}" in \ From 01c5964bf33f7bc234676a451c5bdf9433b12e88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Mar 2021 05:38:44 +0100 Subject: [PATCH 05/18] Bump rubocop from 1.9.1 to 1.11.0 (#15820) Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.9.1 to 1.11.0. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.9.1...v1.11.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index b504950355..e3a8267d46 100644 --- a/Gemfile +++ b/Gemfile @@ -138,7 +138,7 @@ group :development do gem 'letter_opener', '~> 1.7' gem 'letter_opener_web', '~> 1.4' gem 'memory_profiler' - gem 'rubocop', '~> 1.9', require: false + gem 'rubocop', '~> 1.11', require: false gem 'rubocop-rails', '~> 2.9', require: false gem 'brakeman', '~> 4.10', require: false gem 'bundler-audit', '~> 0.7', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 55d73e9aad..b4607f1d4e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -506,7 +506,7 @@ GEM redis-store (>= 1.2, < 2) redis-store (1.9.0) redis (>= 4, < 5) - regexp_parser (2.0.3) + regexp_parser (2.1.1) request_store (1.5.0) rack (>= 1.4) responders (3.0.1) @@ -541,7 +541,7 @@ GEM rspec-support (3.10.2) rspec_junit_formatter (0.4.1) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.9.1) + rubocop (1.11.0) parallel (~> 1.10) parser (>= 3.0.0.0) rainbow (>= 2.2.2, < 4.0) @@ -791,7 +791,7 @@ DEPENDENCIES rspec-rails (~> 4.1) rspec-sidekiq (~> 3.1) rspec_junit_formatter (~> 0.4) - rubocop (~> 1.9) + rubocop (~> 1.11) rubocop-rails (~> 2.9) ruby-progressbar (~> 1.11) sanitize (~> 5.2) From 0eb7728a63f14a9b20ae2ebb2a323da9c3652ef1 Mon Sep 17 00:00:00 2001 From: Alexandra Catalina Date: Thu, 11 Mar 2021 20:39:09 -0800 Subject: [PATCH 06/18] helm: upgrade elasticsearch chart to 14 (#15767) --- chart/Chart.lock | 6 +++--- chart/Chart.yaml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/chart/Chart.lock b/chart/Chart.lock index 7ed405bf79..7b68a2ed2a 100644 --- a/chart/Chart.lock +++ b/chart/Chart.lock @@ -1,12 +1,12 @@ dependencies: - name: elasticsearch repository: https://charts.bitnami.com/bitnami - version: 12.8.2 + version: 14.2.3 - name: postgresql repository: https://charts.bitnami.com/bitnami version: 8.10.14 - name: redis repository: https://charts.bitnami.com/bitnami version: 10.9.0 -digest: sha256:9e423aa9a7a46f49e44f0411d61afd685eedf4475752a2b1a24a86a83b0752d0 -generated: "2021-02-16T17:10:49.594247-08:00" +digest: sha256:9e3e7b987c6ffba9295a30b7fae2613fe680c2b1a1832ff5afb185414ce1898e +generated: "2021-02-27T01:01:12.776919968Z" diff --git a/chart/Chart.yaml b/chart/Chart.yaml index 72d710a050..8f1976cf7f 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.1.0 +version: 1.1.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to @@ -24,7 +24,7 @@ appVersion: 3.3.0 dependencies: - name: elasticsearch - version: 12.8.2 + version: 14.2.3 repository: https://charts.bitnami.com/bitnami condition: elasticsearch.enabled - name: postgresql From 182f2661fce7adc2deca76f66246e8bbb73901fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Mar 2021 05:39:58 +0100 Subject: [PATCH 07/18] Bump sidekiq-unique-jobs from 6.0.25 to 7.0.1 (#15627) * Bump sidekiq-unique-jobs from 6.0.25 to 7.0.1 Bumps [sidekiq-unique-jobs](https://github.com/mhenrixon/sidekiq-unique-jobs) from 6.0.25 to 7.0.1. - [Release notes](https://github.com/mhenrixon/sidekiq-unique-jobs/releases) - [Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/CHANGELOG.md) - [Commits](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.25...v7.0.1) Signed-off-by: dependabot[bot] * Fix migration being broken by sidekiq-unique-jobs update * Fix migration script following API changes in dependency * Fixup Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: ThibG --- Gemfile | 2 +- Gemfile.lock | 10 +++++++--- db/migrate/20200508212852_reset_unique_jobs_locks.rb | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index e3a8267d46..a4a2cc91c3 100644 --- a/Gemfile +++ b/Gemfile @@ -85,7 +85,7 @@ gem 'sanitize', '~> 5.2' gem 'scenic', '~> 1.5' gem 'sidekiq', '~> 6.1' gem 'sidekiq-scheduler', '~> 3.0' -gem 'sidekiq-unique-jobs', '~> 6.0' +gem 'sidekiq-unique-jobs', '~> 7.0' gem 'sidekiq-bulk', '~>0.2.0' gem 'simple-navigation', '~> 4.1' gem 'simple_form', '~> 5.1' diff --git a/Gemfile.lock b/Gemfile.lock index b4607f1d4e..b59cfb1f31 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -108,6 +108,9 @@ GEM msgpack (~> 1.0) brakeman (4.10.1) browser (4.2.0) + brpoplpush-redis_script (0.1.1) + concurrent-ruby (~> 1.0, >= 1.0.5) + redis (>= 1.0, <= 5.0) builder (3.2.4) bullet (6.1.4) activesupport (>= 3.0.0) @@ -586,9 +589,10 @@ GEM sidekiq (>= 3) thwait tilt (>= 1.4.0) - sidekiq-unique-jobs (6.0.25) + sidekiq-unique-jobs (7.0.1) + brpoplpush-redis_script (> 0.0.0, <= 2.0.0) concurrent-ruby (~> 1.0, >= 1.0.5) - sidekiq (>= 4.0, < 7.0) + sidekiq (>= 5.0, < 7.0) thor (>= 0.20, < 2.0) simple-navigation (4.1.0) activesupport (>= 2.3.2) @@ -799,7 +803,7 @@ DEPENDENCIES sidekiq (~> 6.1) sidekiq-bulk (~> 0.2.0) sidekiq-scheduler (~> 3.0) - sidekiq-unique-jobs (~> 6.0) + sidekiq-unique-jobs (~> 7.0) simple-navigation (~> 4.1) simple_form (~> 5.1) simplecov (~> 0.21) diff --git a/db/migrate/20200508212852_reset_unique_jobs_locks.rb b/db/migrate/20200508212852_reset_unique_jobs_locks.rb index 3ffdeb0aa8..304e493223 100644 --- a/db/migrate/20200508212852_reset_unique_jobs_locks.rb +++ b/db/migrate/20200508212852_reset_unique_jobs_locks.rb @@ -5,7 +5,7 @@ class ResetUniqueJobsLocks < ActiveRecord::Migration[5.2] # We do this to clean up unique job digests that were not properly # disposed of prior to https://github.com/tootsuite/mastodon/pull/13361 - SidekiqUniqueJobs::Digests.delete_by_pattern('*', count: SidekiqUniqueJobs::Digests.count) + until SidekiqUniqueJobs::Digests.new.delete_by_pattern('*').nil?; end end def down; end From b47b75536e75f0e56c03e7c3ac5502fcebe68f4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Mar 2021 15:21:05 +0900 Subject: [PATCH 08/18] Bump faker from 2.16.0 to 2.17.0 (#15873) Bumps [faker](https://github.com/faker-ruby/faker) from 2.16.0 to 2.17.0. - [Release notes](https://github.com/faker-ruby/faker/releases) - [Changelog](https://github.com/faker-ruby/faker/blob/master/CHANGELOG.md) - [Commits](https://github.com/faker-ruby/faker/compare/v2.16.0...v2.17.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index a4a2cc91c3..6f30b2da03 100644 --- a/Gemfile +++ b/Gemfile @@ -119,7 +119,7 @@ end group :test do gem 'capybara', '~> 3.35' gem 'climate_control', '~> 0.2' - gem 'faker', '~> 2.16' + gem 'faker', '~> 2.17' gem 'microformats', '~> 4.2' gem 'rails-controller-testing', '~> 1.0' gem 'rspec-sidekiq', '~> 3.1' diff --git a/Gemfile.lock b/Gemfile.lock index b59cfb1f31..d30a0334d8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -213,7 +213,7 @@ GEM tzinfo excon (0.76.0) fabrication (2.21.1) - faker (2.16.0) + faker (2.17.0) i18n (>= 1.6, < 2) faraday (1.3.0) faraday-net_http (~> 1.0) @@ -726,7 +726,7 @@ DEPENDENCIES dotenv-rails (~> 2.7) ed25519 (~> 1.2) fabrication (~> 2.21) - faker (~> 2.16) + faker (~> 2.17) fast_blank (~> 1.0) fastimage fog-core (<= 2.1.0) From dd7e9318c9e876e36c4d6c2db16fc99eec82aa91 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Mar 2021 16:55:32 +0900 Subject: [PATCH 09/18] Bump sidekiq-unique-jobs from 6.0.25 to 7.0.4 (#15878) Bumps [sidekiq-unique-jobs](https://github.com/mhenrixon/sidekiq-unique-jobs) from 6.0.25 to 7.0.4. - [Release notes](https://github.com/mhenrixon/sidekiq-unique-jobs/releases) - [Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/CHANGELOG.md) - [Commits](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.25...v7.0.4) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index d30a0334d8..db6dcf3d73 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -589,7 +589,7 @@ GEM sidekiq (>= 3) thwait tilt (>= 1.4.0) - sidekiq-unique-jobs (7.0.1) + sidekiq-unique-jobs (7.0.4) brpoplpush-redis_script (> 0.0.0, <= 2.0.0) concurrent-ruby (~> 1.0, >= 1.0.5) sidekiq (>= 5.0, < 7.0) From 266a038fac7a33f566bcce5febe1590d74c950c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Mar 2021 16:56:43 +0900 Subject: [PATCH 10/18] Bump aws-sdk-s3 from 1.89.0 to 1.91.0 (#15879) Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.89.0 to 1.91.0. - [Release notes](https://github.com/aws/aws-sdk-ruby/releases) - [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-s3/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-ruby/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index 6f30b2da03..e4b3aa8501 100644 --- a/Gemfile +++ b/Gemfile @@ -17,7 +17,7 @@ gem 'makara', '~> 0.5' gem 'pghero', '~> 2.7' gem 'dotenv-rails', '~> 2.7' -gem 'aws-sdk-s3', '~> 1.89', require: false +gem 'aws-sdk-s3', '~> 1.91', require: false gem 'fog-core', '<= 2.1.0' gem 'fog-openstack', '~> 0.3', require: false gem 'paperclip', '~> 6.0' diff --git a/Gemfile.lock b/Gemfile.lock index db6dcf3d73..95f81d71f5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -78,21 +78,21 @@ GEM av (0.9.0) cocaine (~> 0.5.3) awrence (1.1.1) - aws-eventstream (1.1.0) - aws-partitions (1.429.0) - aws-sdk-core (3.112.0) + aws-eventstream (1.1.1) + aws-partitions (1.432.0) + aws-sdk-core (3.113.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.42.0) + aws-sdk-kms (1.43.0) aws-sdk-core (~> 3, >= 3.112.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.89.0) + aws-sdk-s3 (1.91.0) aws-sdk-core (~> 3, >= 3.112.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) - aws-sigv4 (1.2.2) + aws-sigv4 (1.2.3) aws-eventstream (~> 1, >= 1.0.2) bcrypt (3.1.16) better_errors (2.9.1) @@ -697,7 +697,7 @@ DEPENDENCIES active_record_query_trace (~> 1.8) addressable (~> 2.7) annotate (~> 3.1) - aws-sdk-s3 (~> 1.89) + aws-sdk-s3 (~> 1.91) better_errors (~> 2.9) binding_of_caller (~> 1.0) blurhash (~> 0.1) From 3356e2a4e46fd6d7aaab9c41382bc6e6a9df3540 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Mar 2021 22:11:05 +0900 Subject: [PATCH 11/18] Bump ox from 2.14.2 to 2.14.3 (#15875) Bumps [ox](https://github.com/ohler55/ox) from 2.14.2 to 2.14.3. - [Release notes](https://github.com/ohler55/ox/releases) - [Changelog](https://github.com/ohler55/ox/blob/develop/CHANGELOG.md) - [Commits](https://github.com/ohler55/ox/compare/v2.14.2...v2.14.3) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 95f81d71f5..298677f035 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -392,7 +392,7 @@ GEM openssl (2.2.0) openssl-signature_algorithm (0.4.0) orm_adapter (0.5.0) - ox (2.14.2) + ox (2.14.3) paperclip (6.0.0) activemodel (>= 4.2.0) activesupport (>= 4.2.0) From 67b904ba2ed477babb5db889befa4517d1611513 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Mar 2021 22:11:26 +0900 Subject: [PATCH 12/18] Bump parallel_tests from 3.5.1 to 3.5.2 (#15882) Bumps [parallel_tests](https://github.com/grosser/parallel_tests) from 3.5.1 to 3.5.2. - [Release notes](https://github.com/grosser/parallel_tests/releases) - [Changelog](https://github.com/grosser/parallel_tests/blob/master/CHANGELOG.md) - [Commits](https://github.com/grosser/parallel_tests/compare/v3.5.1...v3.5.2) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 298677f035..4ac27a0200 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -403,7 +403,7 @@ GEM av (~> 0.9.0) paperclip (>= 2.5.2) parallel (1.20.1) - parallel_tests (3.5.1) + parallel_tests (3.5.2) parallel parser (3.0.0.0) ast (~> 2.4.1) From d70513a7dec4b5732290906aa79a469166a87644 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Mar 2021 22:55:06 +0900 Subject: [PATCH 13/18] Bump nokogiri from 1.11.1 to 1.11.2 (#15881) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.1 to 1.11.2. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.1...v1.11.2) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4ac27a0200..5ed6a9a577 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -365,7 +365,7 @@ GEM net-ssh (>= 2.6.5, < 7.0.0) net-ssh (6.1.0) nio4r (2.5.7) - nokogiri (1.11.1) + nokogiri (1.11.2) mini_portile2 (~> 2.5.0) racc (~> 1.4) nokogumbo (2.0.4) From c35fa4338ed51cac4c9bd41f30ae4ba03ed171e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Mar 2021 23:06:29 +0900 Subject: [PATCH 14/18] Bump oj from 3.11.2 to 3.11.3 (#15874) Bumps [oj](https://github.com/ohler55/oj) from 3.11.2 to 3.11.3. - [Release notes](https://github.com/ohler55/oj/releases) - [Changelog](https://github.com/ohler55/oj/blob/develop/CHANGELOG.md) - [Commits](https://github.com/ohler55/oj/compare/v3.11.2...v3.11.3) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5ed6a9a577..5f8602a12c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -375,7 +375,7 @@ GEM concurrent-ruby (~> 1.0, >= 1.0.2) sidekiq (>= 3.5) statsd-ruby (~> 1.4, >= 1.4.0) - oj (3.11.2) + oj (3.11.3) omniauth (1.9.1) hashie (>= 3.4.6) rack (>= 1.6.2, < 3) From 5e563b4f2f379a8b304562767105c86098777c48 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 13 Mar 2021 09:04:13 +0900 Subject: [PATCH 15/18] Bump json-ld-preloaded from 3.1.4 to 3.1.5 (#15880) Bumps [json-ld-preloaded](https://github.com/ruby-rdf/json-ld-preloaded) from 3.1.4 to 3.1.5. - [Release notes](https://github.com/ruby-rdf/json-ld-preloaded/releases) - [Commits](https://github.com/ruby-rdf/json-ld-preloaded/compare/3.1.4...3.1.5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5f8602a12c..33f2242c36 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -303,7 +303,7 @@ GEM multi_json (~> 1.14) rack (~> 2.0) rdf (~> 3.1) - json-ld-preloaded (3.1.4) + json-ld-preloaded (3.1.5) json-ld (~> 3.1) rdf (~> 3.1) jsonapi-renderer (0.2.2) @@ -485,7 +485,7 @@ GEM thor (>= 0.19.0, < 2.0) rainbow (3.0.0) rake (13.0.3) - rdf (3.1.12) + rdf (3.1.13) hamster (~> 3.0) link_header (~> 0.0, >= 0.0.8) rdf-normalize (0.4.0) From bbed5ea5578ed8cd69c4a9e7d4bc3ede4f2d5924 Mon Sep 17 00:00:00 2001 From: Filipe Rodrigues Date: Mon, 15 Mar 2021 01:17:29 +0000 Subject: [PATCH 16/18] Fix reference to non-existing translation in the exports page. (#15894) The exports page showed a different "CSV" capitalisation in the "Bookmarks" row ("Csv") compared to the other rows ("CSV"). This was due to a referece to a translation string that does not exist, `bookmarks.csv`, defaulting to the key's last segment in title case. This issue was introduced in commit dcd86204 (PR #14956). (h/t @meqif for helping with figuring out the bug) --- app/views/settings/exports/show.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/settings/exports/show.html.haml b/app/views/settings/exports/show.html.haml index 18b52c0c2c..c49613fdc0 100644 --- a/app/views/settings/exports/show.html.haml +++ b/app/views/settings/exports/show.html.haml @@ -39,7 +39,7 @@ %tr %th= t('exports.bookmarks') %td= number_with_delimiter @export.total_bookmarks - %td= table_link_to 'download', t('bookmarks.csv'), settings_exports_bookmarks_path(format: :csv) + %td= table_link_to 'download', t('exports.csv'), settings_exports_bookmarks_path(format: :csv) %hr.spacer/ From 335e7f37a45797d5487cf0af21a70ed04022411a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Mar 2021 08:09:47 +0100 Subject: [PATCH 17/18] Bump pghero from 2.7.4 to 2.8.0 (#15907) Bumps [pghero](https://github.com/ankane/pghero) from 2.7.4 to 2.8.0. - [Release notes](https://github.com/ankane/pghero/releases) - [Changelog](https://github.com/ankane/pghero/blob/master/CHANGELOG.md) - [Commits](https://github.com/ankane/pghero/compare/v2.7.4...v2.8.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index e4b3aa8501..2bdf6118ea 100644 --- a/Gemfile +++ b/Gemfile @@ -14,7 +14,7 @@ gem 'rack', '~> 2.2.3' gem 'hamlit-rails', '~> 0.2' gem 'pg', '~> 1.2' gem 'makara', '~> 0.5' -gem 'pghero', '~> 2.7' +gem 'pghero', '~> 2.8' gem 'dotenv-rails', '~> 2.7' gem 'aws-sdk-s3', '~> 1.91', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 33f2242c36..7b3d113196 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -411,7 +411,7 @@ GEM pastel (0.8.0) tty-color (~> 0.5) pg (1.2.3) - pghero (2.7.4) + pghero (2.8.0) activerecord (>= 5) pkg-config (1.4.5) pluck_each (0.1.3) @@ -770,7 +770,7 @@ DEPENDENCIES parallel_tests (~> 3.5) parslet pg (~> 1.2) - pghero (~> 2.7) + pghero (~> 2.8) pkg-config (~> 1.4) pluck_each (~> 0.1.3) posix-spawn From 9f16bd9c89c3f76037477c3f2c3aeff17706e658 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 15 Mar 2021 11:17:43 +0100 Subject: [PATCH 18/18] Fix configuration for sidekiq-unique-jobs after 7.x upgrade (#15908) Remove locks from scheduled jobs --- .../scheduler/backup_cleanup_scheduler.rb | 2 +- .../scheduler/doorkeeper_cleanup_scheduler.rb | 2 +- app/workers/scheduler/email_scheduler.rb | 2 +- .../scheduler/feed_cleanup_scheduler.rb | 2 +- .../scheduler/instance_refresh_scheduler.rb | 2 +- app/workers/scheduler/ip_cleanup_scheduler.rb | 2 +- .../scheduler/media_cleanup_scheduler.rb | 2 +- app/workers/scheduler/pghero_scheduler.rb | 2 +- .../scheduler/scheduled_statuses_scheduler.rb | 2 +- .../scheduler/trending_tags_scheduler.rb | 2 +- .../scheduler/user_cleanup_scheduler.rb | 2 +- config/initializers/sidekiq.rb | 22 ++++++++++++++++--- 12 files changed, 30 insertions(+), 14 deletions(-) diff --git a/app/workers/scheduler/backup_cleanup_scheduler.rb b/app/workers/scheduler/backup_cleanup_scheduler.rb index d69ca2556a..85d5312c0a 100644 --- a/app/workers/scheduler/backup_cleanup_scheduler.rb +++ b/app/workers/scheduler/backup_cleanup_scheduler.rb @@ -3,7 +3,7 @@ class Scheduler::BackupCleanupScheduler include Sidekiq::Worker - sidekiq_options lock: :until_executed, retry: 0 + sidekiq_options retry: 0 def perform old_backups.reorder(nil).find_each(&:destroy!) diff --git a/app/workers/scheduler/doorkeeper_cleanup_scheduler.rb b/app/workers/scheduler/doorkeeper_cleanup_scheduler.rb index bb9dd49ca2..9303a352fb 100644 --- a/app/workers/scheduler/doorkeeper_cleanup_scheduler.rb +++ b/app/workers/scheduler/doorkeeper_cleanup_scheduler.rb @@ -3,7 +3,7 @@ class Scheduler::DoorkeeperCleanupScheduler include Sidekiq::Worker - sidekiq_options lock: :until_executed, retry: 0 + sidekiq_options retry: 0 def perform Doorkeeper::AccessToken.where('revoked_at IS NOT NULL').where('revoked_at < NOW()').delete_all diff --git a/app/workers/scheduler/email_scheduler.rb b/app/workers/scheduler/email_scheduler.rb index 9a73555248..c052f2fce0 100644 --- a/app/workers/scheduler/email_scheduler.rb +++ b/app/workers/scheduler/email_scheduler.rb @@ -3,7 +3,7 @@ class Scheduler::EmailScheduler include Sidekiq::Worker - sidekiq_options lock: :until_executed, retry: 0 + sidekiq_options retry: 0 FREQUENCY = 7.days.freeze SIGN_IN_OFFSET = 1.day.freeze diff --git a/app/workers/scheduler/feed_cleanup_scheduler.rb b/app/workers/scheduler/feed_cleanup_scheduler.rb index 42b29f4eca..aa0cc8b8df 100644 --- a/app/workers/scheduler/feed_cleanup_scheduler.rb +++ b/app/workers/scheduler/feed_cleanup_scheduler.rb @@ -4,7 +4,7 @@ class Scheduler::FeedCleanupScheduler include Sidekiq::Worker include Redisable - sidekiq_options lock: :until_executed, retry: 0 + sidekiq_options retry: 0 def perform clean_home_feeds! diff --git a/app/workers/scheduler/instance_refresh_scheduler.rb b/app/workers/scheduler/instance_refresh_scheduler.rb index 917404becc..2af5f38554 100644 --- a/app/workers/scheduler/instance_refresh_scheduler.rb +++ b/app/workers/scheduler/instance_refresh_scheduler.rb @@ -3,7 +3,7 @@ class Scheduler::InstanceRefreshScheduler include Sidekiq::Worker - sidekiq_options lock: :until_executed, retry: 0 + sidekiq_options retry: 0 def perform Instance.refresh diff --git a/app/workers/scheduler/ip_cleanup_scheduler.rb b/app/workers/scheduler/ip_cleanup_scheduler.rb index 853f20e251..df7e6ad56a 100644 --- a/app/workers/scheduler/ip_cleanup_scheduler.rb +++ b/app/workers/scheduler/ip_cleanup_scheduler.rb @@ -5,7 +5,7 @@ class Scheduler::IpCleanupScheduler IP_RETENTION_PERIOD = 1.year.freeze - sidekiq_options lock: :until_executed, retry: 0 + sidekiq_options retry: 0 def perform clean_ip_columns! diff --git a/app/workers/scheduler/media_cleanup_scheduler.rb b/app/workers/scheduler/media_cleanup_scheduler.rb index 671ebf6e02..24d30a6be5 100644 --- a/app/workers/scheduler/media_cleanup_scheduler.rb +++ b/app/workers/scheduler/media_cleanup_scheduler.rb @@ -3,7 +3,7 @@ class Scheduler::MediaCleanupScheduler include Sidekiq::Worker - sidekiq_options lock: :until_executed, retry: 0 + sidekiq_options retry: 0 def perform unattached_media.find_each(&:destroy) diff --git a/app/workers/scheduler/pghero_scheduler.rb b/app/workers/scheduler/pghero_scheduler.rb index cf55700486..a756b13b93 100644 --- a/app/workers/scheduler/pghero_scheduler.rb +++ b/app/workers/scheduler/pghero_scheduler.rb @@ -3,7 +3,7 @@ class Scheduler::PgheroScheduler include Sidekiq::Worker - sidekiq_options lock: :until_executed, retry: 0 + sidekiq_options retry: 0 def perform PgHero.capture_space_stats diff --git a/app/workers/scheduler/scheduled_statuses_scheduler.rb b/app/workers/scheduler/scheduled_statuses_scheduler.rb index 25df3c07de..3bf6300b3c 100644 --- a/app/workers/scheduler/scheduled_statuses_scheduler.rb +++ b/app/workers/scheduler/scheduled_statuses_scheduler.rb @@ -3,7 +3,7 @@ class Scheduler::ScheduledStatusesScheduler include Sidekiq::Worker - sidekiq_options lock: :until_executed, retry: 0 + sidekiq_options retry: 0 def perform publish_scheduled_statuses! diff --git a/app/workers/scheduler/trending_tags_scheduler.rb b/app/workers/scheduler/trending_tags_scheduler.rb index e9891424e0..94d76d010d 100644 --- a/app/workers/scheduler/trending_tags_scheduler.rb +++ b/app/workers/scheduler/trending_tags_scheduler.rb @@ -3,7 +3,7 @@ class Scheduler::TrendingTagsScheduler include Sidekiq::Worker - sidekiq_options lock: :until_executed, retry: 0 + sidekiq_options retry: 0 def perform TrendingTags.update! if Setting.trends diff --git a/app/workers/scheduler/user_cleanup_scheduler.rb b/app/workers/scheduler/user_cleanup_scheduler.rb index 8571b59e14..be0c4277da 100644 --- a/app/workers/scheduler/user_cleanup_scheduler.rb +++ b/app/workers/scheduler/user_cleanup_scheduler.rb @@ -3,7 +3,7 @@ class Scheduler::UserCleanupScheduler include Sidekiq::Worker - sidekiq_options lock: :until_executed, retry: 0 + sidekiq_options retry: 0 def perform clean_unconfirmed_accounts! diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index f2733562fb..9d348ddd08 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -14,14 +14,30 @@ Sidekiq.configure_server do |config| chain.add SidekiqErrorHandler end - config.death_handlers << lambda do |job, _ex| - digest = job['lock_digest'] - SidekiqUniqueJobs::Digests.delete_by_digest(digest) if digest + config.server_middleware do |chain| + chain.add SidekiqUniqueJobs::Middleware::Server + end + + config.client_middleware do |chain| + chain.add SidekiqUniqueJobs::Middleware::Client end + + SidekiqUniqueJobs::Server.configure(config) end Sidekiq.configure_client do |config| config.redis = redis_params + + config.client_middleware do |chain| + chain.add SidekiqUniqueJobs::Middleware::Client + end end Sidekiq.logger.level = ::Logger.const_get(ENV.fetch('RAILS_LOG_LEVEL', 'info').upcase.to_s) + +SidekiqUniqueJobs.configure do |config| + config.reaper = :ruby + config.reaper_count = 1000 + config.reaper_interval = 600 + config.reaper_timeout = 150 +end