this post was submitted on 07 Feb 2024
9 points (90.9% liked)
Lemmy Support
4652 readers
1 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
This is a big problem. At the time of writing:
How to purge images in Lemmy
pict-rs is a third-party simple image hosting service that runs along-side Lemmy for instances that allow users to upload media.
At the time of writing, there is no WUI for admins to find and delete images. You have to manually query the pict-rs database and execute an API call from the command-line. Worse: Lemmy has no documentation telling instance admins how to delete images ๐คฆ
For the purposes of this example, let's assume you're trying to delete the following image
There are two API endpoints in pict-rs that can be used to delete an image
Method One: /image/delete/{delete_token}/{alias}
This API call is publicly-accessible, but it first requires you to obtain the image's `
delete_token
`The `
delete_token
` is first returned by Lemmy when POSTing to the `/pictrs/image
` endpointTwo pieces of information are returned here:
Of course, if you didn't capture this image's `
delete_token
` at upload-time, then you must fetch it from the postgres DB.First, open a shell on your running postgres container. If you installed Lemmy with docker compose, use `
docker compose ps
` to get the "SERVICE" name of your postgres host, and then enter it with `docker exec
`For example:
Connect to the database as the `
lemmy
` userFor example
Query for the image by the "alias" (the filename)
For example
Now, take the `
pictrs_delete_token
` from the above output, and use it to delete the image.The following command should be able to be run on any computer connected to the internet.
For example:
The image should be deleted.
Method Two: /internal/purge?alias={alias}
Alternatively, you could execute the deletion directly inside the pictrs container. This eliminates the need to fetch the `
delete_token
`.First, open a shell on your running `
pictrs
` container. If you installed Lemmy with docker compose, use `docker compose ps
` to get the "SERVICE" name of your postgres host, and then enter it with `docker exec
`For example:
Execute the following command inside the `
pictrs
` container.For example:
The image should be deleted
Further Reading
Unfortunately, it seems that the Lemmy develoeprs are not taking these moral and legal (GDPR) risks seriously (they said it may take years before they address them), and they threatened to ban me for trying to highlight the severity of this risk, get them to tag GDPR-related bugs, and to prioritize them.
If GDPR-compliance is important to you on the fediverse, then please provide feedback to the Lemmy developers in the GitHub links above.
Attribution
This comment was copied from the following article: Nightmare on Lemmy Street (A Fediverse GDPR Horror Story)