zwave-js / zwave-js-ui

Full featured Z-Wave Control Panel UI and MQTT gateway. Built using Nodejs, and Vue/Vuetify
https://zwave-js.github.io/zwave-js-ui
MIT License
974 stars 203 forks source link

Web interface issues when accessing via "web proxy" #2843

Closed juanjoSanz closed 1 year ago

juanjoSanz commented 1 year ago

Hi all,

we have identify an issue, when accessing zwavejs-ui not directly but via a proxy. URLs for some resources were pointing wrong paths.

We tested a fix, removing the following line and for us it seems to be working.

https://github.com/zwave-js/zwave-js-ui/blob/f033ee8724799063c3979adfa8511005cb7a8276/build/webpack.base.conf.js#L91

Do you see any problem removing that parameter? publicPath: '../../'

Thanks

robertsLando commented 1 year ago

Have you checked this? https://zwave-js.github.io/zwave-js-ui/#/usage/reverse-proxy?id=accessing-from-behind-a-proxy

What proxy are you using? Could you show me the configuration you are using?

How are you running zui? Docker? NodeJS? If nodejs how did you build/run it?

juanjoSanz commented 1 year ago

zui is build in a pkg for arm64 arch. The proxy is an app call teleport. With the suggested fix, everything works fine. Do you think it will be possible to incorporate that into official build?

robertsLando commented 1 year ago

With the suggested fix, everything works fine. Do you think it will be possible to incorporate that into official build?

If I do that it stops working in the other usage so nope, I'm sorry

juanjoSanz commented 1 year ago

I thought this would not affect other usage. Do you have any suggestion about which usage could be affected? If so, I would be able to run some test to check it.

In any case, thanks for the support and the great job with this app.

robertsLando commented 1 year ago

Even normal usage should stop working with that. Just try to run the server with that change without a proxy

juanjoSanz commented 1 year ago

Actually it works fine with and without proxy, and there are no errors/warning in web browser dev console.

Without the fix, normal web works but when using proxy some static links are wrong.

robertsLando commented 1 year ago

Just tested and that change breaks the logic when running application behind a proxy, I get 404 on all fonts

To test this simply go on docker/nginx folder and run docker-compose up command, start application and go to

https://localhost/zwave

juanjoSanz commented 1 year ago

Hi again, I tested again later release, v8.9.0, and still having issues with icons when using proxy. We really tried many options using nginx and nothing worked.

So I recreated the package with the fix we suggested and for us it seems to be working fine, and seems to be the solution for our issues. I tested it with proxy and direct access, and so far I see nothing broken.

Just in case, let me paste the suggested fix, cause maybe it was not clear enough.

Screenshot 2023-03-03 at 09 29 24
robertsLando commented 1 year ago

Tried what I suggested in above comment?

juanjoSanz commented 1 year ago

Thanks. Unfortunately, it cannot be tested since device does not support docker, and installing docker would require a huge effort.

robertsLando commented 1 year ago

I don't want you to test on devices but locally on your PC to verify that it doens't work with the change you suggested.

If you find a fix that works both for you and for that case I'm glad to accept it

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label

github-actions[bot] commented 1 year ago

This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.