HydraIssues

hydraepiphan: serve a live Pearl interface at hydraepiphan.experiencenet.com
open feature Project: hydraepiphan Reporter: 17 Oct 2026 15:04

Description

Goal

Serve a live operator interface at https://hydraepiphan.experiencenet.com for Epiphan
Pearl devices, starting with the Pearl-2 at cloud-seven (11.0.5.110, serial TSKB03679,
firmware 4.24.6).

Status: built and verified locally, NOT live

The service exists and works. It cannot be visited yet. Three items remain, listed under
"Next steps".

Done

Repo github.com/cederikdotcom/hydraepiphan, commits 3b784c6 and 085d286.

  1. internal/pearl: typed client for the Pearl HTTP API. Every endpoint verified against
    the live unit, except the two recorder control calls (see "Not verified").
  2. internal/central plus internal/worker: the service in two halves, forced by the
    network (see "Architecture").
  3. internal/iamnim plus internal/access: iamnim sign-in and capability gating.
  4. CLI: status, channels, recorders, record, serve, worker.
  5. Dockerfile is now a two-stage Go build on :8080 as a non-root user, honouring LISTEN.
    The old static Caddy page and web/index.html are deleted.

Verified live

Against the real iamnim, using a PAT scoped to visit-flanders:

  • GET /devices/cloud-seven-pearl2 returns 200 and renders TSKB03679, 4.24.6, 11.0.5.110.
  • Anonymous gets 303 to sign-in. A signed-in person with no role gets 403 and is NOT
    redirected back to sign-in, so nobody loops.
  • A Start click queues a command attributed to the signed-in user. The worker claims it
    exactly once; the second claim returns empty.
  • Audit line: actor=u_717adf7feb08 email=cederik@cederik.com venue=cloud-seven recorder.start recorder=2 command=cloud-seven-pearl2-1.

Also verified: hydraneck v0.18.1 is live and the Pearl now classes as av
(00:05:B7 added to the OUI table). Confirmed by rescan, not assumed.

Architecture, and why

operator -> hydraepiphan serve (public scale) <- outbound -- hydraepiphan worker (venue) -> Pearl

A central page CANNOT reach the Pearl. cloud-seven's hydraguard peer advertises a stale
10.0.2.0/24, the router is Citymesh-managed, and the hydraguard-air role on both venue
nodes enrols a single /32 advertising no LAN. There is also no Linux or Incus host at the
venue to run a scale on. So every connection is outbound from the venue.

Consequences, enforced in code and covered by tests:

  • serve holds NO device credential. Only the worker does, from its own environment at the
    venue. This removes the secrets store from the deployment path entirely.
  • The command vocabulary is closed (state.ValidAction). Central cannot ask a worker to run
    arbitrary work at a venue.
  • Commands are delivered AT MOST ONCE. A replayed recorder start could leave a venue
    recording for hours.
  • A snapshot's device id comes from the path, never the body.
  • Unreachable and idle render differently.

hydracluster exec on cosmic-pretzel-98 (node-4c2be4b0, Windows) was how the API was
mapped and is fine for one-off probing. It is deliberately NOT how the service works: its
only credential is the fleet-wide hydracluster admin token, and exec command strings are
retained and readable through GET /api/v1/nodes/{id}/exec/queue.

Next steps, in this order

  1. SCALE_REGISTRY_TOKEN is missing. This repo has never produced an image: its only
    tag, v0.1.0, failed in 29 seconds at docker/login-action on 2026-09-11 because the repo
    had zero Actions variables and secrets. SCALE_REGISTRY and SCALE_REGISTRY_USER are
    now set. The token is the last piece. GitHub secrets cannot be read back, so it cannot be
    copied from another repo; use the piped command in hydraskin
    docs/runbooks/hydraskin.md, "Rotating the registry token", which keeps the value off
    the command line. NOTE: that token is flagged as having leaked into a build log and is
    still pending rotation, so copying it forward inherits that debt.
  2. Tag v0.1.1. Never re-point v0.1.0. Then verify the run CONCLUSION and that a
    linux/arm64 manifest exists: every online hydraskin node is arm64, so an amd64-only
    image cannot run anywhere.
  3. Create DNS hydraepiphan A 141.227.136.199 in the Hetzner zone experiencenet.com
    (zone 788422, hydraexperiencenet context). It does not exist today. Do this AFTER the
    image exists and BEFORE labelling the scale: ACME here is HTTP-01, so the name must
    resolve first or the certificate fails.
  4. Launch the scale on an online arm64 hydraskin node with
    hydraskin launch hydraepiphan --image scaleregistry:hydraepiphan:v0.1.1 --port 8080 --domain hydraepiphan.experiencenet.com --health-path /api/v1/health --apply, driven
    through POST /api/v1/nodes/{id}/exec. There is no route API: a scale becomes public by
    being labelled user.hydra.domain / user.hydra.port / user.hydra.health_path, which
    hydraskin's reporter posts to hydracluster and hydrascalerouter turns into a Traefik
    router. /var/lib/hydrascalerouter/routes.json is the router's OUTPUT cache, not an
    input.
  5. Host the worker at cloud-seven. NOT SOLVED, and not trivial. The only dependable
    venue node is Windows (cosmic-pretzel-98); the Mac turbo-pancake-76 is frequently
    agent-down. This needs a supervised Windows service. hydrabiamp hit the same wall; see
    its docs/runbooks/cloud-seven-tesira-gateway.md for the interactive-session boundary.
    Until this is done the page honestly renders "never reported" rather than live data.
    The worker needs HYDRAEPIPHAN_PASSWORD and HYDRAEPIPHAN_WORKER_TOKEN in its own
    environment.

