this post was submitted on 23 Jun 2023
8 points (100.0% liked)

Lemmy Support

4645 readers
1 users here now

Support / questions about Lemmy.

Matrix Space: #lemmy-space

founded 5 years ago
MODERATORS
 

After the bot attacks I've cleaned up and implemented some additional measures thanks to some helpful users, but I'd also like to monitor the situation in case someone from my server decides to go on a spam rampage...

Is there a way to:

  1. Easily get a list of comments from all my users locally and across the 'verse?
  2. If I purge/ban these users, is there a protocol for letting other Lemmy admins know? I assume I have no power to delete things from their instances (just my copy of their instance?)
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 4 points 1 year ago* (last edited 1 year ago) (2 children)
  1. Not super easily. It can be done by querying the postgresql dabase, but there is no built-in method to do it using the browser interface at the moment. When anyone from any instance does report them, you will see the report.

  2. Someone please correct me if I am wrong. But, as far as I am aware, if you purge a user from your instance, that action is federated to every other instance - so if you respond quickly to these reports, other instance's admins will not need to deal with them themselves. It is only when you perform an action on a user from a different instance that the action is only local.

[–] [email protected] 2 points 1 year ago (1 children)

Not super easily. It can be done by querying the postgresql dabase, but there is no built-in method to do it using the browser interface at the moment. When anyone from any instance does report them, you will see the report.

Do you have an example of a query I could use? I'm a bit rusty with databases :) with an example I can get chatgpt to build me something better

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

Sure! The comments that are posted from within your instance are labeled with "local = true", even if they are posted to other instances. So the query below will dump all of the database entries for comments in your instance into a file. Assuming that you have a docker install.

docker exec LEMMY_POSTGRES_CONTAINER_NAME psql -U POSTGRES_USER -c "select * from comment where local=true order by comment.published desc;" > all_comments.txt

This will print to a file the comment table including all of the comments posted from within your instance, starting with the newest post. It is possible to combine other queries (such as associating the creator ID with the username), and then parse the output to produce a more informative and easy-to read output. But what I have shown might be enough for you. I may be able to help you if you need a more specific query.