imazen / imageflow-dotnet-server

A super-fast image server to speed up your site - deploy as a microservice, serverless, or embeddable.
https://docs.imageflow.io
GNU Affero General Public License v3.0
252 stars 33 forks source link

Reverse proxy to a WebDAV file source #97

Open peaeater opened 3 months ago

peaeater commented 3 months ago

I currently use imageflow-dotnet to transform images served from the local disk from a location mapped to a "/media/" prefix via the ImageflowMiddlewareOptions.MapPath method. Files that aren't images are served via UseStaticFiles with a PhysicalFileProvider mapped to the same prefix.

I now am being asked to work with a reverse proxy (YARP) to a WebDAV file source scenario, where WebDAV uses Basic authentication. Human-friendly non-image file URLs won't be a problem, but how do I get Imageflow middleware to handle the image files and retain human-friendly URLs? Should I switch to imageflow-dotnet-server and use the RemoteReader? I can pass it an HttpClient with the 'Authorization' header set, but I'm flummoxed as to whether the browser can send in "/media/abc/123.jpg" and somehow have Imageflow fetch it from "https://1.2.3.4:5006/abc/123.jpg".

Unless... I've also seen the CustomBlob example. If the RemoteReader is not the answer, is it then possible to create my own custom service based on IBlobProvider?

lilith commented 3 months ago

You can definitely solve this with a custom provider. Human friendly syntax in Remote Reader is deprecated (for now), but it's definitely doable with a custom one.

On Fri, Jul 5, 2024, 10:09 AM peaeater @.***> wrote:

I currently use imageflow-dotnet to transform images served from the local disk from a location mapped to a "/media/" prefix via the ImageflowMiddlewareOptions.MapPath method. Files that aren't images are served via UseStaticFiles with a PhysicalFileProvider mapped to the same prefix.

I now am being asked to work with a reverse proxy (YARP) to a WebDAV file source scenario, where WebDAV uses Basic authentication. Human-friendly non-image file URLs won't be a problem, but how do I get Imageflow middleware to handle the image files and retain human-friendly URLs? Should I switch to imageflow-dotnet-server and use the RemoteReader? I can pass it an HttpClient with the 'Authorization' header set, but I'm flummoxed as to whether the browser can send in "/media/abc/123.jpg" and somehow have Imageflow fetch it from "https://1.2.3.4:5006/abc/123.jpg".

Unless... I've also seen the CustomBlob example. If the RemoteReader is not the answer, is it then possible to create my own custom service based on IBlobProvider?

— Reply to this email directly, view it on GitHub https://github.com/imazen/imageflow-dotnet-server/issues/97, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2LH3R6CNDGNJBSVPXYJTZK3ANDAVCNFSM6AAAAABKNOI632VHI2DSMVQWIX3LMV43ASLTON2WKOZSGM4TEOBWGAZDINI . You are receiving this because you are subscribed to this thread.Message ID: @.***>