DocMarty84 / miniflutt

Another Miniflux client.
MIT License
112 stars 16 forks source link

proxied images don't show up #26

Closed nikodemak closed 6 months ago

nikodemak commented 1 year ago

using the PROXY_IMAGES=all setting on the server makes none of the images load in the miniflutt app. i would suspect it's because they use relative URLs instead of absolute URLs. setting PROXY_IMAGES=none is a workaround but it will show a mixed content warning in the browser console.

nikodemak commented 1 year ago

this might actually be an issue on miniflux's end as the <img> tag 'src' attribute doesn't seem to respect the BASE_URL variable

DocMarty84 commented 1 year ago

Are you using a custom port to access Miniflux?

I can reproduce the issue on my side with Miniflux behind Nginx but accessible through a custom port. The src image is loaded with https://mydomain:443/proxy/xxxxxxx although I am using a port different from 443. Nginx returns a 404 error, obviously. Using the proper port loads the image correctly, so I think it is the root cause of the problem.

I'll check if I can do something, but it is likely that it should be handled at the Miniflux level :thinking: Technically, one needs the API endpoint to configure Miniflutt, and I'd think it is up to Miniflux to properly use the BASE_URL when proxyfying the images. Using PROXY_IMAGE_URL doesn't work either, I guess in this case Miniflux considers the proxying is done externally.

DocMarty84 commented 1 year ago

Could be somewhere here: https://github.com/miniflux/v2/blob/bfebf946c20e1d57bbd51ed354296c6b40a26f48/proxy/image_proxy.go#L47

nikodemak commented 1 year ago

sorry for taking so long to reply i am using a custom port (9100) together with apache2 proxying the connection to/from localhost:9100 from/to mydomain, my issue is that the src image is loaded with http://localhost:9100/proxy/xxxxx instead of https://mydomain/proxy/xxxxxx despite me setting BASE_URL to mydomain

DocMarty84 commented 6 months ago

I don't think there is anything I can do at the app level. Miniflutt receives the HTML content from the Miniflux API, it does not manipulate the content. So one would expect that the base URL has been properly set by Miniflux.