Skip to content

fix(registry): emit path-only URL for routed apps#202

Merged
mairas merged 3 commits into
mainfrom
fix/routed-app-path-only-url
May 13, 2026
Merged

fix(registry): emit path-only URL for routed apps#202
mairas merged 3 commits into
mainfrom
fix/routed-app-path-only-url

Conversation

@mairas
Copy link
Copy Markdown
Contributor

@mairas mairas commented May 13, 2026

Completes the multi-hostname access migration for container apps.

Problem

container-packaging-tools generated TOML registry entries with absolute URLs:

url = "https://{{domain}}/{app_id}/"

homarr-container-adapter expanded {{domain}} at load time to the device's mDNS hostname (e.g. halosdev.local) and wrote that into the Homarr app row. The card href was then bound to one hostname — so when a user accessed Homarr at https://10.84.77.127 (or any other configured hostname), the Signal K Server card still linked to https://halosdev.local/signalk-server/, defeating the multi-hostname access design.

This affected every routed container app (Signal K Server, InfluxDB, Grafana, AvNav, OpenCPN, …) because they all share this generator. The path-only-href migration touched the homarr fork, the SK-discovery branch of the adapter, halos-cockpit-config/cockpit.toml (hand-written), and Traefik routing — but the container-packaging-tools generator was missed.

Fix

Routed apps now emit a path-only URL:

url = "/{app_id}/"

The browser resolves the href against the current origin, so the same card works under every configured hostname (mDNS, VPN FQDN, DHCP-DNS) without any {{domain}} template expansion.

Non-routed (direct-port) apps continue to use {{domain}} because a TCP port can't be expressed as a path.

Tests

test_url_with_routing_is_path_only (renamed from test_url_with_routing_uses_path_redirect) asserts:

  • href is url = "/{app_id}/" — no scheme, no hostname
  • file contains # Path-only URL documentation comment
  • {{domain}} does not appear anywhere in the generated TOML

test_url_with_routing_uses_app_id updated to expect url = "/{app_id}/".

563 unit tests + 27 integration tests pass. Pre-existing typecheck diagnostics in converters/casaos/transformer.py and routing.py are unchanged (present on main, not introduced by this PR).

Follow-up

After this lands and a new marine-signalk-server-container package is rebuilt + pushed to apt.hatlabs.fi, flash the next halos-pi-gen image to verify the Signal K Server card on Homarr renders path-only and works across hostnames.

mairas added 3 commits May 13, 2026 14:28
Routed apps now generate `url = "/{app_id}/"` instead of
`url = "https://{{domain}}/{app_id}/"`. Browser resolves the href
against the current origin, so the dashboard card works under every
configured hostname (mDNS, VPN FQDN, DHCP-DNS) — completing the
multi-hostname access migration for container apps.

Non-routed (direct-port) apps continue to use the {{domain}} template
because a port can't be expressed as a path.
The previous bumpversion commit didn't refresh uv.lock; the ruff-check
pre-commit hook (which builds the package) syncs it on next run.
@mairas mairas merged commit 9276b8b into main May 13, 2026
4 checks passed
@mairas mairas deleted the fix/routed-app-path-only-url branch May 13, 2026 12:34
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.

1 participant