Uh oh!
There was an error while loading. Please reload this page.
Image Camo extension - #332
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Alkarex
commented
Jun 15, 2025
Thanks 👍🏻 |
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
JadedBlueEyes
commented
Jun 19, 2025
I've added references in the README and the JSON file. |
Alkarex
commented
Jun 20, 2025
I have not checked the differences with the existing https://github.com/FreshRSS/Extensions/tree/master/xExtension-ImageProxy |
Alkarex
commented
Jun 20, 2025
Ping @Frenzie |
Frenzie
commented
Jun 20, 2025
I don't really know why this Camo would need a fully separate extension. Maybe something about authentication didn't fit into the existing setup very well and it couldn't be elegantly added. It sounds like it's basically go for ImageProxy unless you specifically want to use Camo. |
JadedBlueEyes
commented
Jun 20, 2025
The software I'm using is https://github.com/cactus/go-camo. The main difference compared to the existing image proxies it means you're not just running an open proxy - which isn't really the greatest security idea. It's a separate extension primarily because of the config, although it could have the image URL replacement logic shared. It's not that complex though, so I didn't think it was worth it. |
JadedBlueEyes
commented
Jun 20, 2025
The camo former is not specific to this software though, GitHub's implementation was in JS I think? The important part is this URL format: privatestaticfunctiongenerateBase64CamoUrl(string$hmacKey, string$camoUrl, string$imageUrl): string { // Generate HMAC-SHA1 $hmac = hash_hmac('sha1', $imageUrl, $hmacKey, true); // Base64 encode without padding (camo style) $b64Hmac = rtrim(strtr(base64_encode($hmac), '+/', '-_'), '='); $b64Url = rtrim(strtr(base64_encode($imageUrl), '+/', '-_'), '='); returnrtrim($camoUrl, '/') . '/' . $b64Hmac . '/' . $b64Url; }hmacKey being a shared secret |
Frenzie
commented
Jun 20, 2025
Mind, the Apache config in the README contains this: Which is to say, any proxy is only as open as you want.
From a maintenance perspective that sounds a bit backwards to me, but perhaps from a UI perspective it could become confusing. In any event, that particular logic is basically the only logic likely to change anytime soon (unless someone wants to add support for some different format like Camo). |
This saves me from running a public proxy to any arbitrary URL, and lets me share infrastructure (with my forgejo instance, for example)