Allow import/export of instance-level domain blocks/allows
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).
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
By the way, thanks for the prompt and thorough review! I really appreciate it!
If you have thoughts about the right way to reduce duplication between
DomainBlocksControllerandDomainAllowsController(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)
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.
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:
Ok, now I've split out the import blocks to separate pages
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?
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…
This PR is fine with me, but I imagine @Gargron may dislike it out of concern of an increasing of blindly sharing blocklists.
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.
eh, i still think this PR is fine
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.
So should I just close this?
@Gargron c'mon man
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.
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.
As a server admin I would very much like to have this.
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.
@Gargron Could you review this sometime soon please?
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.
Two other third-party options I'm aware of:
https://github.com/hachyderm/hack
https://github.com/Anthchirp/mastodon-defederate
Finally merged as part of #20597, thank you so much for your contribution!