Controller: link to the main UI on :8443 for Docker installs (#1029)

The fallback Controller UI picked the main UI's port by sniffing its own URL:
only port 8080 mapped to 8443, and any https page dropped the port. Loaded
from https://host:8443/controller/, the Continue/Proceed links pointed at
https://host/. All four links now share one base chosen by docker_mode.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
lrnselfreliance 2026-11-28 12:49:43 -07:00 • committed by GitHub
parent b372a5fc90
commit 633b125dc6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 29 deletions

View file

@ -72,6 +72,25 @@ class TestDashboardEndpoint:
assert 'class="toggle"' in content
assert "Running in Docker mode" not in content
@staticmethod
def _rendered_wrolpi_port(content: str) -> str:
match = re.search(r"var WROLPI_HTTPS_BASE = 'https://' \+ window\.location\.hostname\s*"
r"\+ \((true|false) \? ':8443' : ''\);", content)
assert match, "WROLPI_HTTPS_BASE was not rendered"
# Every WROLPi link derives from the one base; none sniff the Controller's own port/protocol.
assert "port === '8080'" not in content
assert "window.location.protocol === 'https:'" not in content
return ":8443" if match.group(1) == "true" else ""
def test_dashboard_wrolpi_links_docker_port(self, test_client_docker_mode):
"""Docker: "Continue/Proceed to WROLPi" links use 8443 even when the Controller is loaded from
https://host:8443/controller/ or http://host:8080/."""
assert self._rendered_wrolpi_port(test_client_docker_mode.get("/").text) == ":8443"
def test_dashboard_wrolpi_links_native_port(self, test_client):
"""Native: "Continue/Proceed to WROLPi" links use the default HTTPS port."""
assert self._rendered_wrolpi_port(test_client.get("/").text) == ""
def test_dashboard_docker_mode_shows_banner_and_hides_boot_column(self, test_client_docker_mode):
"""Docker mode: Docker banner visible, no Boot toggles in rendered tbody."""
response = test_client_docker_mode.get("/")