From fbc8f5e200235698453c6f623cfcabd8edf84389 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 3 Jul 2026 16:35:07 +0200 Subject: [PATCH 1/2] Add migration to migrate existing local legacy keypairs to new table (#39686) --- ...02144128_migrate_local_account_keypairs.rb | 64 +++++++++++++++++++ db/schema.rb | 2 +- lib/tasks/tests.rake | 7 +- 3 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 db/post_migrate/20260702144128_migrate_local_account_keypairs.rb diff --git a/db/post_migrate/20260702144128_migrate_local_account_keypairs.rb b/db/post_migrate/20260702144128_migrate_local_account_keypairs.rb new file mode 100644 index 0000000000..664e8ca645 --- /dev/null +++ b/db/post_migrate/20260702144128_migrate_local_account_keypairs.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +class MigrateLocalAccountKeypairs < ActiveRecord::Migration[8.1] + disable_ddl_transaction! + + class Account < ApplicationRecord + has_many :keypairs, inverse_of: :account + + scope :local, -> { where(domain: nil) } + end + + class Keypair < ApplicationRecord + self.inheritance_column = nil + + encrypts :private_key + + belongs_to :account + + enum :type, { + rsa: 0, + }, validate: true + end + + def up + Account.reset_column_information + Keypair.reset_column_information + + Account.local.where.not(private_key: nil).in_batches do |accounts| + Keypair.upsert_all( + accounts.map do |account| + { + type: :rsa, + account_id: account.id, + local_fragment: '#main-key', + public_key: account.public_key, + private_key: account.private_key, + } + end, + unique_by: [:account_id, :local_fragment] + ) + + accounts.update_all(public_key: '', private_key: nil) + end + + Account.reset_column_information + Keypair.reset_column_information + end + + def down + Account.reset_column_information + Keypair.reset_column_information + + Account.local.where(private_key: nil).find_each do |account| + keypair = account.keypairs.find_by(local_fragment: '#main-key') + next if keypair.nil? + + account.update(public_key: keypair.public_key, private_key: keypair.private_key) + keypair.delete + end + + Account.reset_column_information + Keypair.reset_column_information + end +end diff --git a/db/schema.rb b/db/schema.rb index 0d11ef712f..6a753c72f9 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[8.1].define(version: 2026_07_01_161826) do +ActiveRecord::Schema[8.1].define(version: 2026_07_02_144128) do # These are extensions that must be enabled in order to support this database enable_extension "pg_catalog.plpgsql" diff --git a/lib/tasks/tests.rake b/lib/tasks/tests.rake index 6f41d07955..48d2233c93 100644 --- a/lib/tasks/tests.rake +++ b/lib/tasks/tests.rake @@ -51,11 +51,16 @@ namespace :tests do exit(1) end - if Account.find(Account::INSTANCE_ACTOR_ID).private_key.blank? + if Account.find(Account::INSTANCE_ACTOR_ID).keypair.blank? puts 'Instance actor does not have a private key' exit(1) end + if Account.local.where.not(private_key: nil).exists? + puts 'Private keys not properly migrated' + exit(1) + end + unless Account.find_by(username: 'user', domain: nil).custom_filters.map { |filter| filter.keywords.pluck(:keyword) } == [['test'], ['take']] puts 'CustomFilterKeyword records not created as expected' exit(1) From 163f96cee4dea23365bff9b433871e68d20d9ee7 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 3 Jul 2026 17:54:40 +0200 Subject: [PATCH 2/2] Bump version to v4.6.3 (#39714) --- CHANGELOG.md | 25 +++++++++++++++++++++++++ docker-compose.yml | 6 +++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a32b14065..a40d94fe80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,31 @@ All notable changes to this project will be documented in this file. +## [4.6.3] - 2026-07-03 + +### Security + +- Update dependencies + +### Added + +- Add “Update available” navigation item at top of navbar when new Mastodon versions are available (#39705 by @ClearlyClaire) +- Add rendering of post images in emails (#39636 by @diondiondion) + +### Fixed + +- Fix “view collection” menu item appearing on collection page (#39694 by @mkljczk) +- Fix incorrect filter cache key sometimes causing incorrect filters to be applied (#39698 by @ClearlyClaire) +- Fix missing `to_json` to publish announcement reaction worker (#39685 by @mjankowski) +- Fix duplicate "clear" button shown in main search input in Chrome (#39679 by @diondiondion) +- Fix visual glitch with the spoiler button (#39677 by @ChaosExAnima) +- Fix invisible username during post highlight animation (#39659 by @diondiondion) +- Fix follow button floating on profiles when overview landing page is enabled (#39650 by @FFederi) +- Fix encryption warning "read more" link (#39635 by @thomas-pike) +- Fix `tootctl media lookup` failing on some setups (#39615 by @brookmiles) +- Fix visible transparent navigation link borders in Windows forced-contrast mode (#39614 by @diondiondion) +- Fix crash with some browser extensions injecting custom elements in the page (#39507 by @OriginalRoOhi) + ## [4.6.2] - 2026-06-25 ### Security diff --git a/docker-compose.yml b/docker-compose.yml index 61dc92f3dc..c5729cd8bd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -60,7 +60,7 @@ services: web: # You can uncomment the following line if you want to not use the prebuilt image, for example if you have local code changes # build: . - image: ghcr.io/mastodon/mastodon:v4.6.2 + image: ghcr.io/mastodon/mastodon:v4.6.3 restart: always env_file: .env.production command: bundle exec puma -C config/puma.rb @@ -84,7 +84,7 @@ services: # build: # dockerfile: ./streaming/Dockerfile # context: . - image: ghcr.io/mastodon/mastodon-streaming:v4.6.2 + image: ghcr.io/mastodon/mastodon-streaming:v4.6.3 restart: always env_file: .env.production command: node ./streaming/index.js @@ -103,7 +103,7 @@ services: sidekiq: # You can uncomment the following line if you want to not use the prebuilt image, for example if you have local code changes # build: . - image: ghcr.io/mastodon/mastodon:v4.6.2 + image: ghcr.io/mastodon/mastodon:v4.6.3 restart: always env_file: .env.production command: bundle exec sidekiq