LemmyNet / lemmy

🐀 A link aggregator and forum for the fediverse
https://join-lemmy.org
GNU Affero General Public License v3.0
13.22k stars 877 forks source link

URL Blocklist #4514

Closed flamingo-cant-draw closed 7 months ago

flamingo-cant-draw commented 7 months ago

Requirements

Is your proposal related to a problem?

There are occasions where Lemmy communities or instances are spammed by bots/people posting the same link over and over again, like around two weeks ago where some Japanese teen was able to spam Lemmy and the wider Fediverse.

Describe the solution you'd like.

Admins should be able to set a blocklist of URLs that Lemmy will check post/comments against and deny creation when there's a match.

Describe alternatives you've considered.

Admins can deploy an automod of some kind to do this. This is what we currently have on feddit.uk, but I think this is something that should be built into Lemmy itself.

Additional context

No response

flamingo-cant-draw commented 7 months ago

This is something I'd like to work on, but I just wanted to get the design OKed

My idea was to:

The only thing I'm not sure about is what the API endpoints for retrieving and modifying the blocklist should be.

Nutomic commented 7 months ago

Yes this sounds good to me. A good place for it in the api would be as part of the existing local_site endpoints. In the database it could be called like local_site_url_blocklist accordingly.

Checking the full link is going to be easier for the initial implementation, but it would be more flexible to use a regex, or simply a list of blocked domains. But that can be changed after you figure out the initial db and api changes.