Knotrel Docs

Knotrel Console

The Knotrel Console is a browser tool for exploring, querying and diagnosing one Knotrel server, modeled on the workflow of data browsers such as Redis Insight:

Browser: the node list fills the height; the selected node shows its state, neighbors and a connectivity check

Status: released (1.2.0, 2026-11-29), together with server 1.2.0. Image ghcr.io/knotrel/knotrel-console:1.2.0; archive on the GitHub Release v1.2.0.

The console is a static React application, released as its own artifacts (never inside the Rust crates or binary) and distributed in two forms:

Distribution Use Status
Container image ghcr.io/knotrel/knotrel-console:<version> Run next to Knotrel, locally or on a server Primary; published since 0.8.0
Static archive knotrel-console-<version>.tar.gz (+ .sha256) on the GitHub Release v<version> Host behind an existing web server or gateway Primary; published since 0.8.0
npm package with a local launcher npx quick start Deferred (separate increment)

The server binary, the console image and the archive are independent artifacts. Cargo builds and server installations never need Node.js, and the Rust binary embeds no console assets.

Server flags, in short

The console works with any server. Three optional server flags unlock more of it. Each is off by default because each has a cost that not every deployment wants to pay.

Flag What it unlocks in the console Cost when on Off (default)
KNOTREL_INSPECTION=true Browser: lists of nodes and edges, node detail, incident edges Up to about 20 bytes per node and a few percent slower node creation (measured: 2–5 %) No cost. The browser explains how to turn it on; queries and operations still work.
KNOTREL_TOPOLOGY_LIFECYCLE=true Active/inactive nodes, enabled/disabled edges, removal, the related filters Roughly twice the graph memory; compact-bfs (and cluster-forest from 1.1) Every node is active and every edge effective; those actions are hidden.
KNOTREL_METRICS_ENABLED=true Performance page, feeder lease on the Synchronization page Exposes /metrics (no authentication, like every route) The pages say metrics are disabled.

Incident edges and the edge list also need the compact-bfs engine (the default): the experimental engines cannot list neighbors.

The Compose example turns all three on. Measured costs: inspection cost check.

Choose a path

Local start with Docker

Requirements: Docker with Compose. From a checkout of this repository:

docker compose -f console/deploy/compose.yaml up --build

Open http://127.0.0.1:7380/. The example starts a standalone server with lifecycle support, inspection and metrics enabled. console/scripts/start-local.sh and stop-local.sh wrap the same commands; console/scripts/seed-demo.sh loads a small demo network, since the graph starts empty. Only the console port is published, on loopback; the server is reachable only from the console container. Graph state is in memory and lost when the server stops. Stop with Ctrl+C, then:

docker compose -f console/deploy/compose.yaml down

To use the console with a server you already run, start only the console image (or an image built with docker build -t knotrel-console:dev console):

docker run --rm -p 127.0.0.1:7380:8080 \
  -e KNOTREL_CONSOLE_UPSTREAM=http://host.docker.internal:8080 \
  --read-only --tmpfs /tmp --cap-drop ALL \
  ghcr.io/knotrel/knotrel-console:1.2.0

The server must be reachable from the container. A server bound to the host’s loopback is not reachable through host.docker.internal on Linux. Prefer a shared Docker network, as in the Compose example. Do not expose an unauthenticated server just to reach it.

Container configuration

Variable Default Meaning
KNOTREL_CONSOLE_UPSTREAM required Server base URL, http(s)://host[:port][/path], no credentials, query or trailing slash. Fixed for the container’s lifetime.
KNOTREL_CONSOLE_LISTEN 8080 [::]:8080 Addresses the container listens on (space separated: port, IPv4:port or [IPv6]:port). Set 127.0.0.1:8080 when a gateway shares the container’s network namespace, so only the gateway can reach it. The image’s health check uses 127.0.0.1:8080.
KNOTREL_CONSOLE_SERVER_NAMES localhost 127.0.0.1 [::1] Accepted Host names (space separated). Requests for any other host get 421. Add the public name when a gateway forwards to the container.
KNOTREL_CONSOLE_SERVER_LABEL the upstream URL Server name shown in the connection indicator (display only).
KNOTREL_CONSOLE_FORWARD_GATEWAY_IDENTITY off on relays X-Knotrel-Auth-Subject, -Tenant and -Roles to Knotrel; off sends no X-Knotrel-Auth-* header at all. Any other value stops the container. Enable it only behind an authenticating gateway that is the only client able to reach the console (Gateway-verified identity).
KNOTREL_CONSOLE_UPSTREAM_TIMEOUT 35s Upstream send/read timeout. It exceeds the server’s 30 s request timeout so that the server’s request_timeout is reported when it applies.

