Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/v4.1.21 #472

Merged
merged 9 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ Changelog

All notable changes to this project will be documented in this file.

## [4.2.21] - 2024-12-03

### Fixed

- Fix inactive users' timelines being backfilled on follow and unsuspend (#33094 by @ClearlyClaire)
- Fix direct inbox delivery pushing posts into inactive followers' timelines (#33067 by @ClearlyClaire)
- Fix tl language native name (#32606 by @seav)

### Security

- Update dependencies

## [4.1.20] - 2024-09-30

### Security
Expand Down
116 changes: 58 additions & 58 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,40 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (6.1.7.8)
actionpack (= 6.1.7.8)
activesupport (= 6.1.7.8)
actioncable (6.1.7.10)
actionpack (= 6.1.7.10)
activesupport (= 6.1.7.10)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.7.8)
actionpack (= 6.1.7.8)
activejob (= 6.1.7.8)
activerecord (= 6.1.7.8)
activestorage (= 6.1.7.8)
activesupport (= 6.1.7.8)
actionmailbox (6.1.7.10)
actionpack (= 6.1.7.10)
activejob (= 6.1.7.10)
activerecord (= 6.1.7.10)
activestorage (= 6.1.7.10)
activesupport (= 6.1.7.10)
mail (>= 2.7.1)
actionmailer (6.1.7.8)
actionpack (= 6.1.7.8)
actionview (= 6.1.7.8)
activejob (= 6.1.7.8)
activesupport (= 6.1.7.8)
actionmailer (6.1.7.10)
actionpack (= 6.1.7.10)
actionview (= 6.1.7.10)
activejob (= 6.1.7.10)
activesupport (= 6.1.7.10)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.7.8)
actionview (= 6.1.7.8)
activesupport (= 6.1.7.8)
actionpack (6.1.7.10)
actionview (= 6.1.7.10)
activesupport (= 6.1.7.10)
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.1.7.8)
actionpack (= 6.1.7.8)
activerecord (= 6.1.7.8)
activestorage (= 6.1.7.8)
activesupport (= 6.1.7.8)
actiontext (6.1.7.10)
actionpack (= 6.1.7.10)
activerecord (= 6.1.7.10)
activestorage (= 6.1.7.10)
activesupport (= 6.1.7.10)
nokogiri (>= 1.8.5)
actionview (6.1.7.8)
activesupport (= 6.1.7.8)
actionview (6.1.7.10)
activesupport (= 6.1.7.10)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
Expand All @@ -54,22 +54,22 @@ GEM
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
active_record_query_trace (1.8)
activejob (6.1.7.8)
activesupport (= 6.1.7.8)
activejob (6.1.7.10)
activesupport (= 6.1.7.10)
globalid (>= 0.3.6)
activemodel (6.1.7.8)
activesupport (= 6.1.7.8)
activerecord (6.1.7.8)
activemodel (= 6.1.7.8)
activesupport (= 6.1.7.8)
activestorage (6.1.7.8)
actionpack (= 6.1.7.8)
activejob (= 6.1.7.8)
activerecord (= 6.1.7.8)
activesupport (= 6.1.7.8)
activemodel (6.1.7.10)
activesupport (= 6.1.7.10)
activerecord (6.1.7.10)
activemodel (= 6.1.7.10)
activesupport (= 6.1.7.10)
activestorage (6.1.7.10)
actionpack (= 6.1.7.10)
activejob (= 6.1.7.10)
activerecord (= 6.1.7.10)
activesupport (= 6.1.7.10)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.7.8)
activesupport (6.1.7.10)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -406,7 +406,7 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2022.0105)
mini_mime (1.1.5)
mini_portile2 (2.8.7)
mini_portile2 (2.8.8)
minitest (5.17.0)
msgpack (1.6.0)
multi_json (1.15.0)
Expand Down Expand Up @@ -498,7 +498,7 @@ GEM
activesupport (>= 3.0.0)
raabro (1.4.0)
racc (1.7.3)
rack (2.2.9)
rack (2.2.10)
rack-attack (6.6.1)
rack (>= 1.0, < 3)
rack-cors (1.1.1)
Expand All @@ -513,20 +513,20 @@ GEM
rack
rack-test (2.0.2)
rack (>= 1.3)
rails (6.1.7.8)
actioncable (= 6.1.7.8)
actionmailbox (= 6.1.7.8)
actionmailer (= 6.1.7.8)
actionpack (= 6.1.7.8)
actiontext (= 6.1.7.8)
actionview (= 6.1.7.8)
activejob (= 6.1.7.8)
activemodel (= 6.1.7.8)
activerecord (= 6.1.7.8)
activestorage (= 6.1.7.8)
activesupport (= 6.1.7.8)
rails (6.1.7.10)
actioncable (= 6.1.7.10)
actionmailbox (= 6.1.7.10)
actionmailer (= 6.1.7.10)
actionpack (= 6.1.7.10)
actiontext (= 6.1.7.10)
actionview (= 6.1.7.10)
activejob (= 6.1.7.10)
activemodel (= 6.1.7.10)
activerecord (= 6.1.7.10)
activestorage (= 6.1.7.10)
activesupport (= 6.1.7.10)
bundler (>= 1.15.0)
railties (= 6.1.7.8)
railties (= 6.1.7.10)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
Expand All @@ -542,9 +542,9 @@ GEM
railties (>= 6.0.0, < 7)
rails-settings-cached (0.6.6)
rails (>= 4.2.0)
railties (6.1.7.8)
actionpack (= 6.1.7.8)
activesupport (= 6.1.7.8)
railties (6.1.7.10)
actionpack (= 6.1.7.10)
activesupport (= 6.1.7.10)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand All @@ -566,7 +566,7 @@ GEM
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
rexml (3.3.7)
rexml (3.3.9)
rotp (6.2.0)
rpam2 (4.0.2)
rqrcode (2.1.2)
Expand Down Expand Up @@ -664,7 +664,7 @@ GEM
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
smart_properties (1.17.0)
sprockets (3.7.3)
sprockets (3.7.5)
base64
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
Expand Down Expand Up @@ -755,7 +755,7 @@ GEM
xorcist (1.1.3)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.16)
zeitwerk (2.6.18)

