Enroll a client
Each machine that runs moira enrolls separately with each host. An invite is single-use,
expires after 15 minutes, and carries the server’s certificate fingerprint, so the very first
connection is already pinned.
Create an invite and enroll
Section titled “Create an invite and enroll”On the host, ask the running daemon for an invite over its admin socket. Pipe it straight into
moira server add - so the secret never appears in process arguments:
ssh edge docker exec moirad moirad invite --name laptop | moira server add -✓ edge enrolled as "laptop" (https://192.0.2.10:7443)--nameoninvitedecides the client name, so a leaked invite can’t pick its own. Without it, the client’s hostname is used. Enrolling the same name again replaces the old token.moira server addchecks the certificate against the invite, exchanges the secret for a token, confirms the API version and saves the server to~/.config/moira/config.json.--name <alias>onserver addstores the server under a different local alias.- When stdin is piped or redirected, the
-can be omitted.
Repeat for every host.
Check the connection
Section titled “Check the connection”moira server lsHOST URL REACHABLE VERSION API CLIENT ERRORedge https://192.0.2.10:7443 yes v0.3.0 1 laptop —nas https://192.0.2.20:7443 yes v0.3.0 1 laptop —A host that doesn’t answer within two seconds is shown as unreachable and doesn’t block the others.
First commands
Section titled “First commands”moira ls # every service on every hostmoira ls --drift # only services with config or image driftmoira status shop-prod # detail for one service, wherever it runsmoira logs shop-prod -f # follow its logsmoira update shop-prod # pull its image tag and recreate itmoira ui --open # the same in a browserRead Targets next: it explains how a bare name like shop-prod finds its host.
Removing a server
Section titled “Removing a server”moira server rm edgeThis forgets the server locally. To also invalidate the token on the host, revoke the client there: see Clients and access.