Every console variable is named KNOTREL_CONSOLE_*. The server reserves that prefix for the console and ignores it, so one environment file can serve both containers (startup configuration).

Deprecated aliases. Before 1.0 the upstream variables were named KNOTREL_UPSTREAM and KNOTREL_UPSTREAM_TIMEOUT; the new names are new in 1.0.0, and console images up to 0.9.x accept only the old ones. The console still accepts the old names, throughout the 1.x series, as aliases of KNOTREL_CONSOLE_UPSTREAM and KNOTREL_CONSOLE_UPSTREAM_TIMEOUT; their removal follows the deprecation rule. For each pair, where an empty value counts as not set:

New name Alias Result
set not set The new name is used.
not set set The alias’s value is used; a deprecation warning is written to stderr at startup.
set set, same value The new name is used; a deprecation warning is written to stderr at startup.
set set, different value The container refuses to start and names both variables.
not set not set The default applies (KNOTREL_CONSOLE_UPSTREAM is required: the container refuses to start).

Refusing different values, rather than letting one name win, keeps an outdated alias left in an environment file from silently redirecting, or being silently overridden for, the console’s only upstream.

Invalid values stop the container at startup, including any value that contains a line feed or a carriage return (every value must be a single line). The image runs nginx as uid 101, listens on port 8080, works with a read-only root filesystem and a tmpfs at /tmp, and has a health check on /healthz. That endpoint reveals nothing about the server.

Install in your environment

  1. Download knotrel-console-<version>.tar.gz and its .sha256 from the GitHub Release v<version> (the same release as the server), then verify and extract them:

    sha256sum -c knotrel-console-0.8.0.tar.gz.sha256
    tar -xzf knotrel-console-0.8.0.tar.gz
    (cd knotrel-console-0.8.0 && sha256sum -c SHA256SUMS)
    
  2. Serve knotrel-console-<version>/html/ as static files.
  3. On the same origin, forward exactly these routes to one Knotrel server, stripping the /api prefix:

    Console request Server request Used by
    GET /api/health, GET /api/ready GET /health, GET /ready Overview
    GET /api/v1/info, GET /api/v1/stats GET /v1/info, GET /v1/stats Overview, Browser counts
    POST /api/v1/operations POST /v1/operations Queries and operations
    POST /api/v1/batch POST /v1/batch (allow 1 MiB bodies) Workbench batches
    GET /api/v1/nodes, GET /api/v1/nodes/{id}, GET /api/v1/nodes/{id}/edges, GET /api/v1/edges Same paths without /api Browser
    GET /api/metrics GET /metrics Performance, Synchronization
    GET /api/v1/graphs, GET /api/v1/graphs/{graph_id} Same paths without /api Graphs (new in 1.3, server 1.3)

    Forward nothing else: feeder endpoints must not be reachable through the console origin, and graph resources only with GET (graph resources). Do not retry upstream requests (proxy_next_upstream off in nginx): a retried mutation could be applied twice.

  4. Put TLS and access control in front of both the UI and /api. Forward no client headers except Accept, Content-Type and, for a server with KNOTREL_AUTH=gateway-identity, the three identity headers your gateway sets itself (gateway-verified identity).
  5. Optionally serve console-config.json next to index.html, for example {"serverLabel":"knotrel-prod-1"}, to show which server the gateway uses.

The archive includes nginx/knotrel-console.conf, a commented nginx example. The console uses the relative prefix api/, so the same build works at / or under a sub-path, with no rebuild per installation.

Optional gateway signal

The bundled container sets X-Knotrel-Console-Proxy on answers it generates itself. Your gateway may set it too:

Value Meaning How the console treats a mutation
upstream_unreachable No byte reached the server (connection refused or connect timeout). Not delivered (rejected).
upstream_failed The connection failed after the request may have been sent. Outcome uncertain.
upstream_timeout No answer within the gateway timeout. Outcome uncertain.
rejected The gateway refused the request (route, method, origin, size). Rejected.

Without the header, a gateway error is shown as its plain HTTP status. A 5xx answer to a mutation is then treated as uncertain.

