mastodon icon indicating copy to clipboard operation
mastodon copied to clipboard

Allow import/export of instance-level domain blocks/allows

Open Tak opened this issue 5 years ago • 21 comments

Fixes #15095

Adds an export button to the moderator federation page and an import block to the moderator add new domain block/allow page. Blocked domains are exported along with the severity level.

On import, already-blocked domains will not be modified (e.g. a currently-silenced domain will not be upgraded to suspended).

Tak avatar Feb 04 '21 11:02 Tak

You're right about the additional features.

If you have thoughts about the right way to reduce duplication between DomainBlocksController and DomainAllowsController (additional base class? mixin? …?), I'm happy to give it a try

Tak avatar Feb 04 '21 16:02 Tak

By the way, thanks for the prompt and thorough review! I really appreciate it!

Tak avatar Feb 04 '21 16:02 Tak

If you have thoughts about the right way to reduce duplication between DomainBlocksController and DomainAllowsController (additional base class? mixin? …?), I'm happy to give it a try

I'd probably use some mixin (“concerns” in Rails, like the user import/export controllers do)

ClearlyClaire avatar Feb 04 '21 17:02 ClearlyClaire

Since we're synchronously processing the file, I wonder if we wouldn't be better off just using Rails' capabilities directly rather than Paperclip through a non-persisted model, but I admit I'm not really knowledgeable in that regard.

ClearlyClaire avatar Feb 05 '21 13:02 ClearlyClaire

Good point, I'm not sure if it still makes sense to use Paperclip. I'm only using it because I was mimicking what we were doing for the account-level imports, but as you say, it's a bit different since we're not dumping everything directly to the DB. :shrug:

Tak avatar Feb 05 '21 13:02 Tak

Ok, now I've split out the import blocks to separate pages

Tak avatar Feb 09 '21 09:02 Tak

Ok, I think I've addressed everything in the current set. Do you know what's up with the new DeepSource check? Do I need to merge/rebase main?

Tak avatar Feb 11 '21 10:02 Tak

So is there a timeline for this to be considered for merging? Is the PR controversial in some way? I didn't think too much about it before Mastodon 3.4.0 was released, but now this is one of the oldest approved PRs…

Tak avatar May 18 '21 10:05 Tak

This PR is fine with me, but I imagine @Gargron may dislike it out of concern of an increasing of blindly sharing blocklists.

ClearlyClaire avatar May 18 '21 13:05 ClearlyClaire

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 19 '21 02:09 stale[bot]

eh, i still think this PR is fine

ClearlyClaire avatar Sep 19 '21 11:09 ClearlyClaire

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 16 '22 02:04 stale[bot]

So should I just close this?

Tak avatar Apr 16 '22 05:04 Tak

@Gargron c'mon man

a-dows avatar Apr 26 '22 20:04 a-dows

This PR is fine with me, but I imagine @Gargron may dislike it out of concern of an increasing of blindly sharing blocklists.

That would be a weirdly self-defeating concern. As someone who wants to admin an instance, the cognitive and cultural hurdle of worrying about allowing problematic federation is huge. Being able to start out by using the list of another instance you trust would be a huge win, for new admins and the safety of Mastodon overall.

bixfrankonis avatar May 02 '22 23:05 bixfrankonis

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 21 '22 05:09 stale[bot]

As a server admin I would very much like to have this.

nikodemus avatar Nov 02 '22 13:11 nikodemus

This is Direly needed. Adding bulk blocks to my server is an agonizing, slow, and frustrating process. 3 or 4 menus for every single domain i want to add.

to see it get fixed, and the pull request stagnate for two years is immensely disappointing.

@Gargron please, please, please just add this already.

XorOwl avatar Nov 11 '22 16:11 XorOwl

@Gargron Could you review this sometime soon please?

samuk avatar Nov 12 '22 13:11 samuk

Hey y'all, I have a temporary solution set-up over at https://mastodon-tools.dingelstad.works/ for the time being. The need for me and other admins grew to the point we just made a tiny (although hacky) script to do the work for us.

bram-dingelstad avatar Nov 12 '22 15:11 bram-dingelstad

Two other third-party options I'm aware of:

https://github.com/hachyderm/hack

https://github.com/Anthchirp/mastodon-defederate

ineffyble avatar Nov 13 '22 04:11 ineffyble

Finally merged as part of #20597, thank you so much for your contribution!

ClearlyClaire avatar Nov 17 '22 10:11 ClearlyClaire