Follow

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.])

(janboddez.tech/notes/380c75c2f)

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.])

(janboddez.tech/notes/5637fac17)

Show thread

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.

(janboddez.tech/notes/18d7df53c)

Show thread

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.

Show thread

And another one. Image URLs that end in a trailing slash—yes, those exist—now work as well.

Show thread

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.

Show thread

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.)

Show thread
Sign in to participate in the conversation
Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!