Skip to Content
Xeonr Developer Docs

Announce hub

POST
/xmb.api.v1.HubAgentService/AnnounceHub

Reports the hub's WireGuard public key and returns its tunnel configuration. Authenticated by the hub token.

Authorization

BearerAuth
AuthorizationBearer <token>

An access token issued by the xeonr identity provider.

In: header

Header Parameters

Connect-Protocol-Version?number

Define the version of the Connect protocol

Connect-Timeout-Ms?number

Define the timeout, in ms

Request Body

application/json

hubToken?string

The hub token from the hub binary's configuration.

Length20 <= length <= 128
wgPublicKey?string

The hub's current WireGuard public key (base64, 32 bytes). Generated fresh at boot; a changed key is a rotation and replaces the previous one.

Length44 <= length <= 44
agentVersion?string

Version of the hub binary.

Lengthlength <= 64
resources?

The machine's resources as the hub sees them. Optional: a hub older than this field simply omits it, and the platform keeps whatever it last knew.

canIngest?boolean

Whether this hub can accept a delivery.

REPORTED RATHER THAN INFERRED FROM agent_version, which is what the design originally called for and cannot work. Receiving needs two things: a binary that serves IngestService, and a media mount the operator made writable by hand. A version number sees only the first — so a fleet on the current image with the old read-only compose would every one of them read as capable, download forty gigabytes and fail at the write.

The hub already knows the answer exactly: it is whether it mounted a writable filesystem AND built a token verifier, which is the same condition that decides whether it registers the handler at all. False from a hub too old to have the field, which is correct — such a hub cannot receive either.

canTranscode?boolean

Whether this hub can run an encoder.

Reported rather than inferred, for can_ingest's reason exactly: encoding needs an ffmpeg on PATH and a writable data volume for the session directory, and a version number sees neither. The hub reports the same condition that decided whether it built a transcode manager at boot. False from a hub too old to have the field — such a hub cannot encode either, so the platform's refusal stays honest for free.

previewSlots?integer

How many preview generations this hub runs at once — its PREVIEW_CONCURRENCY, the slot count pkg/preview bounds itself with. Reported for can_transcode's reason: only the hub knows what its operator sized it for, and different hubs are sized differently. The platform sends a hub at most this many files at a time; zero — a hub too old to report it, or one with no preview generator — means the platform's own default of one.

Rangevalue <= 64
internalAddresses?array<>

Private addresses on the hub's own interfaces — what an owner needs to reach it on their own network.

The platform rejects anything here that is not actually private, so a misconfigured or dishonest hub cannot use this list to publish a routable address as though it were a LAN one.

Itemsitems <= 32
externalAddresses?array<>

Globally routable addresses on the hub's own interfaces. Empty for a hub behind NAT, which is most of them.

Itemsitems <= 32
wgListenPort?integer

The UDP port this hub's WireGuard device is bound to.

Needed because a peer can only be dialled at a port that stays put, and wireguard-go picks an ephemeral one per boot unless told otherwise — which is why a hub could until now only be reached by dialling OUT. Delivery needs the other direction. Zero from a hub too old to report one, which is also a hub too old to accept a delivery.

Formatint32
Range0 <= value <= 65535
advertisedEndpoints?array<>

Endpoints the operator says this hub is reachable at, "host:port".

The ONE piece of the ladder nothing can discover: a NATed machine's interfaces carry only private addresses, and the port somebody forwarded on their router is knowledge only they hold. The platform can synthesize most of it (observed public IP + this hub's listen port covers a forward that keeps the port number); this override exists for the forward that does not. Empty for almost everyone, by design.

Itemsitems <= 8
peerLinks?array<>

The state of this hub's WireGuard session to each of its node peers, as of this announce. See PeerLink — the handshake is the probe, and this is how its result reaches the platform.

Itemsitems <= 128
lanCsrPem?string

PEM certificate signing request for this hub's local-delivery wildcard.

Sent only once a response has carried local_wildcard, and only until a chain covering it is held — the hub asks for what it was told to ask for and stops asking once it has it. The platform refuses any CSR whose SAN is not exactly the wildcard it assigned, which is what stops a hub minting a name for someone else's label.

Lengthlength <= 8192
lanListenPort?integer

The TCP port the LAN TLS listener is actually bound to, or zero.

Zero is the normal state and means every reason the listener is not up: no chain yet, no writable DATA_DIR, or the operator disabled it. Reported rather than assumed because the port is configurable, and a platform that minted local URLs against a default the hub is not using would hand every viewer an address that refuses the connection.

Formatint32
Range0 <= value <= 65535
bootId?string

This process lifetime's identity — the SAME id log shipping stamps on its batches, not a second one. It is the boundary the platform splits the cumulative counters in resources.network on: a new boot_id means the counters restarted from zero. Empty from a hub too old to send it, in which case a counter that goes backwards is treated as the reset marker.

Lengthlength <= 64
activeTranscodes?integer

How many transcode sessions this hub's encoder is running right now. Reported by the process that runs ffmpeg because nothing else can see a session the platform's bookkeeping lost track of.

Rangevalue <= 1024
[key: string]?never

Response Body

application/json

application/json

curl -X POST "https://xmb.gg/xmb.api.v1.HubAgentService/AnnounceHub" \  -H "Connect-Protocol-Version: 1" \  -H "Connect-Timeout-Ms: 1000" \  -H "Content-Type: application/json" \  -d '{}'
{
  "uuid": "5f0c2a9e-8b1d-4c3a-9e2f-7a6b1c4d8e01",
  "tunnelCidr": "10.100.0.8/29",
  "primaryIp": "10.100.0.8",
  "gateways": [
    "map[endpoint:gw-0.xmb.xeonr.dev:51820 tunnelIp:10.100.0.1 wgPublicKey:q7Lx2nV9cB4mZ1sD8fH3jK6pR0tW5yA2eG7iN4oU9bM=]"
  ],
  "jwksUrl": "https://xmb.xeonr.dev/api/v1/media/jwks.json",
  "nodePeers": [
    "map[candidates:[map[endpoint:192.168.1.52:51821 kind:PEER_CANDIDATE_KIND_LAN] map[endpoint:198.51.100.7:51821 kind:PEER_CANDIDATE_KIND_REFLEXIVE]] tunnelCidr:10.100.0.16/29 uuid:c81e4b2a-3f5d-4a7c-b9e0-1d2f3a4b5c6d wgPublicKey:Hc3vN8bQ1xL6zT4mR9kW2pF7sJ0dY5gA3eU8iO1nVwE=]"
  ],
  "settings": "map[HUB_WG_MTU:1280]",
  "localWildcard": "*.k3f9x2ab.xmbsrv.com",
  "localChainPem": "-----BEGIN CERTIFICATE-----\nMIIDEXAMPLE...\n-----END CERTIFICATE-----\n",
  "telemetry": "map[expiresIn:3600s token:EXAMPLE-lantern-device-token url:https://in.lntrn.dev]",
  "controlAuth": "map[audiences:[https://xmb.gg urn:xeonr:auth:application:08fc3508-988f-4074-ae5d-b7fd72c38e0b] enforce:true issuer:https://auth.xeonr.io scopes:[xmb:nodes:admin] subjects:[urn:xeonr:auth:uid:service_account:14]]"
}