Trust boundary

Gateway-verified identity

New in 1.3 (#226). With KNOTREL_AUTH=gateway-identity the server authenticates every request, probes and metrics included, from the identity headers a trusted gateway sets (deployment requirements, wire contract). The console works with it as follows.

Making the console reachable only by the gateway

Pick one; check it from another host or container before enabling the relay.

Never publish the console port on a public interface while the relay is on. A quick check, from a container on the same network but outside the trusted set: wget -T 3 http://<console>:8080/healthz must fail.

Graph resources

New in 1.3 (#238). The experimental graph resource routes (/v1/graphs, graph resources) are partly available through the console.

Forwarding decision (#238). The console gateway (the container and the archive’s example gateway) forwards only the read routes:

Route Forwarded Otherwise
GET /v1/graphs (with limit, after and tenant as sent) yes  
GET /v1/graphs/{graph_id} (identifier g_ and a UUID) yes other paths below /api/v1/graphs/ get 404 from the gateway
POST /v1/graphs, PATCH and DELETE /v1/graphs/{graph_id} no 405 from the container (X-Knotrel-Console-Proxy: rejected), 403 from the archive’s example gateway

This matches the rest of the allowlist: the console forwards read-only routes plus queries and operations on the default graph, and creating, changing or deleting graphs needs the graph-admin role and stays with administrative clients. The tenant parameter is passed on: Knotrel honors it only for a principal with tenant-admin (and answers 422 without authentication).

Graphs page. A read-only list of the caller’s tenant’s graphs, paged with the server’s cursor (limit=50, then after = the previous next_after, until next_after is null; at most 1000 rows are kept), with name, ID, status, environment, engine and creation time. Selecting a graph reads its record again (GET /v1/graphs/{graph_id}) and shows every field, including metadata. Server text is rendered as text. Without authentication the list shows the local tenant’s graphs. A server older than 1.3 answers 404 and the page says graph resources need server 1.3.

Out of scope. Browsing a graph’s nodes and edges: the server has no per-graph data routes yet (G2 of #155), so the Browser, Workbench and the other pages keep acting on the default graph, which is not a graph resource and is never listed. Graph management (create, change, delete) is not offered.

Capabilities and API mapping

Every value comes from these endpoints. Values the API does not expose are shown as “Unavailable”, with the reason; they are never inferred.

View Endpoint Fields used
Overview GET /health, GET /ready, GET /v1/info, GET /v1/stats Liveness, readiness label, mode, engine, topology_lifecycle, inspection, counts, capacity; attention items derived from these and from metrics availability
Browser: lists GET /v1/nodes, GET /v1/edges Pages of nodes (ID, active, degree) and edges (enabled, effective), cursors, version headers per page
Browser: counts GET /v1/stats node_count, active_node_count, edge_count, enabled_edge_count, effective_edge_count
Browser: node detail GET /v1/nodes/{id}, GET /v1/nodes/{id}/edges Flags, registered degree, incident edges with enabled/effective
Browser: edge detail edge_state via POST /v1/operations, GET /v1/nodes/{id} for both endpoints Desired state (enabled) and effectiveness with the endpoints’ active flags
Browser and Workbench operations POST /v1/operations, POST /v1/batch changed, error envelopes, per-operation batch results, X-Knotrel-State-Version
Workbench queries POST /v1/operations connected, node_state, edge_state and the version headers of the same response
Performance GET /metrics knotrel_http_requests_total, knotrel_http_request_duration_seconds, knotrel_requests_rejected_total (by reason and, from 1.0.0, lane), knotrel_requests_outcome_uncertain_total, knotrel_graph_jobs_outstanding and knotrel_graph_job_capacity (one row per lane from 1.0.0, each lane’s outstanding count over that lane’s capacity; one unlabelled row for earlier servers), job queue/lock-wait/execution histograms
Graphs GET /v1/graphs, GET /v1/graphs/{graph_id} id, name, status, environment, engine, mode, tenant, created_at, revision, description, metadata; cursor next_after
Synchronization GET /v1/stats, GET /ready, GET /v1/info, GET /metrics sync_status, generation, source_position, state version, readiness label, knotrel_feeder_lease_remaining_seconds, knotrel_feeder_last_applied_age_seconds

Not exposed, so shown as unavailable:

Mode and capability rules

Server Queries Topology operations
Standalone, lifecycle off connected add_node, link, cut
Standalone, lifecycle on (compact-bfs) connected, node_state, edge_state all six, including permanent removal (typed confirmation)
Source-managed connected (and node_state/edge_state with lifecycle) none. Changes belong in the authoritative source and its feeder. The console never sends session, heartbeat, import, event, gap or barrier requests.

Unsupported actions are disabled with an explanation. They are not hidden silently.

Screens

Screenshots of the demo network (console/scripts/seed-demo.sh) at 1280×720. To refresh them, start the local stack, load the demo network and run node console/scripts/capture-screenshots.mjs; the script only runs queries.

High-degree node. Neighbors are paged in a bounded box, so the connectivity check stays in view.

Node 100 with 150 neighbors, paged 25 at a time

Edges and the light theme. The state filter lists edges that do not carry connectivity; the detail shows the desired state, effectiveness and both endpoints.

Edge list filtered to not effective, with edge 2–3 selected, in the light theme

Connection details. The server (backend) and the console host the browser talks to (frontend) are shown separately.

Connection panel open over the browser

Workbench. Queries, a validated batch editor, saved requests and the console history.

Workbench with a connectivity query result

Performance. Rates and server-side latency per route, computed from /metrics scrapes taken by this tab.

Performance page with request rates and latency per route

Overview. Connection, readiness, server configuration, graph counts and what needs attention.

Overview page

Behavior

Compatibility

Versioning rule. The console, knotrel-server and knotrel-core share one version number (lockstep) and are released together; use the console with the server of the same version. With the previous server minor the console still works except for features the server lacks. Console 0.9 was verified against server 0.8.0 and 0.9.0. Console 1.0.0 was verified on 2026-11-24 against the server built from the release commit, which reports version 1.0.0 in knotrel_build_info, and against server 0.9.0 built from tag v0.9.0 (browser tests, Chromium and Firefox, 14 of 14 on each browser for each server); with server 0.9 the Performance page shows one unlabelled admission row, because per-lane metrics start with server 1.0.0. Console 1.1.0 was verified on 2026-11-25 against the server built from the release branch (version 1.1.0) and against the published server v1.0.0 (release asset for macOS arm64, checksum verified): browser tests, Chromium and Firefox, 28 of 28 against each server. Server 0.9 was not tested again with console 1.1, so it is outside the 1.1 range; console 1.0 keeps its range. Console 1.2.0 was verified on 2026-11-29 against the server built from the release branch (version 1.2.0 in knotrel_build_info) and against the published server v1.1.0 (release asset for macOS arm64, checksum verified): browser tests, Chromium and Firefox, 28 of 28 against each server. Server 1.0 was not tested again with console 1.2, so it is outside the 1.2 range; console 1.1 keeps its range.

Within a supported server version, the server flags decide what is available; see Server flags, in short.

The console declares the server versions it supports in console/package.json (knotrel.supportedServer, currently >=1.2.0 <1.4.0): servers 1.2.x and 1.3.x, the same and the previous minor. With server 1.2 the Graphs page and gateway identity are not available: they need server 1.3. The range is read with npm (node-semver) rules, under which it admits no prerelease. It also records the SHA-256 of the docs/openapi.yaml revision it was generated from (knotrel.openapiSha256), which the archive’s console-manifest.json repeats. CI fails when the generated types or that digest are stale. Browser tests run against the server built from the same commit. The server exposes no software version, so the console cannot check compatibility at runtime; it reports incompatible responses instead.

Verified platforms and limitations

Area Coverage
Browsers Playwright against real servers on Linux: Chromium and Firefox (CI matrix). Locally also macOS. WebKit/Safari is not tested.
Container Linux runners (amd64); the release builds linux/amd64 and linux/arm64, and smoke-tests the amd64 image.
Static build and archive Built and unit-tested on Linux, macOS and Windows. CI checks that the three archives are byte-identical.
Accessibility axe-core checks (WCAG 2 A/AA, serious and critical findings fail) and keyboard-only flows. This is not a full manual audit.

Out of scope: global graph visualization (a local neighborhood view is not implemented yet), path reconstruction, multi-server management, bulk import, log streaming or search, a request profiler, historical metrics, an audit system, authentication in the console itself (it relies on the gateway in front of it), persistence, graph management (create, change, delete) and browsing the data of graph resources.

Development

See console/README.md for commands and docs/releases/console-release.md for the release procedure.