Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2305,6 +2305,43 @@ pod's console `lan-tls` or the web app's pod Settings.
Drop this computer's pin for the pod; the next TLS connection pins what it
presents.

### `benchpod lan-clients`

List the computers paired with the pod (firmware 4.0.1 and later). Over Ethernet and
Wi-Fi the pod answers only status to a computer that is not paired; `benchpod setup`
pairs this computer over the pod's USB-C cable on its own. The list marks this computer.
Over USB (the console or `--connection usb`), embeddedci.com (`--connection
embeddedci:<name>`), or a paired computer on the network.

### `benchpod lan-clients add`

Pair this computer: its TLS client key (made on first use, `client.key` and `client.crt`
next to `known_pods.json`) goes on the pod's list. Only over USB or embeddedci.com (as an
organization owner or admin), never over the network.

| Flag | Default | Purpose |
|-------------|-----------------|----------------------------------------------------------------------|
| `--name` | this host name | The name the pod lists it under (1 to 23 characters). |
| `--new-key` | off | Make a new key, pair it and print its certificate and key PEM once, for a CI runner's `BENCHPOD_CLIENT_KEY_PEM` secret. Needs `--name`. |

A runner with `BENCHPOD_CLIENT_KEY_PEM` (or `BENCHPOD_CLIENT_CERT` and
`BENCHPOD_CLIENT_KEY`, files) uses that key instead of its own.

### `benchpod lan-clients remove`

`benchpod lan-clients remove <name|key>`: unpair every computer with that name, or the
one key that starts with these hex digits (8 or more). Only over USB or embeddedci.com.

### `benchpod lan-clients clear`

Unpair every computer. Only over USB or embeddedci.com.

### `benchpod lan-pairing [on|off]`

Show or set LAN pairing (firmware 4.0.1 and later). `on`, the default: a computer on
Ethernet or Wi-Fi drives the pod only once it is paired. `off`: every computer on the
network may, as before 4.0.1. Only over USB or embeddedci.com. Stored on the pod.

### `benchpod usb-network [show|on|off]`

Show the pod's USB network setting, or turn its USB network adapter on or off
Expand Down
13 changes: 12 additions & 1 deletion cmd/benchpod-cli/commands_discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ type discoveredPod struct {
reachable bool
healthErr string // why the API check failed, when it did
cloud cloudState
sameAs string // serial device of the pod this is (the same physical pod)
// LAN pairing (firmware 4.0.1+): pairingKnown when the pod reports it; unpaired when this
// computer must pair before it can do more than read status.
pairingKnown bool
unpaired bool
sameAs string // serial device of the pod this is (the same physical pod)
}

// cloudState is the pod's view of its registration, from `cloud_status`.
Expand Down Expand Up @@ -200,6 +204,8 @@ func checkPod(p *discoveredPod) {
p.cloud.known = true
}
}
known, required, paired := lanPairing(p.addr)
p.pairingKnown, p.unpaired = known, known && required && !paired
}

// correlate marks each network pod that is the same physical device as one of
Expand Down Expand Up @@ -783,6 +789,11 @@ func describeHealth(p discoveredPod) string {
parts = append(parts, fmt.Sprintf("registered, cloud %s", strings.ToLower(strings.TrimSpace(p.cloud.State))))
}
}
if p.unpaired {
parts = append(parts, "this computer is not paired (status only: plug the pod into it over USB-C and run `benchpod setup`)")
} else if p.pairingKnown && p.reachable {
parts = append(parts, "paired")
}
if v := apiVerdict(p.api); v != "" {
parts = append(parts, v)
}
Expand Down
Loading