Skip to content

feat(repeater): identify the process in the connection handshake - #833

Open
aborovsky wants to merge 2 commits into
nextfrom
feat/repeater-instance-identity
Open

aborovsky wants to merge 2 commits into
nextfrom
feat/repeater-instance-identity

Conversation

@aborovsky

@aborovsky aborovsky commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Today the server cannot tell apart two Repeater processes that use the same Repeater ID and token. Both appear as the same domain, often behind the same egress IP. This PR makes each process identify itself.

Changes

  • CliInfo.instanceId: 8 hex characters from crypto.randomBytes(4), generated once per process. It stays the same across reconnects of one process (Socket.IO reuses the handshake auth) and changes on every process start. It only has to tell apart the few processes sharing one Repeater ID, so it is kept short enough to read out to support.
  • The Socket.IO handshake auth is now { token, domain, instanceId, version, hostname }, where hostname is os.hostname() (the pod name in Kubernetes).
  • The line printed once the Repeater is deployed shows the ID, so a customer can match it with what support sees on the server:
    The Repeater (13.17.2) started, instance ID: 3f9a1c07

The new fields go into auth rather than the deploy runtime payload. Servers ignore unknown auth keys, but the runtime DTO has additionalProperties: false and would reject unknown properties.

Compatibility

Checked locally against a bridges-api built from current main: the Repeater connects and deploys as before, and the extra auth fields are ignored.

Tests

  • CliInfo.spec: the ID is 8 hex characters and differs between instances.
  • DefaultRepeaterServer.spec: the handshake auth carries instanceId, version and hostname, and reconnects reuse the same socket and so the same ID.
  • ServerRepeaterLauncher.spec: the "started" line prints the ID after a successful deploy.

Generate a random instance ID once per process and send it in the
Socket.IO handshake auth together with the CLI version and the host name,
so the server can tell apart two processes that use the same Repeater ID.
The fields go into auth rather than the deploy runtime payload because
servers ignore unknown auth keys but reject unknown runtime properties.

The startup line prints the instance ID so it can be matched with what
the server logged.
@aborovsky aborovsky self-assigned this Nov 24, 2026
Use 8 random hex characters instead of a UUID. The ID only has to tell
apart the few processes sharing one Repeater ID, and a short one is easier
to read out to support. Print it on the "started" line, after the
deployment succeeds.
@aborovsky
aborovsky marked this pull request as ready for review November 24, 2026 12:16
Comment thread src/Config/CliInfo.spec.ts Resolved
Comment thread src/Config/CliInfo.ts Resolved
@aborovsky aborovsky added the Type: enhancement New feature or request. label Nov 24, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: enhancement New feature or request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants