this post was submitted on 22 Jul 2023
17 points (100.0% liked)

Lemmy Support

4654 readers
22 users here now

Support / questions about Lemmy.

Matrix Space: #lemmy-space

founded 5 years ago
MODERATORS
 

Hello everyone!

Recently my instance have become a target of community subscribers bots, which subscribed my instance to hundreds of communities. I've deleted all those bot accounts manually and enabled captcha and application for registration.

Then I stopped all containers except for lemmy-postgres and ran a following query to purge all empty communities

delete from community where id in (select community_id from community_aggregates ca where ca.subscribers = 0 for update skip locked);

At first I thought that it worked because all communities and related posts have disappeared, but when I started all the other containers, lemmy for some reason again started adding back those communities with 0 subscribers to my database.

What am I doing wrong? How do I purge them? Also, I would appreciate on any guide how to remove all dangling images (which don't have any reference from db) in pict-rs.

Thanks!

you are viewing a single comment's thread
view the rest of the comments
[โ€“] ptz@dubvee.org 1 points 1 year ago (1 children)

Is there a way to globally send unsubscribe requests? I even tried removing community first and then purging

Not that I know of, and we're reaching the limits of my knowledge here.

I think the problem in your case is that the remote communities still have entries in their community_follower table for those bot accounts on your instance. I'm not sure if there is a good solution, TBH, and this seems to be a rough edge of either Lemmy or ActivityPub. Basically, those instances are sending updates to your server because they still have entries in their DB telling them someone is subscribed from your side. They're unaware those users no longer exist on your end.

I can only think of one good solution (not saying this is the only way, just all I can think of):

Reach out to the admins of those instances. Let them know the actor id of each bot (you might need to pull up a DB backup to get that info) and the community on their instance they were subscribed to. Ask if they would be able/willing to remove those entries from their community_follower table. They'd need to get the person ID and community ids from their own database (they're different for each instance) and remove them. I'm not sure if banning those users from the community via the UI merely prevents them from posting or stops them from getting updates (I'm unclear and have never been banned, so I dunno how it works).

[โ€“] pinkolik@random-hero.com 1 points 1 year ago

Thanks for your help! I hope someone on !activitypub@lemmy.ml can help though