Skip to content
This repository has been archived by the owner on Aug 2, 2020. It is now read-only.

Quarantine new instances by default. #188

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maplefeline
Copy link

I cleaned up https://github.com/maplefeline/mastodon-fork/tree/citizenship.
I'm not sure this is enough to close #113 but I'm a bit stuck at the moment. Mapping an administration flag to disable this is lost to me, and without the flag approaching the tests is challenging.
Given I have seen my instance get hit with 50 new domains in an hour I'm going to continue running this patch on https://social.holomaplefeline.net

Rails.logger.info "Quarantining new domain #{username}@#{domain}"
admin = Account.joins(:user).merge(User.staff).first
ReportWorker.perform_in(
2.minutes,
Copy link
Author

Choose a reason for hiding this comment

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

This is an arbitrary way of delaying the execution until the current database transaction completes, there are probably better ways to achieve it.

Copy link
Author

Choose a reason for hiding this comment

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

without the delay, this first user remains active and unblocked.

comment: 'Quarantined new domain',
forward: false,
)
DomainBlock.new(domain: domain, severity: :suspend, reject_media: true, reject_reports: true).save!
Copy link
Author

Choose a reason for hiding this comment

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

The flags here are a paranoid level of verbose, I am aware severity: :suspend should be equivalent.

@maplefeline
Copy link
Author

Something that probably should be documented with this feature, if rails/web logs the event then that was probably initiated by a worker on the other side, if Sidekiq/worker logs the event then the new domain was probably linked from an already approved domain.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Quarantine new instances by default
1 participant