Expand description
Node side of enrollment: key generation in the node’s own state directory, the signed request with the operator’s one-time code, and the stored public answer.
Keys live in <state dir>/identity.key and <state dir>/wg.key (directory 0700, files
0600) and never leave the host; only public keys are sent. Run provider agents as another
user (or inside a guest) so they cannot read this directory.
Structs§
- Enrolled
State - Public result of a successful enrollment, stored next to the keys.
Enums§
- Enroll
Client Error - Enroll
Target - Where to send the enrollment request.
Functions§
- default_
enroll_ dir - Default state directory:
$XDG_STATE_HOME/gate4agent-node/enrollor$HOME/.local/state/.... - enroll
- Generate (or load) the keys, send the signed request, store the public answer.
- enroll_
to enrollto anyEnrollTarget.- load_
enrolled - Load the identity and the stored public answer of an enrolled node.
- load_
enrolled_ signing_ only - Load the identity for signing only (no WireGuard key is read) and the enrolled state. For a node whose tunnel is brought up by a privileged helper.
- node_
call - Make a signed mail/task call through C2 (
oplikemail.send,task.list). The node proves who it is with its identity key; no server credential is involved. Returns the reply JSON. - request_
build - Ask C2 to build and sign a configured recipe on the build host. The node proves who it is
with its identity key; it holds no build-host credential and never sees a signing key.
The receipt is checked against
trusted_signer(the operator-provided public key of the build host) and the artifact against the signed hash before it is returned. - wireguard_
env_ from_ state - Environment the kernel WireGuard bring-up reads, from the enrolled state. Only variables that are unset are filled. Returns the call-home address when the answer carries one.