fix(#888): use gateway forge URL in dashboard links

Dashboard links to the forge were hardcoded as http://<hostname>:3000,
which breaks when the operator accesses the dashboard through
hive-gateway (forge is served at forge.<domain> with no port).

- nix/modules/hive-c0re.nix: inject HIVE_FORGE_PUBLIC_URL when
  forge.behindGateway = true (e.g. http://forge.pr1ma.darkest.space)
- hive-c0re/src/dashboard.rs: expose forge_url: Option<String> in
  StateSnapshot, reading from HIVE_FORGE_PUBLIC_URL
- frontend/packages/dashboard/src/tabs.js: use state.forge_url when
  present; fall back to http://<hostname>:3000 for gateway-off /
  local-dev deploys
This commit is contained in:
iris 2026-05-31 21:53:33 +02:00
commit d3ca857659
5 changed files with 37 additions and 3 deletions

View file

@ -1063,7 +1063,9 @@ window.marked = marked;
const metaLinks = $('meta-links');
if (metaLinks && Array.isArray(s.links)) {
metaLinks.replaceChildren();
const forgeBase = `http://${window.location.hostname}:3000`;
// Prefer forge_public_url from state (set when the gateway serves
// forge at its sub-domain); fall back to :3000 for local-dev.
const forgeBase = s.forge_public_url || `http://${window.location.hostname}:3000`;
s.links.forEach((lnk, i) => {
const href = lnk.kind === 'forge' ? forgeBase + (lnk.url || '')
: lnk.kind === 'external' ? (lnk.url || '')