Found this pure-PHP Camo clone that I’ll use for my Microsub reader/Monocle fork, instead of a self-hosted image proxy. Pros: I’m _almost_ able to run the entire thing on a dead-cheap shared hosting environment. Cons: I _still_ need a caching proxy that’s able to resize and crop avatars, for now. (Ideally, though, the Microsub server would do all that. [No? Well, maybe not.])
I can also _not_ crop avatars, and just replace `border-radius: 50%;` with a smaller, absolute number, as I’d have no way of knowing each image’s aspect ratio. (Con: potentially huge image sizes, depending on the source. Also, not as pretty. [But don’t wanna resort to JS.])
Thought I was smart, appending `?with-replies=1` to my notes section’s URL, but my Microsub aggregator—Aperture—seems to be ignoring it. No replies for me then (using this h-feed). Also, the image proxy thingy doesn’t work for this one image over at WP.com … Will have to investigate.
Works well. Had to supply a user agent string to work around some hosts replying with a 403 Forbidden, and work around an oversight in the original code regarding HTTP status codes (`fopen` and friends follow redirects, which is _good_, but also means you may very well encounter valid image data in combination with a[n initial] 302). And added a sort of resizing option, which leads down a quite different path, and stores the outcome to disk.
And another one. Image URLs that end in a trailing slash—yes, those exist—now work as well.
SSL issues. Worked around. Also made the entire proxy thing into my first ever PHP/Laravel package—local-only, still—so I can have it "separate" from the actual app.
My hosting provider thought it a good idea to kill command-line PHP—like, uh, Composer—scripts after 20 seconds or so. I now pretty much have to install dependencies locally and upload the vendor folder over SFTP. So far for my "works on shared hosting." (It does tho, I just can't install/update very easily.)
Learned about Prestissimo, too.
@jan got a link, perchance?
@doenietzomoeilijk I was thinking of manually converting https://github.com/lumiru/camo-php/blob/master/camo.php into a "more proper" Laravel controller.
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!