PLATFORMS
ruby
Expand Down
10 changes: 7 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Security Policy

If you believe you've identified a security vulnerability in Mastodon (a bug that allows something to happen that shouldn't be possible), you can reach us at <[email protected]>.
If you believe you've identified a security vulnerability in Mastodon (a bug that allows something to happen that shouldn't be possible), you can either:

You should *not* report such issues on GitHub or in other public spaces to give us time to publish a fix for the issue without exposing Mastodon's users to increased risk.
- open a [GitHub security issue on the Mastodon project](https://github.com/mastodon/mastodon/security/advisories/new)
- reach us at <[email protected]>

You should _not_ report such issues on public GitHub issues or in other public spaces to give us time to publish a fix for the issue without exposing Mastodon's users to increased risk.

## Scope

Expand All @@ -12,6 +15,7 @@ A "vulnerability in Mastodon" is a vulnerability in the code distributed through

| Version | Supported |
| ------- | ---------------- |
| 4.3.x | Yes |
| 4.2.x | Yes |
| 4.1.x | Yes |
| 4.1.x | Until 2025-04-08 |
| < 4.1 | No |
2 changes: 1 addition & 1 deletion app/helpers/languages_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ module LanguagesHelper
th: ['Thai', 'ไทย'].freeze,
ti: ['Tigrinya', 'ትግርኛ'].freeze,
tk: ['Turkmen', 'Türkmen'].freeze,
tl: ['Tagalog', 'Wikang Tagalog'].freeze,
tl: ['Tagalog', 'Tagalog'].freeze,
tn: ['Tswana', 'Setswana'].freeze,
to: ['Tonga', 'faka Tonga'].freeze,
tr: ['Turkish', 'Türkçe'].freeze,
Expand Down
9 changes: 8 additions & 1 deletion app/lib/feed_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def filter?(timeline_type, status, receiver)
# @param [Boolean] update
# @return [Boolean]
def push_to_home(account, status, update: false)
return false unless account.user&.signed_in_recently?
return false unless add_to_feed(:home, account.id, status, aggregate_reblogs: account.user&.aggregates_reblogs?)

trim(:home, account.id)
Expand All @@ -83,7 +84,9 @@ def unpush_from_home(account, status, update: false)
# @param [Boolean] update
# @return [Boolean]
def push_to_list(list, status, update: false)
return false if filter_from_list?(status, list) || !add_to_feed(:list, list.id, status, aggregate_reblogs: list.account.user&.aggregates_reblogs?)
return false if filter_from_list?(status, list)
return false unless list.account.user&.signed_in_recently?
return false unless add_to_feed(:list, list.id, status, aggregate_reblogs: list.account.user&.aggregates_reblogs?)

trim(:list, list.id)
PushUpdateWorker.perform_async(list.account_id, status.id, "timeline:list:#{list.id}", { 'update' => update }) if push_update_required?("timeline:list:#{list.id}")
Expand All @@ -107,6 +110,8 @@ def unpush_from_list(list, status, update: false)
# @param [Account] into_account
# @return [void]
def merge_into_home(from_account, into_account)
return unless into_account.user&.signed_in_recently?

timeline_key = key(:home, into_account.id)
aggregate = into_account.user&.aggregates_reblogs?
query = from_account.statuses.where(visibility: [:public, :unlisted, :private]).includes(:preloadable_poll, :media_attachments, reblog: :account).limit(FeedManager::MAX_ITEMS / 4)
Expand All @@ -133,6 +138,8 @@ def merge_into_home(from_account, into_account)
# @param [List] list
# @return [void]
def merge_into_list(from_account, list)
return unless list.account.user&.signed_in_recently?

timeline_key = key(:list, list.id)
aggregate = list.account.user&.aggregates_reblogs?
query = from_account.statuses.where(visibility: [:public, :unlisted, :private]).includes(:preloadable_poll, :media_attachments, reblog: :account).limit(FeedManager::MAX_ITEMS / 4)
Expand Down
4 changes: 4 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ def role
end
end

def signed_in_recently?
current_sign_in_at.present? && current_sign_in_at >= ACTIVE_DURATION.ago
end

def confirmed?
confirmed_at.present?
end
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ services:

web:
build: .
image: ghcr.io/mastodon/mastodon:v4.1.20
image: ghcr.io/mastodon/mastodon:v4.1.21
restart: always
env_file: .env.production
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
Expand All @@ -77,7 +77,7 @@ services:

streaming:
build: .
image: ghcr.io/mastodon/mastodon:v4.1.20
image: ghcr.io/mastodon/mastodon:v4.1.21
restart: always
env_file: .env.production
command: node ./streaming
Expand All @@ -95,7 +95,7 @@ services:

sidekiq:
build: .
image: ghcr.io/mastodon/mastodon:v4.1.20
image: ghcr.io/mastodon/mastodon:v4.1.21
restart: always
env_file: .env.production
command: bundle exec sidekiq
Expand Down
2 changes: 1 addition & 1 deletion lib/mastodon/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def minor
end

def patch
20
21
end

def flags
Expand Down
1 change: 1 addition & 0 deletions spec/fabricators/user_fabricator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
email { sequence(:email) { |i| "#{i}#{Faker::Internet.email}" } }
password "123456789"
confirmed_at { Time.zone.now }
current_sign_in_at { Time.zone.now }
agreement true
end
Loading