Container Cluster Reverse Proxy Support#284
Container Cluster Reverse Proxy Support#284JoKneeMo wants to merge 1 commit intojason0x43:masterfrom
Conversation
|
This PR would resolve #283 |
jason0x43
left a comment
There was a problem hiding this comment.
Thanks for the contribution! I have a few minor requests, but otherwise this looks good.
| port: int | None = user_input.get(H_CONF_SERVER_PORT) | ||
| address: str | None = user_input.get(H_CONF_SERVER_INTERFACE) | ||
| event_url: str | None = user_input.get(H_CONF_SERVER_URL) | ||
| update_he_url: bool = user_input.get(H_CONF_UPDATE_HE_URL) |
| H_CONF_SERVER_SSL_CERT: user_input.get(H_CONF_SERVER_SSL_CERT), | ||
| H_CONF_SERVER_SSL_KEY: user_input.get(H_CONF_SERVER_SSL_KEY), | ||
| H_CONF_SERVER_INTERFACE: user_input.get(H_CONF_SERVER_INTERFACE), | ||
| H_CONF_UPDATE_HE_URL: user_input.get(H_CONF_UPDATE_HE_URL), |
There was a problem hiding this comment.
For backwards compatibility, I'd prefer this be something that could default to false (e.g., "Don't update event POST URL in Hubitat") because it's going to start out disabled for users after they update.
| return self._hub.port | ||
|
|
||
| @property | ||
| def address(self) -> str | None: |
There was a problem hiding this comment.
Is this property used anywhere?
| return self._hub.event_url | ||
|
|
||
| @property | ||
| def update_he_url(self) -> bool | None: |
There was a problem hiding this comment.
Is this property used anywhere?
|
|
||
| self._server = server.create_server( | ||
| self._process_event, address, self.port or 0, self.ssl_context | ||
| self._process_event, self.address, self.port or 0, self.ssl_context |
There was a problem hiding this comment.
Make this self.address or '0.0.0.0' since create_server expects a string value.
| """ | ||
| if address is not None: | ||
| return address | ||
| if host is not None: |
There was a problem hiding this comment.
host should never be None since this is only called from the constructor, and the constructor must be passed a host value.
Allow override of the server listening interface and disable HE POST URL updating.
Adds 2 new optional config options
This should allow anyone running Home Assistant in Docker Swarm or Kubernetes to use this integration.
Without the ability to set the listening interface, hosts with a dynamic container IP can not connect.
UI Example:
