Skip to content

Add ability for users to block whole instances#2155

Open
blued-gear wants to merge 16 commits into
mainfrom
new/user_instance_blocks
Open

Add ability for users to block whole instances#2155
blued-gear wants to merge 16 commits into
mainfrom
new/user_instance_blocks

Conversation

@blued-gear

@blued-gear blued-gear commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

This PR gives users the ability to block whole instances. If blocked the Feed and Search will exclude content where the User or Magazine if from a blocked instance.

Also Admins have the option to add a block for all Users at once, as something like a "soft block".
These blocks will apply to current and future users. Users can override such a block for themselves.

Federation page:
federation

User settings with blocks
blocks

Admin Federation page:
admin

resolves #917

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Psalm found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Comment thread src/DTO/InstanceDomainsRequestDto.php Fixed
Comment thread src/EventSubscriber/Instance/InstanceBlockSubscriber.php Fixed
Comment thread src/EventSubscriber/Instance/InstancesGlobalBlockSubscriber.php Fixed
Comment thread src/Utils/SqlHelpers.php Fixed
Comment thread src/Utils/SqlHelpers.php Fixed
Comment thread src/Controller/Api/Instance/Admin/InstanceBlockGloballyApi.php Dismissed
use Symfony\Component\RateLimiter\RateLimiterFactoryInterface;
use Symfony\Component\Security\Http\Attribute\IsGranted;

class InstanceBlockGloballyApi extends InstanceBaseApi
protected function getInstancesFromDomainsRequest(): array
{
/** @var InstanceDomainsRequestDto $domains */
$domains = $this->serializer->deserialize($this->request->getCurrentRequest()->getContent(), InstanceDomainsRequestDto::class, 'json');
Comment thread src/Controller/Api/Instance/InstanceUserBlockApi.php Dismissed
use Symfony\Component\RateLimiter\RateLimiterFactoryInterface;
use Symfony\Component\Security\Http\Attribute\IsGranted;

class InstanceUserBlockApi extends InstanceBaseApi
Comment thread src/DTO/InstanceDomainsRequestDto.php Dismissed
use OpenApi\Attributes as OA;

#[OA\Schema(required: ['domains'])]
class InstanceDomainsRequestDto
@blued-gear blued-gear added enhancement New feature or request frontend Visual issues, improvements, bugs or other aspects relating mostly to the front end backend Backend related issues and pull requests api API related issues and pull requests labels Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api API related issues and pull requests backend Backend related issues and pull requests enhancement New feature or request frontend Visual issues, improvements, bugs or other aspects relating mostly to the front end

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Allows users to block instances individually

2 participants