qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
27.83k stars 3.93k forks source link

qBittorrent: 5.0.0 unable to serve webui by cloudflare reverse proxy (cf zero trust public host) #21673

Open qubabos opened 3 days ago

qubabos commented 3 days ago

qBittorrent & operating system versions

qBittorrent: 5.0.0 x64 Operating system: linux docker Qt: 6.7.2 libtorrent-rasterbar: 2.0.10

What is the problem?

So far, I have been using Cloudflare Zero Trust to expose a public host (reverse proxy) for the web UI interface, and everything worked fine up to version 4.6.7. After upgrading to version 5.0.0, the same host and unchanged configuration on the Cloudflare side result in blocking the loading of all JS scripts on the client side, causing errors in displaying the web UI. When using an Nginx reverse proxy, everything works fine until I change or define "WebUI\Address". If I enter anything—localhost or 127.0.0.1—the web UI does not work. If "WebUI\Address=" is undefined in qBittorrent.conf, everything works fine, and the Nginx reverse proxy works, but Cloudflare Zero Trust does not. No matter how I configure it, I cannot get it to work. Downgrading to version 4.6.7 resolves the issue, and everything works correctly on both the Nginx and Cloudflare sides.

Steps to reproduce

No response

Additional context

No response

Log(s) & preferences file(s)

(N) 2024-10-22T11:09:15 - Using built-in WebUI. (W) 2024-10-22T11:09:15 - Couldn't load WebUI translation for selected locale (C). (C) 2024-10-22T11:09:15 - WebUI: Unable to bind to IP: localhost, port: . Reason: Unsupported socket operation (C) 2024-10-22T11:10:37 - WebUI: Unable to bind to IP: hostname, port: 9865. Reason: Unsupported socket operation (I) 2024-10-23T07:50:02 - Successfully listening on IP. IP: "127.0.0.1". Port: "TCP/" (I) 2024-10-23T07:50:02 - Successfully listening on IP. IP: "127.0.0.1". Port: "UTP/" (I) 2024-10-23T07:50:02 - Successfully listening on IP. IP: "192.168..". Port: "TCP/" (I) 2024-10-23T07:50:02 - Successfully listening on IP. IP: "192.168..". Port: "UTP/" (I) 2024-10-23T07:50:02 - Successfully listening on IP. IP: "::1". Port: "TCP/" (I) 2024-10-23T07:50:02 - Successfully listening on IP. IP: "::1". Port: "UTP/" 2024-10-23T08:28:19 - WebUI: Now listening on IP: , port:

HanabishiRecca commented 2 days ago

If "WebUI\Address=" is undefined in qBittorrent.conf, everything works fine

If you don't know what a bind address does, don't touch the setting, leave it empty. Read https://github.com/qbittorrent/qBittorrent/issues/21473#issuecomment-2397701316 and https://github.com/qbittorrent/qBittorrent/issues/21560#issuecomment-2402138500 for explanation.

huntastikus commented 2 days ago

I also have the same issue!

qubabos commented 1 day ago

If you don't know what a bind address does, don't touch the setting, leave it empty.

I don't need to know that and that's why I'm asking what was changed since 4.6.7 release where everything was just fine. This settings is empty, but on cloudlfare side an ip adress needs to be pointed. Something is related to CSP and differences between webui adress in qbittorrent and anything configured by cloudflare side. 2024-10-24_131007 in today's world it is worth opening only those ports to the world that are really needed and additionally have the possibility of securing and limit access to application's webui.

HanabishiRecca commented 1 day ago

The error on the screenshot has nothing to do with qBittorrent WebUI. There is no script called sm.bundle.js inside the codebase. This is some 3rd party stuff interferring. Extensions or something.

qubabos commented 1 day ago

maybe chrome does something here, but clean browser (edge,firefox) also displays webui with cloudflare as on this screenshots - there are blank field covering settings windows with drop down menus from top. any remarkable changes with this between 4.6.7 and 5.0 releases ? downgrade qbittorrent to 4.6.7 resolves cloudflare issue.

pb29 commented 1 day ago

I had exact problem since new update, try disable Rocket Loader from your Cloudflare dashboard Speed - Optimization - Content Optimization I'm not sure how much it will affect to speeds of website since I fixed it myself just now..

qubabos commented 1 day ago

I had exact problem since new update, try disable Rocket Loader from your Cloudflare dashboard Speed - Optimization - Content Optimization I'm not sure how much it will affect to speeds of website since I fixed it myself just now..

rocket load is disabled, issue still present...

HanabishiRecca commented 1 day ago

any remarkable changes with this between 4.6.7 and 5.0 releases ?

I don't know what you are referring by "this". It's a major release, there is a lot of changes: https://github.com/qbittorrent/qBittorrent/compare/release-4.6.7...release-5.0.0

Try to open the WebUI locally. If it works locally, then it's something in-between interferes.

pb29 commented 1 day ago

I had exact problem since new update, try disable Rocket Loader from your Cloudflare dashboard Speed - Optimization - Content Optimization I'm not sure how much it will affect to speeds of website since I fixed it myself just now..

rocket load is disabled, issue still present...

hm, weird. have you tried shift+ctrl+r to clear cache & refresh?

HanabishiRecca commented 1 day ago

Regarding CSP, the last revision appears to be back in 2018. c1912e17c18edaba3a2feabdc5242aabdf4506d7 Introduced in 4.2.0 and haven't been changed since.

Also maybe f6b58f36e2c0a0f2f55c21da660d814e13d761ed could be related, but it's not new for 5.0 either.

qubabos commented 1 day ago

I had exact problem since new update, try disable Rocket Loader from your Cloudflare dashboard Speed - Optimization - Content Optimization I'm not sure how much it will affect to speeds of website since I fixed it myself just now..

rocket load is disabled, issue still present...

hm, weird. have you tried shift+ctrl+r to clear cache & refresh?

sure, also purge all cloudflare cache

qubabos commented 1 day ago

Try to open the WebUI locally. If it works locally, then it's something in-between interferes.

locally works just fine, same as with 4.6.7 release. latest version have issues with it