t0bst4r / home-assistant-matter-hub

Publish your Home-Assistant Instance using Matter.
Apache License 2.0
146 stars 8 forks source link

[Enhancement] Ingress support #36

Open DJBenson opened 3 weeks ago

DJBenson commented 3 weeks ago

Just throwing a suggestion out there that it would be good if the web portal was accessble using HA ingress.

t0bst4r commented 1 week ago

I like the idea of ingress, too. BUT... This addon is using the host network mode. This means that ports which are used by this addon are blocked for the host computer, too. No other addon or integration are able to use the web-port (and the matter ports). That's why i made the web port configurable - to not block other addons.

When using ingress, the port cannot be changed. I need to tell ingress which port is used for the web ui. When changing the port in the configuration, ingress will not be able to proxy the addon web ui.

I am not really sure, how to solve that. Either:

  1. use ingress, but remove the port configuration of the web ui
  2. don't use ingress, but keep the port configurable
DJBenson commented 1 week ago

The official Matter add-on uses host networking AND allows the web UI port to be configured. See config here.

I'm not a developer but to me it looks like if you add the following to the config.yaml of the addon it might work;

ingress: true
ingress_port: 8482

and then to allow the port to be configured;

ports:
  8482/tcp: null

and remove the port config (which is now handled by the docker expose feature);

web_port: 8482
DJBenson commented 1 week ago

Not quite that simple it seems as web_port is required but perhaps that's because it's designed such it doesn't currently work with ingress - the point is other addons do work with host network and port configs so hopefully something that can be implemented.