Add basic reverse proxy support#50
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds basic reverse-proxy support by separating the ports the stack listens on from the ports it advertises to Roborock clients/Home Assistant, enabling setups where a proxy publishes different external ports than the backend listeners.
Changes:
- Introduces
network.advertised_https_portandnetwork.advertised_mqtt_tls_port(defaulting to listener ports when unset). - Updates server credential/context generation to advertise the new “public” ports while continuing to bind listeners to
https_port/mqtt_tls_port. - Adds tests and documentation covering reverse-proxy port mapping expectations and configuration.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_ha_addon.py | Adds assertions and a new test for HA add-on config generation with advertised/public ports. |
| tests/test_custom_ports.py | Adds an integration-style test verifying /region and context URLs reflect advertised/public ports. |
| tests/test_config.py | Extends config loader tests to cover defaults and explicit reverse-proxy advertised port settings. |
| src/roborock_local_server/server.py | Switches advertised URLs/credentials to use advertised_* ports while leaving listener ports unchanged. |
| src/roborock_local_server/ha_addon.py | Adds optional advertised port options (0/unset semantics) and emits them into generated TOML. |
| src/roborock_local_server/config.py | Extends NetworkConfig and load_config to parse/validate advertised ports with sensible defaults. |
| roborock_local_server_addon/DOCS.md | Documents how to use advertised ports behind a reverse proxy in the HA add-on context. |
| roborock_local_server_addon/config.yaml | Exposes new HA add-on options for advertised/public ports. |
| mkdocs.yml | Adds the new Reverse Proxy page to the documentation nav. |
| docs/reverse_proxy.md | New documentation page describing supported reverse-proxy layouts and requirements. |
| docs/installation.md | Links to reverse proxy guidance and clarifies listener vs advertised port usage. |
| docs/index.md | Adds reverse proxy doc link to the docs index. |
| docs/home_assistant.md | Adds reverse-proxy guidance reference for HA users (noting MQTT/TLS port considerations). |
| config.example.toml | Documents the new optional advertised port fields for reverse-proxy setups. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.