this post was submitted on 17 Feb 2025
8 points (100.0% liked)
Lemmy Support
4733 readers
4 users here now
Support / questions about Lemmy.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
The only way I can think of is to use the API to get all communities, and then filter out the ones without local subs. So a basic BASH script would be:
(It'll take a few minutes to run)
After that, how you purge the communities with those IDs I'm less sure of. My guess would be:
Get a login tokin:
JWT=$(curl --request POST --url https://walledgarden.xyz/api/v3/user/login --header 'accept: application/json' --header 'content-type: application/json' --data '{"username_or_email": "YOUR_USERNAME","password": "YOUR_PASSWORD"}' | jq -r .jwt)
Use Admin/Purge from the API:
As long as purge lets the community be recreated again (which it should do), then that should be okay.
Don't take my word for any of this for an in-production Lemmy server, though. Test first!
Lemmy has mangled that script a bit.
Where it says '%24%7Bpage%7D', it should a dollar sign, an open curly bracket, the word 'page', then a close curly bracket.
It displays a bit better at the source (click the multi-coloured fedi-link thing).
Lemmy seems to mangle a lot of links that aren't basic urls. SimpleX chat links break for some reason here too.
Thank you for the suggestions. At this point it seems the best option may be to just shutter this instance and start over with a fresh database instead of dealing with a bunch of nagging problems from previous experiments. I've done plenty of testing in production because for most of that time it was only me being affected by the consequences lol.