Not verified, do not claim otherwise

  • Recorder start and stop are UNVERIFIED against hardware. The device answers a
    wrong-method request with 404 rather than 405, so the control path cannot be probed
    read-only: a GET on the KNOWN-GOOD publisher control path also returns 404. Confirming
    requires actually POSTing, which starts a real recording on live venue gear. Test on
    recorder "2" (Auto B) first. The page carries this warning and a test asserts it stays.
  • Whether the authenticated admin UI is genuinely slow. The unauthenticated 401 page
    answers in 9 to 51 ms from the venue LAN, with GET as fast as HEAD, so this is not the
    hung-GET failure of #684 and not the network. The original "very slow" report came from
    the Mac, which points at the macOS Local Network block of #657 rather than the Pearl.

Device API facts worth keeping

  • Every response is an envelope: {"status":"ok","result":...}.
  • A wrong-method request answers 404, not 405.
  • Recorders are TOP LEVEL: /api/recorders. /api/channels/{id}/recorders is a 404.
  • A recorder exposes list and state only. No /api/recorders/{id}, no /settings, no
    /files, and NO recording inventory or download endpoint anywhere on this firmware.
    Files leave only through AFU (/api/afu/status), which currently reads disabled. There
    is therefore no recordings list to render, and the page says so.
  • Plain HTTP only, Basic auth as admin. Password is in the hydraneck secrets store under
    cloud-seven/epiphan-pearl2. hydraneck has NO read route for a secret value by design,
    so nothing can fetch it at runtime; the worker needs its own copy.
  • eth0 reports 11.0.0.0/20, so 11.0.5.x, 11.0.6.x and 11.0.11.x are one flat subnet.

Separate findings, not part of this work

  • Channel 1 has been encoding a dead input. /api/channels/1/status gave
    {"state":"started","nosignal":192251,"bitrate":5919,"duration":190531}: about 2.2 days
    of encoding at 5.9 Mbps with nosignal HIGHER than duration, publishing nowhere
    (eth0 tx only 6.2 MB against rx 32 MB). Worth a look on site.
  • The Pearl's IP moved. It was 11.0.6.76, it is now 11.0.5.110. It is a DHCP lease and
    will move again; find the unit by MAC 00:05:B7:EE:AA:3D or hostname TSKB03679 in a
    hydraneck scan. The hydraepiphan README and runbook are updated (2cb21de).
  • The Pearl-2 asset is now in the hydravenues cloud-seven layout under
    ground / studio-7-tech, carrying neck_client_mac rather than an IP so it survives a
    lease change.
  • The hydraneck working checkout has uncommitted Biamp TEC-1 and Tesira classifier changes
    from another session, which will conflict lightly with v0.18.1 on their next pull.

Authorization, and a known gap

iamnim is the only way in. Capabilities are hydravenues' vocabulary: view:technical to
read device state, edit:technical to start or stop recording.

internal/access currently decides from ORGANIZATION MEMBERSHIP ONLY, which is an
acknowledged interim. For writes it is exact: edit:technical is held by RoleOwner alone
and owning-org membership is what resolves to owner, so nobody gains anything. For READS it
is strictly narrower than the truth: manager, buildout and partner also hold
view:technical, but only through grants in hydravenues that this service cannot see. An AV
partner at cloud-seven (Grant.Domain = "av") is exactly who would open a Pearl status page,
and this gate refuses them.

The fix is a read-only GET /api/v1/venues/{id}/me on hydravenues answering
{role, via, capabilities[]} for the caller's own token. Then Viewer.Can becomes a lookup
against that answer and nothing else in hydraepiphan changes. Filing that separately is
reasonable.

Session Context

Venue
cloud-seven