Skip to content

Generate path-redirect URLs instead of subdomain URLs#198

Merged
mairas merged 3 commits into
mainfrom
feat/port-based-routing
Mar 2, 2026
Merged

Generate path-redirect URLs instead of subdomain URLs#198
mairas merged 3 commits into
mainfrom
feat/port-based-routing

Conversation

@mairas
Copy link
Copy Markdown
Contributor

@mairas mairas commented Mar 2, 2026

Summary

  • Registry TOML generation now produces path-redirect URLs (https://{{domain}}/app-id/) for routed apps instead of subdomain URLs
  • Routing YAML output no longer includes subdomain or entry_points fields
  • Updated tests to match new URL scheme

Motivation

Companion to halos-org/halos-core-containers port-based routing migration. The build-time tooling must generate URLs matching the new routing scheme.

Related: halos-org/halos-mdns-publisher#37

Test plan

  • All 60 tests pass
  • Generated TOML files contain correct path-redirect URLs
  • Generated routing YAML has no subdomain fields

🤖 Generated with Claude Code

mairas and others added 3 commits March 2, 2026 21:10
Replace subdomain-based routing with port-based routing scheme.
Registry URLs now use path redirects (e.g., /app-id/) instead of
subdomain URLs. Routing YAML no longer includes subdomain or
entry_points fields.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mairas
Copy link
Copy Markdown
Contributor Author

mairas commented Mar 2, 2026

Review Response

Summary

The review had 9 findings. I accepted 5 (Critical 1, Critical 2, Major 5, Major 6, Minor 7), rejected 4 (Major 3, Major 4, Minor 8, Minor 9). All changes have been made and tests pass (61/61).

Accepted

  • Critical 1: ROUTING.md still describes subdomain routing — Valid. Updated docs/ROUTING.md to describe the path-redirect model. Removed all subdomain references and updated examples.

  • Critical 2: Empty app_id produces https://{{domain}}// — Valid. Added a ValueError guard in registry.py when app_id is empty for routed apps, plus a test in test_registry.py.

  • Major 5: 31 test fixtures still pass subdomain in routing metadata — Valid. Removed all subdomain entries from test_routing.py fixtures. The function ignores the field, so tests should not include it.

  • Major 6: Branch includes unrelated POSIX fix commits — Valid. Rebased onto origin/main (which already contains PR Fix POSIX shell compatibility in postinst default-data copy loop #197). Branch now has only 3 commits: the feature commit, uv.lock update, and version bump.

  • Minor 7: Extra blank line in routing.py — Valid. Removed the extra blank line between _get_scheme and _get_auth_config (3 blank lines → 2).

Rejected

  • Major 3: web_ui.path silently ignored for routed apps — This is intentional. Routed apps use path redirects (/app-id/ → 302 to the app's dedicated HTTPS port). The web_ui.path is the internal path within the app, not the external URL path. The redirect takes the user to the app's root on its dedicated port, where web_ui.path applies. The code comment already explains this.

  • Major 4: subdomain field still in schemastraefik.py still consumes the subdomain field. Removing it from schemas would break traefik.py, which is still in use during the migration. This will be cleaned up when traefik.py is removed in a future PR.

  • Minor 8: Version in uv.lock inconsistent — The bumpversion command updated both VERSION and uv.lock. The version in uv.lock matches the VERSION file (0.5.5). This is correct.

  • Minor 9: No test for Homarr root domain case — Homarr doesn't use routing — it's served directly on port 443 with no routing key in metadata. The non-routing URL path is already covered by existing tests (test_url_without_port_for_default_https, etc.).


All changes are squashed into the feature commit via git rebase --autosquash. Tests pass: 61/61.

@mairas mairas force-pushed the feat/port-based-routing branch from 336e1cf to fe19641 Compare March 2, 2026 19:11
@mairas mairas merged commit 99f3378 into main Mar 2, 2026
4 checks passed
@mairas mairas deleted the feat/port-based-routing branch March 2, 2026 19:29
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