From 586a4e738cd796dc5c4d4bc9a4b2ac1a7177cc1c Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 26 Jun 2025 13:07:27 -0400 Subject: [PATCH] Move disable followers sync config into `mastodon.x` area --- app/controllers/activitypub/inboxes_controller.rb | 2 +- app/workers/activitypub/delivery_worker.rb | 2 +- config/mastodon.yml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/activitypub/inboxes_controller.rb b/app/controllers/activitypub/inboxes_controller.rb index 49cfc8ad1cb..238891bcf73 100644 --- a/app/controllers/activitypub/inboxes_controller.rb +++ b/app/controllers/activitypub/inboxes_controller.rb @@ -57,7 +57,7 @@ class ActivityPub::InboxesController < ActivityPub::BaseController def process_collection_synchronization raw_params = request.headers['Collection-Synchronization'] - return if raw_params.blank? || ENV['DISABLE_FOLLOWERS_SYNCHRONIZATION'] == 'true' || signed_request_account.nil? + return if raw_params.blank? || Rails.configuration.x.mastodon.disable_followers_synchronization || signed_request_account.nil? # Re-using the syntax for signature parameters params = SignatureParser.parse(raw_params) diff --git a/app/workers/activitypub/delivery_worker.rb b/app/workers/activitypub/delivery_worker.rb index 40b5c42404f..5606e6c1c77 100644 --- a/app/workers/activitypub/delivery_worker.rb +++ b/app/workers/activitypub/delivery_worker.rb @@ -50,7 +50,7 @@ class ActivityPub::DeliveryWorker Request.new(:post, @inbox_url, body: @json, http_client: http_client).tap do |request| request.on_behalf_of(@source_account, sign_with: @options[:sign_with]) request.add_headers(HEADERS) - request.add_headers({ 'Collection-Synchronization' => synchronization_header }) if ENV['DISABLE_FOLLOWERS_SYNCHRONIZATION'] != 'true' && @options[:synchronize_followers] + request.add_headers({ 'Collection-Synchronization' => synchronization_header }) if !Rails.configuration.x.mastodon.disable_followers_synchronization && @options[:synchronize_followers] end end diff --git a/config/mastodon.yml b/config/mastodon.yml index 4585e1f2aee..0cf0a5e1217 100644 --- a/config/mastodon.yml +++ b/config/mastodon.yml @@ -1,5 +1,6 @@ --- shared: + disable_followers_synchronization: <%= ENV.fetch('DISABLE_FOLLOWERS_SYNCHRONIZATION', nil) == 'true' %> experimental_features: <%= ENV.fetch('EXPERIMENTAL_FEATURES', nil) %> limited_federation_mode: <%= (ENV.fetch('LIMITED_FEDERATION_MODE', nil) || ENV.fetch('WHITELIST_MODE', nil)) == 'true' %> self_destruct_value: <%= ENV.fetch('SELF_DESTRUCT', nil)&.to_json %>