Admiral Patrick

I’m surprisingly level-headed for being a walking knot of anxiety.

Ask me anything.

I also develop Tesseract UI for Lemmy/Sublinks

Avatar by @SatyrSack@feddit.org

  • 0 Posts
  • 5 Comments
Joined 2 years ago
cake
Cake day: June 6th, 2023

help-circle

  • Lemmy doesn’t so much cache the images so much as “store them forever”.

    Regular post thumbnails are just “internal” images. I’m not sure if newer Lemmy versions log these internally like user uploads are, but assuming not, there’s no direct way to deal with them.

    Pict-rs keeps a true cache of image variants (alternate versions of images that were requested at different resolutions / formats). Those can be cleared programmatically:

    curl -XDELETE -H "X-Api-token:YOUR_API_KEY" http://127.0.0.1:8080/internal/variants

    Where your pict-rs API port is exposed to localhost on port 8080. Also note that those variants will be re-created on demand.

    One easy-ish way to get rid of images is to select from the post table for any thumbnail_url that starts with your instance. e.g. https://your-instance/pictrs/image/%s. You can filter that by published date if you only want to wipe out thumbnails for posts older than a year, for example.

    With that list, you can strip off the filename/alias (the uuid and extension) and pass each alias filename to a script that tells pict-rs to delete it (you need at least pict-rs 0.5 for this to work):

    #!/bin/bash
    ALIAS="$1"
    API_KEY=FooBarAPIKeyIsFake
    
    curl -XPOST -H "X-Api-token:$API_KEY" http://127.0.0.1:8080/internal/delete?alias=%24ALIAS
    

    Below 0.5, the only way to delete images fro pict-rs without the delete token was to use the purge endpoint. But that deletes all aliases and not just the one you want to delete since it does de-duplication under the hood.

    If you want to get fancy so that image posts still render correctly, when building your list of thumbnails to delete, you can check if the value of the url column is an image. If it is, grab the current thumbnail image to pass to the delete function and then update the thumbnail URL value to that of the post URL.


  • I’ve self hosted long before the privacy/subscription nightmare of modern cloud/SaaS platforms was a thing. I do it because I enjoy it (and at the time I got started, I had crap internet so having good local services like offline Wikipedia was important).

    Not everyone has to self-host. I run lots of services, mostly for myself, but friends and family who don’t know a kernel driver from a school bus driver also use them. So the expectation that everyone self host is and always has been “pie in the sky”. And that’s okay.

    Privacy regulations are all fine and dandy, but even with the strictest ones in place, you still do not own or control your data. You’re still subscribing to services instead of owning software. You can’t extend, modify, or customize hosted software. Self hosting FOSS applications addresses all of those.

    So rather than expect everyone to self-host, we should be working towards communities offering services to one another, pooling resources, and letting those interoperate with each other.

    To make fun of an old moral panic in the 90s: “It’s 11pm. Do you know where your data is?” Yep, it’s down the street in Matt’s house.



  • I think it’s more a generational gap in basic computer skills.

    Millennials grew up alongside modern computing (meaning the two matured together). We dealt with everything from BASIC on a C64 to DOS and then through Windows 3 through current. We also grew up alongside Linux. We understand computers (mostly) and the (various) paradigms they use.

    Gen Z is what I refer to as the iPad generation (give or take a few years). Everything’s dumbed down and they never had to learn what a folder is or why you should organize documents into them instead of throwing them all in “Documents” library and just using search. (i.e. throw everything in a junk drawer and rummage through it as needed).

    As with millennials who can’t balance a checkbook or do basic household tasks, I don’t blame Gen Z for not learning; I blame those who didn’t teach them. In this case, tech companies who keep dumbing everything down.

    Edit: “Balance a checkbook” doesn’t have to mean a physical transaction log for old school checks. It just means keeping track of expenditures and deposits so that you know the money in your account is sufficient to cover your purchases. You’d be surprised how many people my age can’t manage that.