FriendsOfFlarum / upload

The file upload extension with insane intelligence for your Flarum forum.
https://discuss.flarum.org/d/4154
MIT License
177 stars 96 forks source link

Turn off PHP proxy when OSS is enabled. #208

Open littlegolden opened 4 years ago

littlegolden commented 4 years ago

In addition, if we turn on Qiniu OSS or AWS S3, should we turn off proxy download? If the server is used for proxy download, the download speed will be limited by the server configuration rather than the client bandwidth.

And we replied at #207 :

By disabling the proxy, you reduce the load on your server and can profit from the CDN speed, but you loose access restriction and download count features.

Does "access restriction" means "anti-theft chain protection"? This function has generally provided by CDN and OSS service providers.

clarkwinkelmann commented 4 years ago

When you disable the proxy, you loose both the "hot linking prevention" feature (if that was enabled) and you also lose the ability to restrict who can download the file via the permissions.

So that's why I don't think it makes sense to disable it automatically.

Some people might be using CDN for client speed. Other might simply use it for the storage space or backup features. I think the current set of permissions allows doing both. Maybe we should name the options better or rework the UI ?

qazwsdc commented 4 years ago

@clarkwinkelmann Hi, I want to turn off PHP proxy. How to do that?

clarkwinkelmann commented 4 years ago

It's been a while I have looked at how the extension works. I am actually not even sure that disabling the proxy is possible at all.

We have two existing settings at this time, Disable hotlink protection and Disable logging downloads. Neither of them changes the fact that we proxy the download through a Flarum controller.

Given how the extension is currently designed, there's no way to completely skip the Flarum controller. However that controller could issue a 301 or 302 redirect to the actual resource after performing its role, instead of proxying the content.

I think this will require a refactoring of how the the adapter system works. So I'd say it's unlikely to happen without funding.

qazwsdc commented 4 years ago

But I can't see a 301 or 302 redirect when I use it. It's proxying the content insteadly.

clarkwinkelmann commented 4 years ago

@qazwsdc that was my suggestion of how we could make it work. Currently proxy seems like the only implemented option :wink:

qazwsdc commented 4 years ago

Hope to achieve that.....PLEASE