[router] UI templates hardcode bare /rpc & /openrpc.json — API Docs + Admin (and home dashboard) 404 after the /api/{domain}/ migration #124
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_router#124
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
Multiple router UI tabs fail because their browser RPC/spec calls hit dead paths. Two visible examples (screenshots below):
who.client_ipthrows; "Your address" stays blank.Root cause (systemic)
BASE_PATHresolves to/for the direct router UI, and the templates fetch bare paths that no longer exist — the router now serves RPC/specs domain-scoped under/api/main/:POST /rpc/api/main/rpc(200)GET /openrpc.json/api/main/openrpc.json(200)Affected call sites (7 across 4 files)
templates/api.html:213—fetch(BASE_PATH + 'openrpc.json')(+ link, line 26) → API Docstemplates/admin.html:148—fetch(BASE_PATH + "rpc")→ Admin access statetemplates/base.html:837, 856, 985—fetch(BASE_PATH + 'rpc')→ home dashboard / nav RPCstatic/js/dashboard.js:8—fetch(BASE_PATH + 'rpc')Note:
dashboard.jsalready uses the domain-scopedBASE_PATH + 'api/main/events'for SSE — so the codebase is inconsistent; these RPC/spec sites were simply missed in the/api/{domain}/migration.Fix
Point these at the domain-scoped paths (
/api/main/rpc,/api/main/openrpc.json). The templates already displayPOST /api/main/rpc, somainis the known domain. Same class as hero_lib #151 / #153.The proper fix may prefer to discover the domain (multi-domain-aware) rather than hardcode
main, in line with the per-domain OpenRPC direction.Confirmed on latest
development(cb1d53f); none of the recent multi-domain commits touched these call sites.Screenshots
API Docs:
Admin:
Fixed on
development(e42a1f9). Repointed all 8 bare call sites to the domain-scoped control plane (/api/main/rpc,/api/main/openrpc.json) acrossbase.html,api.html,admin.html,partials/service.html, andstatic/js/dashboard.js(the 8th wasservice.html→router.agent.models, not in the original list). Verified live:/api/main/openrpc.json→ 200,POST /api/main/rpc→ valid envelope; bare paths remain 404 as expected. Hardcodingmainis correct here since the router control plane is single-domain; the multi-domain viewer keeps its domain selector.