Skip to content

Product UI and dashboard hosts

By default a production’s UIs (Studio, a product’s own screens) are served under /bundles/<production>/<replica>/<job>/ on the Manager’s own origin. Every one of them then shares that origin with the Manager’s UI and API, so a script in one could act as the signed-in operator. norsk-mgr raises a standing alert while that is the case.

Setting productUiDomain moves them onto subdomains of their own, and is also what fleet dashboards are served from.

  1. DNS: a wildcard record, *.apps.example.com, pointing at the manager host (the same address as the Manager’s own name).

  2. Certificate: a wildcard certificate and key for *.apps.example.com, readable by norsk-mgr. Wildcards need a DNS challenge, so an HTTP-01 certbot setup cannot issue one; use your DNS provider’s ACME plugin or your own CA.

  3. ~/.norsk-mgr/config.yaml:

    externalUrl: https://mgr.example.com
    productUiDomain: apps.example.com
    productUiCertPath: /etc/norsk-mgr/apps.example.com/fullchain.pem
    productUiKeyPath: /etc/norsk-mgr/apps.example.com/privkey.pem

    norsk-mgr refuses to start with productUiDomain and no certificate, unless the install is securityMode: insecure. externalUrl is where a subdomain sends a browser to sign in; without it those hosts cannot sign anyone in.

  4. Restart norsk-mgr. The certificate is copied into the proxy on every reload, so a renewed one is picked up by the next.

ProductionHost
launched from a production templatet-<template>.apps.example.com
launched without onep-<production>.apps.example.com

Each runtime is at /<production>/<replica>/<job>/ on its host, wherever it runs: a runtime that moves to another worker keeps its address. The host root answers 404, since no single runtime owns it. The old /bundles/... links redirect to the new address.

The origin is the trust boundary, and it is the production template. Every production launched from one template shares that template’s origin, so its UIs can reach each other with the signed-in user’s session. Desks whose people hold different roles should launch from different templates.

norsk-mgr holds a session of its own on each subdomain it serves. A browser arriving with none is sent through norsk-mgr’s sign-in and back, and is given a session for that host only. Every request then reaches the worker with norsk-mgr vouching for the user, so no worker holds a session on these hosts. Signing out of norsk-mgr ends the sessions on every subdomain: a dashboard’s directory refuses at once, and every host stops serving within a minute (nginx keeps a session check for 60 s).

A fleet dashboard is a static bundle norsk-mgr hosts, which reads the directory: the runtimes the signed-in user may see, and what discovery holds about each. Its author builds it with ctl-dev-kit create-dashboard; registering it takes mgr:dashboard.manage (the builder role). Where it is served is chosen when it is registered:

HostingHostRegistered with
its own<name>.apps.example.comnorsk-mgr dashboard register <name>
shared with a group<group>.apps.example.com/<name>/--hosting shared:<group>
a host per production, template or label valuee.g. event-<id>.apps.example.com--hosting pattern:event-{id} --scope production

Then upload its bundle, built as dashboard.tar:

Terminal window
norsk-mgr dashboard upload <name> dashboard.tar

Uploading again replaces it in place, on the same host. Dashboards sharing a group share an origin, and so each other’s reach: that is the registering operator’s call. Each host a pattern yields is an origin of its own, and answers only for the production, template or label value its id names.

What a dashboard host serves:

  • the bundle, to anyone signed in to norsk-mgr. Opening a dashboard needs no role, because what it shows is decided per user.
  • the directory at /_fleet/directory, and live at /_fleet/directory/watch. It lists the runtimes the signed-in user may see, no wider than the kinds the dashboard’s dashboard.json says it uses, and on a pattern host within its scope.

Names are one DNS label and may not start with t- or p-, which product UI hosts use. A dashboard whose host another already has, other than through its group, is refused. Bundles are capped at 32 MiB (NORSK_MGR_MAX_DASHBOARD_BUNDLE_BYTES).

A dashboard can be registered before productUiDomain is set, but nothing serves it until it is.