Node Subdomains No Longer Work #23

Closed
opened 2026-10-04 23:09:13 +02:00 by adam · 3 comments
Owner

Previously working Node subdomains (e.g. .ipnt.uk) no longer work. Need to add host header checking and redirect to the proper node page (e.g. https://ipnt.uk/nodes/)

Previously working Node subdomains (e.g. <node-name>.ipnt.uk) no longer work. Need to add `host` header checking and redirect to the proper node page (e.g. https://ipnt.uk/nodes/<pub>) <!-- github-sync-id:3794339313 -->
adam closed this issue 2026-10-04 23:09:13 +02:00
Author
Owner

The subdomains now load the website but still don't # redirect to the node page. Ongoing.

The subdomains now load the website but still don't # redirect to the node page. Ongoing. <!-- github-comment-id:3739735695 -->
Author
Owner

/oc summarize

/oc summarize <!-- github-comment-id:4271648283 -->
Author
Owner

Issue Summary: Node Subdomains No Longer Work

Issue #146 — Node subdomains (e.g. <node-name>.ipnt.uk) no longer redirect to the corresponding node page (/nodes/<public_key>).

Current State

There is no subdomain/host-header redirect logic anywhere in the codebase. Specifically:

  • No middleware inspects the Host header for subdomain-based routing. The web app only has CacheControlMiddleware and ProxyHeadersMiddleware (for X-Forwarded-* headers).
  • No server-side code reads request.headers.get("host") or performs host-based redirects.
  • No client-side code inspects window.location.hostname for subdomain routing — the SPA router is purely path-based.
  • NETWORK_DOMAIN is defined in WebSettings (config.py:303) but is never consumed by any code.

What Needs to Happen

The fix requires a server-side middleware (in src/meshcore_hub/web/middleware.py or app.py) that:

  1. Reads the Host header on each request
  2. If the host matches a subdomain pattern (e.g. <subdomain>.ipnt.uk where ipnt.uk is NETWORK_DOMAIN):
    • Resolves the subdomain to a node (by name tag, advertised name, or similar)
    • Redirects to https://<base_domain>/nodes/<public_key>
  3. Needs NETWORK_DOMAIN to be configured and the node lookup logic to map subdomain labels to nodes

New%20session%20-%202026-04-17T22%3A18%3A42.478Z
opencode session  |  github run

## Issue Summary: Node Subdomains No Longer Work **Issue #146** — Node subdomains (e.g. `<node-name>.ipnt.uk`) no longer redirect to the corresponding node page (`/nodes/<public_key>`). ### Current State **There is no subdomain/host-header redirect logic anywhere in the codebase.** Specifically: - **No middleware** inspects the `Host` header for subdomain-based routing. The web app only has `CacheControlMiddleware` and `ProxyHeadersMiddleware` (for `X-Forwarded-*` headers). - **No server-side code** reads `request.headers.get("host")` or performs host-based redirects. - **No client-side code** inspects `window.location.hostname` for subdomain routing — the SPA router is purely path-based. - **`NETWORK_DOMAIN`** is defined in `WebSettings` (`config.py:303`) but is **never consumed by any code**. ### What Needs to Happen The fix requires a server-side middleware (in `src/meshcore_hub/web/middleware.py` or `app.py`) that: 1. Reads the `Host` header on each request 2. If the host matches a subdomain pattern (e.g. `<subdomain>.ipnt.uk` where `ipnt.uk` is `NETWORK_DOMAIN`): - Resolves the subdomain to a node (by name tag, advertised name, or similar) - Redirects to `https://<base_domain>/nodes/<public_key>` 3. Needs `NETWORK_DOMAIN` to be configured and the node lookup logic to map subdomain labels to nodes <a href="https://opencode.ai/s/8f2mrjia"><img width="200" alt="New%20session%20-%202026-04-17T22%3A18%3A42.478Z" src="https://social-cards.sst.dev/opencode-share/TmV3IHNlc3Npb24gLSAyMDI2LTA0LTE3VDIyOjE4OjQyLjQ3OFo=.png?model=zai-coding-plan/glm-5.1&version=1.4.10&id=8f2mrjia" /></a> [opencode session](https://opencode.ai/s/8f2mrjia)&nbsp;&nbsp;|&nbsp;&nbsp;[github run](/ipnet-mesh/meshcore-hub/actions/runs/24589127845) <!-- github-comment-id:4271658746 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/meshcore-hub#23