this post was submitted on 20 Jun 2023
11 points (92.3% liked)

Selfhosted

39949 readers
529 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

I have my self-hosted instance now, but there are some issues / open questions:

  • When going to my admin-page, I see tons of banned users I never banned myself. Who banned them, why do I need to know about it?
  • Concerned I might have left my instance too open and they might have used my instance for spamming, I tried to look for all users on my instance. By directly accessing postgres:lemmy and checking the user-ids, I saw it's just the expected ones, however, I wasn't able to find the usernames, neither easily in postgres nor on the lemmy admin page. Any ideas?
  • I see timeouts when accessing my lemmy instance, however, the host doesn't show high cpu-, memory- or network-load and I don't see anything immediately suspicious in the logs. According to iftop, there aren't insane amounts of connections, either. Sometimes it seems to help temporarily to restart my apache server. Any ideas, what to look out for?
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 1 year ago (1 children)

I found out how to get the list of users registered on my instance. Assuming docker-compose based installation, to access the database via CLI:

cd LEMMY_FOLDER
docker-compose exec postgres bash
psql -d lemmy -U lemmy
select name from person where local=true;

The db also contains all users known from federated instances; you can look for one e.g. via

select name,actor_id,instance_id from person where actor_id='https://social.cyb3r.dog/u/senicar';
  name   |              actor_id              | instance_id 
---------+------------------------------------+-------------
 senicar | https://social.cyb3r.dog/u/senicar |         398
(1 row)

and look for other users on that same instance:

select name,actor_id,instance_id from person where instance_id=398;

There are plenty of other queries you can do on the db, e.g. to figure out which instances have most banned users, which instances are presumably private (have less than 5 users known to you), max instance_id to see to how many instances you are connected, etc.

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

Sick, thanks!

Edit: It would be awesome to have some of these queries built into the admin panel.