Skip to content

Add basic reverse proxy support#50

Merged
Lash-L merged 1 commit into
mainfrom
reverse_proxy_support
Jun 12, 2026
Merged

Add basic reverse proxy support#50
Lash-L merged 1 commit into
mainfrom
reverse_proxy_support

Conversation

@Lash-L

@Lash-L Lash-L commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_port and network.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.

@Lash-L Lash-L merged commit f4aca8d into main Jun 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants