About af_zz_imgproxy (Load insecure images via built-in proxy)

Post plugins and custom CSS snippets here
Exagone313
Bear Rating Trainee
Bear Rating Trainee
Posts: 6
Joined: 06 Jan 2016, 14:38

About af_zz_imgproxy (Load insecure images via built-in proxy)

Postby Exagone313 » 12 Feb 2017, 15:28

Hi,

This message is more for fox but I think it's better to send in public.
This plugin is nice, but has one missing ability, maybe it will be added later as it's really new: it does not proxy images in attachments (div.cdmIntermediate).
It requires to add a new hook to be used in classes/feeds.php around lines 717-722.
As I don't know the code, I would probably forget something if I edit tt-rss and the plugin, but with a bit more information, I would be ok to help (but most of the work is done anyway).

Thanks for reading this.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: About af_zz_imgproxy (Load insecure images via built-in proxy)

Postby fox » 12 Feb 2017, 15:52

i don't think i have any feeds like that, can you post an example?

e: i think it's PluginHost::HOOK_RENDER_ENCLOSURE although maybe it would be worth it to add a hook for enclosure urls only

e2: no idea if this works https://tt-rss.org/gitlab/fox/tt-rss/co ... d57a0c7cd7

Exagone313
Bear Rating Trainee
Bear Rating Trainee
Posts: 6
Joined: 06 Jan 2016, 14:38

Re: About af_zz_imgproxy (Load insecure images via built-in proxy)

Postby Exagone313 » 12 Feb 2017, 16:30


User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: About af_zz_imgproxy (Load insecure images via built-in proxy)

Postby fox » 12 Feb 2017, 17:02

should be better now, i think

Exagone313
Bear Rating Trainee
Bear Rating Trainee
Posts: 6
Joined: 06 Jan 2016, 14:38

Re: About af_zz_imgproxy (Load insecure images via built-in proxy)

Postby Exagone313 » 12 Feb 2017, 17:15

Yes that works, just that in the Attachements menu we get the proxied url, but that's normal due to how you hooked that. Not a big deal.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: About af_zz_imgproxy (Load insecure images via built-in proxy)

Postby fox » 12 Feb 2017, 17:31

probably not the best idea because not all attachments are necessarily images

e: should be limited now similar to how embedding is done

Exagone313
Bear Rating Trainee
Bear Rating Trainee
Posts: 6
Joined: 06 Jan 2016, 14:38

Re: About af_zz_imgproxy (Load insecure images via built-in proxy)

Postby Exagone313 » 12 Feb 2017, 19:43


User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: About af_zz_imgproxy (Load insecure images via built-in proxy)

Postby fox » 12 Feb 2017, 20:22

ah right that datatype gets changed in the middle of that function

copy pasting things will be the end of me *he said while copypasting from the forums*

Exagone313
Bear Rating Trainee
Bear Rating Trainee
Posts: 6
Joined: 06 Jan 2016, 14:38

Re: About af_zz_imgproxy (Load insecure images via built-in proxy)

Postby Exagone313 » 13 Feb 2017, 00:35

And also, extensions are at the end of filenames, so you can add $ to the regex :P

EDIT: Oops that's more difficult, it can contains a query string! :(

EDIT2: You've forgotten the parameter $kind in hook_enclosure_entry.

EDIT3: I ended up forking and making my own improvements, to proxy every worth external content. I merged the plugin no_iframes and removed the whitelist (I show a thumbnail image for Youtube videos or [iframe to example.com]). It no longer only proxies mixed content. Will send it later.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: About af_zz_imgproxy (Load insecure images via built-in proxy)

Postby fox » 13 Feb 2017, 08:12

ah right, $kind should be fixed now.


Return to “Themes and plugins”

Who is online

Users browsing this forum: No registered users and 5 guests