Devices the crew may SSH to
A crew run's shell reaches the forge and the registry only, unless its repository lists a granted device.
- A repository admin lists one:
POST /api/v1/repos/:owner/:name/crew-deviceswith{"device":"[email protected]:22","secret":"ARM_PI_SSH_KEY"}. Exactuser@host:port, no range; the key is a secret at the repository's own scope. - A site admin grants it:
POST …/crew-devices/grantwith{"device":"…"}. The forge reads the host key the device shows right then and pins it (or takehost_keyfrom the admin). A device is named by its IPv4 address: a name is refused (ssh would resolve it again at run time), and so is an IPv6 or mapped address. - A run on that repository then has exactly that
host:portin its sandbox, the key in a 0600 file, a pinnedknown_hostsand anssh <alias>config, all in its own temp directory and removed at the run's end. The brief names the device and the rules (read and test freely, restart only what sudo allows, never change users, keys or network). GET …/crew-deviceslists the devices and the sessions (crew.device.sessionevents: who, when, arguments). The session note is the run's own report, not an audit; the device's logs are.
DELETE …/crew-devices (the device in the body) unlists; changing the secret drops the grant.
Both doors: Settings › Devices (src/web/pages/crew_devices.ts) and the terminal screen (src/tui/screens/crewdevices.ts,
palette entry Devices in a repository you administer: a lists, g grants, x unlists, s flips to the sessions)
use the same actions. A repository admin lists, unlists and reads; only a site admin grants; anyone else sees nothing.
Each write is an event, so an open page or screen follows.
The ssh wrapper refuses a run's own -o, -F and -J so the pinned host key and the forwarding bans stand against
ssh <alias>; but a run can still start the real ssh by its path, so the pin is not enforced against a hostile run.
What bounds it is the sandbox: it reaches only that host:port. If nc is missing the device is not reachable and
named so in the run's log.