Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open web UI on appdaemon breaks when accessing remotely #700

Closed
Ten0 opened this issue Dec 11, 2024 · 6 comments
Closed

Open web UI on appdaemon breaks when accessing remotely #700

Ten0 opened this issue Dec 11, 2024 · 6 comments

Comments

@Ten0
Copy link

Ten0 commented Dec 11, 2024

Problem/Motivation

Clicking "Open WEB UI" when connected remotely does not work: it tries to open http://<my-url>:5050/ but when connected remotely (DDNS and exposed HA on HTTPS), I don't necessarily have that NAT-ed.
In fact, I don't want to NAT this, because there's no authentication on there so it clearly can't be opened to outside.

There is demand for this to work: https://community.home-assistant.io/t/solved-unable-to-connect-to-web-ui/134193/6

Proposed changes

My understanding is that HomeAssistant has a feature called "Ingress" that enables exposing the web UI as an iframe within Home Assistant:

Then one should bind to the ingress port instead of to a fully exposed port, and it would:

  1. work
  2. be more secure (because it would now be authenticated by HomeAssistant instead of being exposed without authentication on the local network)
@frenck
Copy link
Member

frenck commented Dec 11, 2024

This app cannot work via Ingress.

If you want to expose it to the outside world, you'd have to do that yourself.

../Frenck

@frenck frenck closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2024
@Ten0
Copy link
Author

Ten0 commented Dec 11, 2024

Thanks for your answer. Would you have a second to elaborate on why the UI can't work via ingress, for future reference? Thanks.

@frenck
Copy link
Member

frenck commented Dec 11, 2024

It doesn't let itself being served that way.

@Ten0
Copy link
Author

Ten0 commented Dec 12, 2024

It doesn't let itself being served that way.

I still don't understand what specifically would prevent it from working if we were to just set the parameters and bind to the correct port. Can you please point out what in the below reasoning is incorrect?
Thanks.

  1. The way ingress works is it sets a port that the container should expose its http server on somewhere (in an env var?) and then the server should bind there and ingress forwards HTTP & websocket requests to that port provided proper authentication.
  2. Currently appdaemon binds an HTTP server on a particular port (5050) that is globally exposed. We can update that to make it bind its HTTP server to the parameter provided by HA's ingress system.
  3. That's all we have to do for it to work. Ingress is able to forward both HTTP & Websocket and that's all appdaemon needs for that web UI to work.

@sinclairpaul
Copy link
Member

sinclairpaul commented Dec 12, 2024

The application needs to support being served from a path, i.e. /somefolder/mypath. This can be a challenge for apps which assume everything is served from root (i.e. Javascript/asset loads etc)

@Ten0
Copy link
Author

Ten0 commented Dec 12, 2024

Thanks!
For reference: now tracked at AppDaemon/appdaemon#2175

@github-actions github-actions bot locked and limited conversation to collaborators Jan 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants