Skip to content

The admin API

The admin API is the API service hopbox.admin.v1. Instance admins and root on a control server use it to operate the whole install. The hopbox CLI and the SDKs never include it. This page lists its calls and the admin socket. The API server covers the parts that every call shares: the request gate, the policy check, the idempotency keys, and the error codes. The generated reference is Admin API.

Listener Callers that the policy allows Use
The admin socket, <run_dir>/admin.sock local_root hopboxd admin on the server (hopboxd)
The API listener, control.api_listen admin_key, except for the calls of KeyringService, MailService, LoginLinkService, and AdminKeyService. An admin session, for the calls of the Admin area. The hopbox Terraform provider and scripts, with an admin API key in the header Authorization: Bearer hbxadm_... (CLI tokens, API keys, admin API keys, and SSH keys). The Admin area of the console, with the session cookie (Console).
The domain of the install, through the edge servers, which forward it to the internal listener (the edge role) as on the API listener The same callers from outside the server, such as https://example.com/hopbox.admin.v1.ServerService/ListServers. The admin API is public behind the edge, for admin API keys and admin sessions.

The admin API has these services:

Service Calls
hopbox.admin.v1.InstallConfigService GetInstallConfig, UpdateInstallConfig, GetSMTPConfig, SetSMTPConfig, ClearSMTPConfig, GetOAuthConfig, SetOAuthClient, ClearOAuthClient, SetMaintenance, SetAlertToken, ClearAlertToken
hopbox.admin.v1.KeyringService RotateKEK, StageKEK, PromoteKEK, ListKEKs, RewrapSealedValues
hopbox.admin.v1.MailService ListMailFiles, GetMailFile
hopbox.admin.v1.LoginLinkService CreateLoginLink
hopbox.admin.v1.InstanceAdminService ListInstanceAdmins, GrantInstanceAdmin, RevokeInstanceAdmin, ListAdminNotices, DismissAdminNotices
hopbox.admin.v1.AccountService ListAccountSignInMethods, RemoveAccountSignInMethod, DeleteAccount, ListAccounts, SuspendAccount, UnsuspendAccount, ApproveAccount, RejectAccount, SetAccountTier, ListSignUpBlocks, BlockSignUp, UnblockSignUp
hopbox.admin.v1.ServerService CreateEnrollmentToken, ListServers, GetServer, CordonServer, UncordonServer, SetServerLabels, DecommissionServer, DrainServer, CancelDrain, ListControlProcesses
hopbox.admin.v1.PoolService CreatePool, GetPool, ListPools, DeletePool
hopbox.admin.v1.SizeService CreateSize, GetSize, ListSizes, RetireSize
hopbox.admin.v1.OrgService ListOrgs, SuspendOrg, UnsuspendOrg, SetOrgLimits, GetDefaultOrgLimits, SetDefaultOrgLimits
hopbox.admin.v1.AdminKeyService CreateAdminKey, RegisterAdminKey, ListAdminKeys, RevokeAdminKey
hopbox.admin.v1.MachineService ListMachines, StopMachine, DeleteMachine, MoveMachine, CancelMove, ListMoves
hopbox.admin.v1.ImageService RegisterImage, ListImages

An admin session is the console session of an instance admin whose sign-in is at most 10 minutes old (Sessions, cookies, and sign-in links). The Admin area of the console calls the admin API with it (Console). The cookie rules of the public API hold for these calls too. Each call must carry the Origin header of the install and the header Connect-Protocol-Version: 1 (Sessions, cookies, and sign-in links). So a page of another site cannot make an admin call with the cookie of a browser.

An admin session can make these calls, and no other call of the admin API:

Service Calls
hopbox.admin.v1.InstallConfigService GetInstallConfig, UpdateInstallConfig, GetSMTPConfig, SetSMTPConfig, ClearSMTPConfig, GetOAuthConfig, SetOAuthClient, ClearOAuthClient
hopbox.admin.v1.InstanceAdminService ListInstanceAdmins, GrantInstanceAdmin, RevokeInstanceAdmin, ListAdminNotices, DismissAdminNotices
hopbox.admin.v1.AdminKeyService CreateAdminKey, ListAdminKeys, RevokeAdminKey
hopbox.admin.v1.ServerService ListServers, GetServer, CordonServer, UncordonServer, SetServerLabels, DrainServer (only of a server that hosts no control process), CancelDrain
hopbox.admin.v1.PoolService CreatePool, GetPool, ListPools, DeletePool
hopbox.admin.v1.SizeService CreateSize, GetSize, ListSizes, RetireSize
hopbox.admin.v1.AccountService ListAccounts, SuspendAccount, UnsuspendAccount, ApproveAccount, RejectAccount, SetAccountTier, ListSignUpBlocks, BlockSignUp, UnblockSignUp
hopbox.admin.v1.InvitationService CreateInstanceInvitation, ListInstanceInvitations, RevokeInstanceInvitation
hopbox.admin.v1.OrgService ListOrgs, SuspendOrg, UnsuspendOrg, SetOrgLimits, GetDefaultOrgLimits, SetDefaultOrgLimits
hopbox.admin.v1.MachineService ListMachines, StopMachine, DeleteMachine
hopbox.admin.v1.ImageService ListImages

The Admin area also reads the audit log of the whole install with ListAuditEntries of the public API, under the same rule. The same rule holds for the audit log of an org in which the instance admin is not an owner or an admin (the sign-in, account, and audit API).

The other calls hand out a secret, or change what only root on a control server or the hopbox Terraform provider changes:

Calls Reason
SetMaintenance, SetAlertToken, ClearAlertToken, CreateLoginLink, RegisterAdminKey, and the calls of KeyringService and MailService Only root on a control server makes them (The admin socket).
CreateEnrollmentToken and DecommissionServer The hopbox Terraform provider adds and removes servers. An enrollment token is a secret.
RegisterImage, GetCertificate, ListControlProcesses, ListAccountSignInMethods, RemoveAccountSignInMethod, and DeleteAccount No page of the Admin area uses them. They stay with root on a control server and with admin API keys.

The policy check of the service layer decides each call, the reads too (the API server). The console only hides the pages of the Admin area from other accounts. It is not the check.

Caller Result
The session of an instance admin, at most 10 minutes after its sign-in, on a call of the table The call runs. Its audit entry has the actor kind session, the account, and the session.
The session of an instance admin, more than 10 minutes after its sign-in, on a call of the table permission_denied with the message permission denied: this action needs a sign-in within the last 10 minutes. Sign in again, then retry, and the detail hopbox.v1.RecentSignInRequired (the sign-in, account, and audit API). The call writes no audit entry.
The session of an instance admin, on any other call permission_denied without the detail. A new sign-in does not change it.
The session of an account that is not an instance admin permission_denied without the detail, on every call.
The CLI token of an instance admin permission_denied. The hopbox CLI never calls the admin API.
A session cookie without the Origin of the install, or without the Connect protocol unauthenticated with the message the credential is not valid (Sessions, cookies, and sign-in links)

The gate reads the instance admin role and the age of the sign-in with the session on each call. So a revoke of the role closes the admin API to the sessions of the account at once.

The internal listener does not serve the admin API (the internal listener).

In maintenance mode, the admin API takes only SetMaintenance (the API server). Each other call, also each Get and List call of this page, writes an audit entry, so maintenance mode refuses it with unavailable before it changes anything. The reads keep the option (hopbox.v1.read_only) all the same, because a retry of them does no harm (API definitions).

Every call of the admin API writes an audit entry in the transaction of the call, also a call that only reads. The calls of MonitorService are the one exception: they write no entry (decided by the owner on 2026-10-31). The entry has the action of the call, the actor kind of the caller, and the request ID. An entry of local_root also has the details peer_uid and peer_pid: the user and the process that called through the socket. A refused call writes no entry.

The admin socket is a unix socket that only root can use. With it, whoever controls a control server can always act, even without web access. The code is in internal/adminsock.

Item Value
Path <run_dir>/admin.sock, by default /run/hopbox/admin.sock (the bootstrap config of hopboxd)
Owner the user of hopboxd, root on a server
Mode 0600
Protocols Connect, gRPC, and gRPC-Web, over HTTP/1.1 or HTTP/2 with prior knowledge
Services every service of the admin API, gRPC reflection, and gRPC health
Caller local_root

The socket checks each connection in two ways:

  1. File mode. The socket file has mode 0600, so only its owner can connect. hopboxd makes the socket under a temp name, admin.sock.<6 random characters>.tmp, sets the mode, and then renames it to admin.sock. So the final name never has a looser mode.
  2. Peer check. For each new connection, hopboxd asks the kernel for the user and the process of the peer: SO_PEERCRED on Linux, LOCAL_PEERCRED and LOCAL_PEERPID on macOS. It accepts only root (uid 0) and the user that runs hopboxd. It closes any other connection at once and logs admin socket refused a peer. On a server, hopboxd runs as root, so only root is accepted. On a laptop, hopboxd runs as you, so you can call it without sudo.

The second check holds also after a change of the mode of the file. The request gate of the socket turns the peer into the caller local_root, with its user ID and its process ID. Then the policy check and the audit log see that caller (the API server).

When it starts, hopboxd does these checks on the socket:

Check Error
The socket dir must not be a symlink. adminsock: the socket dir <dir> is a symlink
The socket dir must be a dir. adminsock: the socket dir <dir> is not a dir
Group and others must not be able to write in the socket dir. Such a user can swap the socket for one of their own. adminsock: the socket dir <dir> has mode <mode>, which lets group or others change it
The socket dir must belong to the user of hopboxd. adminsock: the socket dir <dir> must belong to the user of hopboxd
A file at the path must be a socket. adminsock: <path> exists and is not a socket, so hopboxd will not replace it
Another process must not serve a socket at the path. A socket that no process serves, for example after a crash, is removed. adminsock: another process serves <path>. Stop it first
The path plus its 11-byte temp suffix must fit in the 103 bytes of a unix socket path. adminsock: the socket path <path> has <n> bytes, and with its temp suffix it must fit in 92

A missing socket dir is created with mode 0755. When hopboxd stops, it removes the socket file, if the file is still its own socket.

The socket writes these records with component=adminsock:

Message Level Fields
admin socket refused a peer warn uid, pid
admin socket failed to read the peer warn err

Each call through the socket also gets the access log record api call with caller=local_root (the API server). The HTTP server of the socket writes its own errors at level warn with component=http, as the API listener does. These records have no component=adminsock.

hopboxd admin is the client of the socket. Other gRPC or Connect clients work too. For example, with curl and the Connect protocol:

sudo curl -s --unix-socket /run/hopbox/admin.sock \
-H 'Content-Type: application/json' -d '{}' \
http://hopboxd/hopbox.admin.v1.InstallConfigService/GetInstallConfig

hopbox.admin.v1.InstallConfigService reads and changes the config of the whole install. The config lives in the table install_config (Control store tables).

The message InstallConfig holds the general config:

Field Type Description
domain string The domain of the install, for example example.com. It is empty until an instance admin sets it.
version int64 The version of the install config. It starts at 1 and grows by 1 with each change.
update_time google.protobuf.Timestamp The time of the last change.
public_addresses repeated string The IPv4 and IPv6 addresses at which the edge servers take traffic, in their order. The DNS role points the domain, ns1, ns2, and every machine name at them (the DNS role). It is empty until an instance admin sets it.
acme_directory_url string The ACME directory of the CA that issues the wildcard certificate of the install (the certificate of the install). The default is https://acme-v02.api.letsencrypt.org/directory, the production CA of Let’s Encrypt.
acme_email string The contact email of the ACME account of the install. For an account without a contact, it is empty.
acme_terms_agreed bool true once an instance admin agreed to the terms of the CA of acme_directory_url. The install asks for no certificate before that. The default is false.
mail_transport MailTransport How the install delivers its mail (Mail). The default is MAIL_TRANSPORT_SMTP.
maintenance bool true while the install is in maintenance mode (the API server). Only SetMaintenance changes it. The default is false.
sign_up_mode SignUpMode How a new person gets an account (Sessions, cookies, and sign-in links). The default is SIGN_UP_MODE_APPROVAL, for a new install and for an install that migration 0062 upgrades.
grafana_url string The URL of the Grafana of the monitoring bundle. The console links to its dashboards only when it is set (Console). It is empty until an instance admin sets it.
abuse_thresholds AbuseThresholds The thresholds of the detection of abuse inside hopboxd (Abuse detection).

The message AbuseThresholds has these fields. Each duration is a google.protobuf.Duration of whole minutes. Each default is the number of the alert of the monitoring bundle with the same signal.

Field Type Bounds Default Description
cpu_percent int32 1 to 100 90 The share of its vCPUs, averaged over 30 minutes, that a machine uses for cpu_for
cpu_for Duration 10 min to 6 h 2 h How long the machine uses that share
egress_bytes_per_second int64 1 to 100,000,000,000 50,000,000 The rate over 5 minutes at which a machine sends for egress_for
egress_for Duration 5 min to 6 h 30 min How long the machine sends at that rate
scan_connections_per_second int32 1 to 1,000,000 100 The rate over 5 minutes at which a machine opens new outbound connections for scan_for
scan_for Duration 5 min to 6 h 10 min How long the machine opens connections at that rate
org_burst int32 1 to 10,000 5 The orgs that one account makes in 1 hour
api_key_burst int32 1 to 10,000 5 The API keys that one account makes in 1 hour
long_api_key_burst int32 1 to 10,000 2 The API keys with the preset lifetime of 365 days that one account makes in 1 hour
machine_burst int32 1 to 10,000 10 The machines that one account makes in 1 hour
url_churn int32 1 to 10,000 20 The changes of the port or the visibility of machine URLs that one account makes in 1 hour
new_account_age Duration 1 h to 90 days 7 days The age below which an account that makes a machine URL public is new

The enum SignUpMode has these values:

Value Number Meaning
SIGN_UP_MODE_UNSPECIFIED 0 Never in a response. A request must not use it.
SIGN_UP_MODE_OPEN 1 The first sign-in of a new person makes an active account of the tier limited (the org API).
SIGN_UP_MODE_APPROVAL 2 The first sign-in of a new person makes a pending account, which an instance admin approves or rejects (ApproveAccount, RejectAccount).
SIGN_UP_MODE_INVITE_ONLY 3 The first sign-in of a new person fails, unless an open invitation names the verified email of the sign-in (Sessions, cookies, and sign-in links).

In every mode, an open instance invitation (InvitationService) gives a new person an active account of the tier full, and an open org invitation gives an active account of the tier limited.

The enum MailTransport has these values:

Value Number Meaning
MAIL_TRANSPORT_UNSPECIFIED 0 Never in a response. A request must not use it.
MAIL_TRANSPORT_SMTP 1 Sends each mail through the SMTP server of the install (SMTP config).
MAIL_TRANSPORT_FILE 2 Writes each mail to a file on the control server that sends it, and sends nothing. It is for a dev or test install. MailService reads the files (MailService).

Returns the general config of the install.

Item Value
Procedure /hopbox.admin.v1.InstallConfigService/GetInstallConfig
Policy action install_config.get: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action install_config.get, no target

The request GetInstallConfigRequest has no fields. The response GetInstallConfigResponse has the field config, an InstallConfig.

Changes the fields that the request sets, and keeps the others. It returns the config after the change.

Item Value
Procedure /hopbox.admin.v1.InstallConfigService/UpdateInstallConfig
Policy action install_config.update: local_root, admin_key, and an admin session
Idempotent option no. A second call with the same request sets the same values again.
Audit entry action install_config.update, no target, details domain (the new domain), old_domain, public_addresses (the new addresses, joined by commas), and old_public_addresses. Also acme_directory_url, acme_email, acme_terms_agreed (true or false), and mail_transport (smtp or file). Also sign_up_mode (open, approval, or invite_only), and grafana_url. Each of these has its old_ detail. Each threshold of the detection of abuse that the call changes adds its name and its old_ detail, such as abuse_cpu_percent and old_abuse_cpu_percent, with a duration as Go writes it, such as 2h0m0s. A threshold that the call keeps adds no detail. Some changes tell the instance admins: the domain, an ACME setting, the mail transport, and the sign-up mode (Notices to instance admins).

The request UpdateInstallConfigRequest has these fields:

Field Type Description
domain optional string The new domain. It must follow the rules in Domain rules. Leave the field out to keep the domain.
public_addresses PublicAddresses The new public addresses. The list replaces every public address of the install. An empty list removes them. Leave the field out to keep them.
acme_directory_url optional string The new ACME directory: an https URL of a host, with at most 2048 characters, and without user info or a fragment. It holds no whitespace and no control character. A new directory also sets acme_terms_agreed to false, unless the request sets acme_terms_agreed too. Leave the field out to keep the directory.
acme_email optional string The new contact email of the ACME account. It must be one plain email address, such as ops@example.org, without whitespace or a control character. The install keeps it in lowercase. An empty string removes the contact. Leave the field out to keep the email.
acme_terms_agreed optional bool true records that the caller agrees to the terms of the CA of the directory. A new agreement covers the terms that the next attempt reads from the directory. false stops new certificates. Leave the field out to keep it.
mail_transport optional MailTransport The new mail transport. The SMTP config stays, so a switch back to MAIL_TRANSPORT_SMTP needs no new config. Leave the field out to keep the transport.
sign_up_mode optional SignUpMode The new sign-up mode. A change gives each other instance admin a notice and an email. Leave the field out to keep the mode.
grafana_url optional string The new URL of Grafana: an http or https URL of a host, with at most 2048 characters, and without user info, a query, or a fragment. It holds no whitespace and no control character. http is allowed for a tunnel, such as http://127.0.0.1:3000. An empty string removes the URL. Leave the field out to keep it.
abuse_thresholds AbuseThresholdsUpdate The thresholds of the detection of abuse to change. It has the fields of AbuseThresholds, each one optional. A field that the request leaves out keeps its value. A value out of its bounds, or a duration that is not whole minutes, fails with invalid_argument and the message invalid abuse threshold: <setting> is <value>, but must be from <low> to <high>. Leave the field out to keep every threshold.
expected_version optional int64 The version of the install config that the caller read. If the config has another version now, the call fails with aborted and changes nothing. Leave the field out to change the config at any version.

The message PublicAddresses has one field, addresses, a repeated string. Each address must follow the rules in Domain rules: at most 16 IPv4 or IPv6 addresses, none twice. The install keeps them in the text form of Go netip, in their order. So 2001:DB8::10 becomes 2001:db8::10, and an IPv4 address in IPv6 form, such as ::ffff:203.0.113.10, becomes 203.0.113.10.

With expected_version, two admins that change the config at the same time cannot overwrite each other: the second one gets aborted with the message conflict: the install config is at version <n>, not <m>. Read it again. The call locks the row until it commits, so the version check and the change happen as one step.

A request that sets no field gets invalid_argument with the message invalid argument: the update sets no setting. expected_version alone sets no field. A bad domain gets invalid_argument with the rule that it breaks, for example invalid argument: invalid name: the install domain "localhost" must have at least two labels, such as hop.example.org. A bad address gets invalid_argument with the rule that it breaks, for example invalid argument: invalid public address: "0.0.0.0" is not an address that a client on another host can reach. A bad ACME setting gets invalid_argument too, for example invalid argument: invalid ACME setting: "http://acme.example.org/directory" is not an https URL of a host without user info or a fragment, such as https://acme-v02.api.letsencrypt.org/directory. Whitespace or a control character gets, for example, invalid argument: invalid ACME setting: the directory URL holds the character ' '. It can hold no whitespace and no control character. MAIL_TRANSPORT_UNSPECIFIED or an unknown transport gets invalid_argument with the message invalid argument: the mail transport <n> is not smtp or file. SIGN_UP_MODE_UNSPECIFIED or an unknown mode gets invalid_argument with the message invalid argument: the sign-up mode <n> is not open, approval, or invite_only. A change to SIGN_UP_MODE_INVITE_ONLY while a live control process has a schema version below 66 (service.InviteOnlySchema) gets failed_precondition, and changes nothing. Such a release makes a pending account in that mode. The message is failed precondition: the control process <id> knows the migrations up to <n>, and only a hopboxd that knows migration 66 refuses a sign-up without an invitation. Upgrade it first. A bad Grafana URL gets invalid_argument, for example invalid argument: invalid Grafana URL: "ftp://example.org" is not an http or https URL of a host without user info, a query, or a fragment, such as http://127.0.0.1:3000.

While the transport is MAIL_TRANSPORT_FILE, each update logs mail goes to files, not to recipients at level warn (Mail).

A change of an input of the ACME job publishes the change event acme.config_changed in the transaction of the change (the certificate of the install). It also resets the failures of the ACME job, so the job tries again at once, unless the CA asked for the wait (the certificate of the install).

The response UpdateInstallConfigResponse has the field config, an InstallConfig.

GetInstallInfo returns the new domain to every caller at once (the API server).

Turns maintenance mode of the install on or off, and returns the config after the change (the API server). hopboxd admin maintenance on and off call it (hopboxd).

Item Value
Procedure /hopbox.admin.v1.InstallConfigService/SetMaintenance
Policy action install_config.set_maintenance: local_root only. An admin API key could not turn maintenance mode off again, because maintenance mode refuses every write.
Idempotent option no. A call for the state that the install has already changes nothing, and succeeds.
Audit entry action install_config.set_maintenance, no target, detail maintenance (true or false). A call that changes nothing writes no entry.

The request SetMaintenanceRequest has one field:

Field Type Description
maintenance bool true turns maintenance mode on, and false turns it off.

The response SetMaintenanceResponse has the field config, an InstallConfig.

A change sets the column maintenance of install_config, adds 1 to the version, and publishes the change event install.maintenance_changed in one transaction (Control store tables). Then the control process turns its own maintenance mode on or off. Maintenance mode lets this call through also while it is on, so the admin socket always takes it.

A call that turns maintenance mode on, also one for the state that the install has already, returns only after the calls, the control channels, and the leader jobs that ran in this process ended. If they do not end before the deadline of the call, it fails with unavailable and the message unavailable: <n> calls, control channels, or leader jobs still run: context deadline exceeded, and maintenance mode stays on. Call it again. If maintenance mode turns off before the wait ends, the call fails with unavailable and the message unavailable: maintenance mode turned off while it waited for the calls, control channels, and leader jobs to end, because the work runs again. So a success means that maintenance mode was on and the work had ended.

The turn to on also covers the other control processes of the install, which record themselves in control_processes (Control store tables). It runs these steps:

  1. Before it changes anything, it checks the live rows. If a live control process knows fewer than 44 migrations, the call fails with failed_precondition and the message the control process <id> on <host> (hopboxd <rel>) knows the migrations up to <n>, and only a hopboxd that knows migration 44 honors maintenance mode. Upgrade it first. Maintenance mode stays off. Only releases from migration 0045 on write rows, so this check guards the rows of a future release, not an older one.
  2. It drains its own process, as the paragraph above says.
  3. It waits until every other live control process reports maintenance mode on and drained, with a maintenance_version at least the version of install_config that the turn wrote. It reads the rows every 250 ms. Each process reports in its row the version at which it read maintenance mode, so the wait compares versions, not times. A process that applies the change renews its row at once, and once more at the end of its drain. A process that ended without its stop counts as gone only 35 s after its last renewal (store.ControlProcessGone: the live window of 20 s and the dead peer timeout of 15 s), because a COMMIT that it sent before its fence can still land until the store ends its session. A process that stopped cleanly counts as gone at once. So a turn to on beside a control server that died can wait up to 35 s, longer than the deadline of the call: then it fails with unavailable, and you call it again.

If a process does not report before the deadline of the call, the call fails with unavailable and the message maintenance mode is on, but the control process <id> on <host> (hopboxd <rel>) did not report that its calls, control channels, and leader jobs ended: .... The rest of the message is the cause, such as context deadline exceeded. The flag stays on then. Call it again. A control process of a release before migration 0045 writes no row, so the call does not see it, and neither does any check that reads the rows: the migration guard, the KEK promote, the decommission check, and the rolling upgrade order. Upgrade every control server before you rely on them.

The control process logs maintenance mode is on: the API takes only reads, and the control role serves no control channel at level warn after a change to on, and maintenance mode is off at level info after a change to off, with component=service.

A change of the domain or of the public addresses raises the serial of the DNS zones (Control store tables). The same transaction publishes the change event dns.zone_changed. The control role then pushes the new zones to each server with the DNS role (the DNS role). An update that sets the same domain and the same addresses again changes neither, and pushes nothing.

Sets the token with which Alertmanager calls the alert webhook of hopboxd, from the SHA-256 of the token (Metrics). The token never reaches the server. The new token replaces the old one at once, so the old one stops working. hopboxd admin config alert-token set makes the token, calls SetAlertToken, and writes the file that Alertmanager reads (hopboxd).

Item Value
Procedure /hopbox.admin.v1.InstallConfigService/SetAlertToken
Policy action alert_token.set: local_root only. The token works only with the file of Alertmanager, which root writes on the control server.
Idempotent option no. A second call with the same hash keeps that hash.
Audit entry action alert_token.set, no target, detail replaced (true when the install had a token before, else false)

The request SetAlertTokenRequest has the field sha256: the SHA-256 of the whole token text, hbxam_ included, in 64 lowercase hex characters (CLI tokens, API keys, admin API keys, and SSH keys). The response SetAlertTokenResponse has the field replaced, a bool, which is true when the install had a token before the call. The control store keeps the hash in the column alert_token_hash of install_config (Control store tables).

Error Code
The hash is not 64 lowercase hex characters: invalid argument: the hash must be the SHA-256 of the token in 64 lowercase hex characters invalid_argument
The caller is not root on a control server permission_denied

Removes the token of the alert webhook. The webhook then refuses each call with HTTP status 401 (Metrics). hopboxd admin config alert-token clear calls it (hopboxd).

Item Value
Procedure /hopbox.admin.v1.InstallConfigService/ClearAlertToken
Policy action alert_token.clear: local_root only
Idempotent option no. A second call removes nothing, and succeeds.
Audit entry action alert_token.clear, no target, detail cleared (true when the install had a token, else false)

The request ClearAlertTokenRequest has no fields. The response ClearAlertTokenResponse has the field cleared, a bool, which is false when the install had no token. Such a call changes nothing.

Returns the SMTP config of the install, without its password (SMTP config).

Item Value
Procedure /hopbox.admin.v1.InstallConfigService/GetSMTPConfig
Policy action smtp_config.get: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action smtp_config.get, no target

The request GetSMTPConfigRequest has no fields. The response GetSMTPConfigResponse has the field config, an SMTPConfig:

Field Type Description
host string The host name or the IP address of the SMTP server. An install without an SMTP config has an empty host.
port int32 The TCP port.
tls SMTPSecurity SMTP_SECURITY_STARTTLS, SMTP_SECURITY_TLS, or SMTP_SECURITY_NONE. SMTP_SECURITY_UNSPECIFIED for an install without an SMTP config.
username string The SMTP login, or empty.
password_set bool true for a config with a password. The API never returns the password.
from string The sender of the mail.
version int64 The version of the whole install config (GetInstallConfig).
update_time google.protobuf.Timestamp The time of the last change of the install config.
mail_transport MailTransport The mail transport of the install now. With MAIL_TRANSPORT_FILE, the install does not use this SMTP server (Mail).

Replaces the SMTP config, and returns it. The password is sealed with the current key-encryption key (SMTP config). GetInstallInfo then lists SIGN_IN_METHOD_EMAIL_LINK.

Item Value
Procedure /hopbox.admin.v1.InstallConfigService/SetSMTPConfig
Policy action smtp_config.set: local_root, admin_key, and an admin session
Idempotent option no. A second call with the same request sets the same values again.
Audit entry action smtp_config.set, no target. The details are host, port, tls, username, from, old_host, and password_changed (true or false). They never hold the password.

The request SetSMTPConfigRequest has these fields:

Field Type Default Description
host string none, required The host name or the IP address of the server, without a port.
port int32 the usual port of tls: 587, 465, or 25 The TCP port, 1 to 65535.
tls SMTPSecurity SMTP_SECURITY_STARTTLS How the connection is encrypted (SMTP config).
username string empty The SMTP login.
password optional string the password that is set now The SMTP password. Leave it out to keep the password that is set now. An empty password removes it. A new host or username needs the password again.
from string none, required The sender, such as hopbox <no-reply@example.org>.
expected_version optional int64 none The version of the install config that the caller read. If the install config has another version now, the call fails with aborted and changes nothing.

The response SetSMTPConfigResponse has the field config, an SMTPConfig. A field that breaks a rule gets invalid_argument with the rule (SMTP config). A new password without a key-encryption key gets failed_precondition.

Removes the SMTP config and its password, so the install sends no more sign-in links.

Item Value
Procedure /hopbox.admin.v1.InstallConfigService/ClearSMTPConfig
Policy action smtp_config.clear: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action smtp_config.clear, no target, details old_host

The request ClearSMTPConfigRequest has no fields. The response ClearSMTPConfigResponse has the field config, the empty SMTPConfig with the new version.

The message ObjectStorageConfig holds the bucket of the backups of the install, without its secret key (Object storage). Object storage is optional. Without it, a backup fails with failed_precondition, and every other feature works.

Field Type Description
endpoint string The https URL of the S3 server, such as https://s3.gra.io.cloud.ovh.net. It is empty when the install has no object storage.
region string The region of the signature, such as gra.
bucket string The name of the bucket, such as bucket1.
access_key_id string The S3 access key ID.
secret_key_set bool true for a config with a secret key. The API never returns the secret key.
ca_certificates string The PEM certificates that the install trusts beside the roots of the system, or empty.
version int64 The version of the whole install config (GetInstallConfig).
update_time google.protobuf.Timestamp The time of the last change of the install config.

Returns the object storage config of the install, without its secret key.

Item Value
Procedure /hopbox.admin.v1.InstallConfigService/GetObjectStorageConfig
Policy action object_storage_config.get: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action object_storage_config.get, no target

The request GetObjectStorageConfigRequest has no fields. The response GetObjectStorageConfigResponse has the field config, an ObjectStorageConfig.

Checks a bucket, then replaces the object storage config with it, and returns the config. The secret key is sealed with the current key-encryption key (Sealing). hopboxd admin config object-storage set calls it (hopboxd).

Item Value
Procedure /hopbox.admin.v1.InstallConfigService/SetObjectStorageConfig
Policy action object_storage_config.set: local_root, admin_key, and an admin session
Idempotent option no. A second call with the same request checks the bucket and sets the same values again.
Audit entry action object_storage_config.set, no target. The details are endpoint, region, bucket, access_key_id, old_endpoint, old_bucket, secret_key_changed (true or false), and ca_certificates_changed (true or false). They never hold the secret key. The call tells the instance admins (Notices to instance admins).

The request SetObjectStorageConfigRequest has these fields:

Field Type Default Description
endpoint string none, required The https URL of the S3 server, without a path (Object storage). A plain http URL fails.
region string none, required The region of the signature: 1 to 63 lowercase letters, digits, and dashes.
bucket string none, required The name of the bucket.
access_key_id string none, required The S3 access key ID.
secret_key optional string the secret key that is set now The S3 secret key. Leave it out to keep the secret key that is set now. That works only for the same endpoint, bucket, and access key ID.
ca_certificates optional string the certificates that are set now PEM certificates to trust beside the roots of the system, at most 64 KiB. An empty string removes them. Leave the field out to keep them.
expected_version optional int64 none The version of the install config that the caller read. If the install config has another version now, the call fails with aborted and changes nothing.

Before it changes anything, the control process that takes the call checks the new config (The check). A failed check changes nothing, and its message names the cause. The check runs outside the transaction. So if another call changes the object storage config during the check, the call fails with aborted and the message conflict: the object storage config changed during the check. Read it again.

The response SetObjectStorageConfigResponse has the field config, an ObjectStorageConfig. These errors can occur:

Code Message Cause
invalid_argument invalid argument: invalid object storage config: ... A field breaks a rule of Object storage, such as the endpoint "http://s3.example.org" is plain http. hopbox sends the credentials and the data only over https.
invalid_argument invalid argument: a new endpoint, bucket, or access key ID needs the secret key again The request has no secret key, and the install has no secret key for this endpoint, bucket, and access key ID.
failed_precondition failed precondition: the keyring has no key-encryption key to seal or open the value. Run hopboxd admin kek rotate to make the first one The keyring has no key-encryption key. The call reaches no bucket.
failed_precondition failed precondition: the check of the bucket failed: object storage: ... Nothing changed The check failed, and the config must change first, such as a wrong key, a missing bucket, a wrong region, a certificate that is not trusted, or a host that does not resolve.
unavailable unavailable: the check of the bucket failed: object storage: ... Nothing changed The check got no answer, or the server failed, such as on a cut link, at a closed port, or after a timeout. A later call can succeed.
aborted conflict: the install config is at version 5, not 4. Read it again expected_version is old.

Removes the object storage config and its secret key, so the install makes no more backups. The bucket and its objects stay at the provider.

Item Value
Procedure /hopbox.admin.v1.InstallConfigService/ClearObjectStorageConfig
Policy action object_storage_config.clear: local_root, admin_key, and an admin session
Idempotent option no. A second call removes nothing, and succeeds.
Audit entry action object_storage_config.clear, no target, details old_endpoint and old_bucket. The call tells the instance admins.

The request ClearObjectStorageConfigRequest has the field expected_version, as in SetObjectStorageConfigRequest. The response ClearObjectStorageConfigResponse has the field config, the empty ObjectStorageConfig with the new version.

Checks the saved config against its bucket. The control process that takes the call writes one object of 64 random bytes under the key hopbox-check/<random>, reads it back, compares it, and deletes it. So the check proves the endpoint, the certificate, the region, the bucket, both keys, and the rights to write, read, and delete. SetObjectStorageConfig runs the same check on the new config. The check takes at most 25 s: 20 s for the write and the read, and 5 s for the delete, with 3 attempts of each request (Object storage).

Item Value
Procedure /hopbox.admin.v1.InstallConfigService/CheckObjectStorage
Policy action object_storage_config.check: local_root, admin_key, and an admin session
Idempotent option no. Each call writes and deletes a new object.
Audit entry action object_storage_config.check, no target, details endpoint, bucket, and result: ok, or the kind of the error, such as secret_key or unreachable (Object storage)

The request CheckObjectStorageRequest has no fields. The response CheckObjectStorageResponse has the field config, the ObjectStorageConfig that the check used, and duration, a google.protobuf.Duration of the whole check. Maintenance mode lets the call through, because it changes no setting of the install.

Code Message Cause
failed_precondition failed precondition: this install has no object storage, so it makes no backups. An instance admin sets it with hopboxd admin config object-storage set, or on the page Config of the Admin area The install has no object storage.
failed_precondition failed precondition: the check of the bucket failed: object storage: ... The config must change first, as for SetObjectStorageConfig.
unavailable unavailable: the check of the bucket failed: object storage: ... No answer, or the server failed.

The message OAuthClient holds the client of one sign-in provider, without its secret (Sign-in with GitHub and Google). The enum SignInProvider names the provider:

Value Provider
SIGN_IN_PROVIDER_UNSPECIFIED Never in a response. A request with it fails with invalid_argument.
SIGN_IN_PROVIDER_GITHUB A GitHub OAuth app.
SIGN_IN_PROVIDER_GOOGLE A Google OAuth client for a web application, through OpenID Connect.
Field Type Description
provider SignInProvider The provider.
client_id string The client ID that the provider gave the operator. It is empty while the provider is off.
client_secret_set bool true for a client with a secret. The API never returns the secret.
redirect_uri string The URI to register at the provider, such as https://example.com/auth/github/callback (Sign-in with GitHub and Google). It is empty until the install has a domain.
enabled bool true for a provider that people can sign in with: the client is set, and the install has a domain.

Returns the client of each provider, without its secret, and the redirect URI to register at each provider.

Item Value
Procedure /hopbox.admin.v1.InstallConfigService/GetOAuthConfig
Policy action oauth_config.get: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action oauth_config.get, no target

The request GetOAuthConfigRequest has no fields. The response GetOAuthConfigResponse has these fields:

Field Type Description
clients repeated OAuthClient One client for each provider, GitHub first.
version int64 The version of the whole install config (GetInstallConfig).
update_time google.protobuf.Timestamp The time of the last change of the install config.

Sets the client of one provider, and returns it. The secret is sealed with the current key-encryption key (Sealing). With a domain, GetInstallInfo then lists SIGN_IN_METHOD_GITHUB or SIGN_IN_METHOD_GOOGLE.

Item Value
Procedure /hopbox.admin.v1.InstallConfigService/SetOAuthClient
Policy action oauth_config.set: local_root, admin_key, and an admin session
Idempotent option no. A second call with the same request sets the same values again.
Audit entry action oauth_config.set, no target. The details are provider (github or google), client_id, old_client_id, and secret_changed (true or false). They never hold the secret.

The request SetOAuthClientRequest has these fields:

Field Type Default Description
provider SignInProvider none, required The provider.
client_id string none, required The client ID: 1 to 256 printable ASCII characters, without spaces.
client_secret optional string the secret that is set now The client secret: 1 to 512 printable ASCII characters, without spaces. Leave it out to keep the secret that is set now. That works only for the same client_id. A new client ID needs its secret.
expected_version optional int64 none The version of the install config that the caller read. If the install config has another version now, the call fails with aborted and changes nothing.

The response SetOAuthClientResponse has the field client, an OAuthClient, and the new version and update_time of the install config. These errors can occur:

Code Message Cause
invalid_argument invalid argument: "SIGN_IN_PROVIDER_UNSPECIFIED" is not a sign-in provider. Use github or google The provider is unspecified or unknown.
invalid_argument invalid argument: the client ID is empty No client ID.
invalid_argument invalid argument: the client secret must hold only printable ASCII characters without spaces The client ID or the secret breaks the rule of its characters.
invalid_argument invalid argument: the client ID has more than 256 characters The client ID or the secret is too long.
invalid_argument invalid argument: a new client ID needs its client secret No secret, and the provider has no client with this client ID.
failed_precondition failed precondition: the keyring has no key-encryption key to seal or open the value. Run hopboxd admin kek rotate to make the first one The keyring has no key-encryption key.
aborted conflict: the install config is at version 5, not 4. Read it again expected_version is old.

Removes the client of one provider and its secret, so nobody can start a sign-in with it. The sign-in methods of the provider stay on their accounts, and work again after a new SetOAuthClient.

Item Value
Procedure /hopbox.admin.v1.InstallConfigService/ClearOAuthClient
Policy action oauth_config.clear: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action oauth_config.clear, no target, details provider and old_client_id

The request ClearOAuthClientRequest has the fields provider, a SignInProvider, and expected_version, as in SetOAuthClientRequest. The response ClearOAuthClientResponse has the field client, the empty OAuthClient with its redirect URI, and the new version and update_time.

hopbox.admin.v1.CertificateService reads the wildcard certificate of the install and the state of the ACME job that gets it (the certificate of the install).

Returns the certificate of the install, without its key, and the state of the ACME job.

Item Value
Procedure /hopbox.admin.v1.CertificateService/GetCertificate
Policy action certificate.get: local_root and admin_key
Idempotent option no
Audit entry action certificate.get, no target

The request GetCertificateRequest has no fields. The response GetCertificateResponse has the field certificate, a Certificate, and the field status, an ACMEStatus. Before the first certificate of the install, certificate is absent.

The message Certificate:

Field Type Description
domain string The domain of the install that the certificate covers.
names repeated string The DNS names of the certificate: the domain and its wildcard, such as example.com and *.example.com.
serial string The serial number, in lowercase hex.
issuer string The subject of the CA certificate that signed the certificate, such as CN=R12,O=Let's Encrypt,C=US.
not_before google.protobuf.Timestamp The start of the validity.
not_after google.protobuf.Timestamp The end of the validity.
renew_time google.protobuf.Timestamp The time at which the certificate is due for renewal: after two thirds of its lifetime (the certificate of the install).
directory_url string The ACME directory that issued the certificate.
update_time google.protobuf.Timestamp When the certificate replaced the one before it.

The message ACMEStatus:

Field Type Description
failures int32 The attempts that failed since the last certificate, or since the last change of an input of the ACME job.
last_attempt_time google.protobuf.Timestamp The start of the last attempt. Absent before the first attempt.
last_error string The error of the last attempt that failed. Empty after a certificate. A change of an input of the ACME job keeps it until the next attempt.
next_attempt_time google.protobuf.Timestamp After a failure, the earliest time of the next attempt. Absent after a certificate.
terms_url string The URL of the terms of service of the CA that the directory named at the last attempt (the certificate of the install). The first attempt after an agreement records it, so it is empty before that attempt.
renewals_stopped string Why the ACME job plans no renewal of the certificate: the install has no domain, no instance admin agreed to the terms of the CA, or, after a userActionRequired of the CA, the CA asked an instance admin to act: read its new terms and agree again. Empty while the job renews the certificate, and before the first certificate.
ca_wait bool If the CA asked for the wait until next_attempt_time, with a rate limit or a header Retry-After, it is true. A change of an input of the ACME job does not end such a wait, except a change of the directory. The wait lasts at most 7 days.

hopbox.admin.v1.KeyringService manages the key-encryption keys (KEKs) that seal secrets (Sealing).

Adds a new KEK to the file keyring in <data_dir>/kek and makes it the current one. The old KEKs stay, so the values that they sealed still open (Sealing). Use it only with one control server. With more than one, use StageKEK and PromoteKEK.

Item Value
Procedure /hopbox.admin.v1.KeyringService/RotateKEK
Policy action keyring.rotate: local_root only. The key files live on one control server, so only root on that server rotates them.
Idempotent option yes. A call must have an Idempotency-Key header (the API server).
Audit entries keyring.rotate.start before the key file exists, then keyring.rotate after it. Both have target kind kek, target ID the ID of the new KEK, and the detail idempotency: the SHA-256, in hex, of the caller scope and the idempotency key.

The request RotateKEKRequest has no fields. The response RotateKEKResponse has these fields:

Field Type Description
key_id string The ID of the new current KEK, for example file:2.

The call refuses while the install has a row of a control process on another host in control_processes, live or not (Control store tables). A control server that stopped cleanly, or that ended without its stop, keeps its row for 24 hours, so it counts too. The call fails with failed_precondition and the message the install has a control server on <host> too, and a rotation makes the new key current only on this server. Run hopboxd admin kek stage, copy the staged file to every control server, then run hopboxd admin kek promote. The new key gets the next ID of the install: one after the newest key of this keyring and of kek_fingerprints, so a key that another control server made, or a stage that an operator gave up, never shares its ID (Sealing). The check comes after the policy check and before the steps below. The call takes these steps. The audit entries of steps 4 and 6 commit in transactions of their own, apart from the transaction of the call. A key file is live as soon as it exists. Each entry commits also after the client gave up. A failed entry is tried 3 times, with waits of 0.1 s and 0.4 s, and each try waits at most 10 s.

  1. The policy check.
  2. It looks in the audit log for a rotation (keyring.rotate) of the last 24 hours with the same idempotency key. If it finds one, it returns the ID of that key and stops.
  3. It looks for a start (keyring.rotate.start) of the last 24 hours with the same idempotency key. The start names a key. If that key exists as <n>.key or <n>.staged, and no rotation entry names it, an earlier try made the key and stopped before step 6. The call then takes that key. If the key is still staged, the call records its fingerprint, as step 5 does, and promotes the file to <n>.key. Then it goes to step 6.
  4. It writes the start entry keyring.rotate.start. The entry has the ID of the next key and the hash of the idempotency key.
  5. It writes the new key as the staged file <n>.staged, and records its fingerprint. If the install has another key of that ID, the call fails with failed_precondition, removes the staged file, and the current KEK stays. Then it promotes the file to <n>.key. From this moment, the new KEK is current.
  6. It writes the rotation entry keyring.rotate.
  7. It logs rotated the key-encryption key at level info, with component=service, key_id, and caller.

So a retry with the same idempotency key never makes a second key, wherever the first try stopped:

The first try stopped A retry
before step 4, or at step 4 makes the key, as a first try does
after step 4, before the key file existed finds the start, sees no key file, and makes the key
in step 5, after the staged file existed and before its promote finds the start and the staged file, records its fingerprint, promotes it, and records that key. No staged file stays behind.
after step 5, before step 6 committed finds the start and the key file, and records that key
after step 6, for example after a failed commit of the idempotency key finds the rotation entry and returns its key

Steps 2 and 3 matter because a call that fails leaves no idempotency response, so a retry runs the call again (the API server). Without an idempotency key, for example from a test of the service layer, the call skips steps 2 to 4.

One hopboxd runs one rotation at a time, so two calls at the same time get two keys in turn. The keyring can refuse the rotation, for example because others can read the keyring dir. Then the call gets failed_precondition with the message of the keyring (Sealing). Any other failure of the key file, such as an I/O error, gets internal.

If the rotation entry still fails after its tries, the new KEK stays current without its rotation entry. Then hopboxd logs rotated the key-encryption key, but the audit entry failed at level error, with key_id and err, and the call fails with internal. Each failed try of an entry logs audit entry failed at level warn, with action, try, and err. A retry of the call with the same idempotency key records the key at step 3.

A rotation does not rewrap the sealed values. They keep their old KEK until RewrapSealedValues moves them. The rewrap also moves the key of the install CA (Control store tables).

Example:

$ sudo hopboxd admin kek rotate
file:2

Adds a new KEK to the file keyring in <data_dir>/kek as a staged key file <n>.staged. A staged KEK opens values but seals none, so the current KEK stays the same and the other control servers keep working. <n> is 1 more than the highest number of the key files and the staged files. The operator then copies the file to every other control server and calls PromoteKEK (Sealing).

Item Value
Procedure /hopbox.admin.v1.KeyringService/StageKEK
Policy action keyring.stage: local_root only. The key files live on one control server, so only root on that server stages a key.
Idempotent option no
Audit entry action keyring.stage, target kind kek, target ID the ID of the staged KEK. It commits in a transaction of its own, after the file exists.

The request StageKEKRequest has no fields. The response StageKEKResponse has these fields:

Field Type Description
key_id string The ID of the staged KEK, for example file:2.
file string The path of the staged key file on this server, for example /var/lib/hopbox/kek/2.staged. Copy it to the same path on every other control server.

The call logs staged a key-encryption key at level info, with component=service, key_id, and caller. The keyring can refuse the stage, for example because others can read the keyring dir. Then the call gets failed_precondition with the message of the keyring (Sealing). If the audit entry fails, the staged file stays, the call logs staged a key-encryption key, but the audit entry failed at level error with key_id and err, and the call fails with internal.

Example:

$ sudo hopboxd admin kek stage
file:2 /var/lib/hopbox/kek/2.staged

Makes a staged KEK the current one on every control server (Sealing). The call returns when every live control process seals with the key.

Item Value
Procedure /hopbox.admin.v1.KeyringService/PromoteKEK
Policy action keyring.promote: local_root only
Idempotent option no. A second call for a key that is current changes nothing on the key files.
Audit entry action keyring.promote, target kind kek, target ID the promoted key. It commits in the transaction that records the promote.

The request PromoteKEKRequest has the field key_id, the ID of the staged KEK, such as file:2. The response PromoteKEKResponse has these fields:

Field Type Description
key_id string The ID of the key that now seals new values.

The call takes these steps:

  1. The policy check.
  2. It refuses an ID that is no file key ID, with invalid_argument and the message "<id>" is not the ID of a file key, such as file:2.
  3. It refuses with failed_precondition when this server has neither a staged file nor a key file of the key: this control server has no key file of <id>. Stage it with hopboxd admin kek stage first.
  4. It refuses with failed_precondition when a key file with a higher number exists: the key file <k> is newer than <id>, so <id> would never seal. Stage a new key instead.
  5. It refuses with failed_precondition while another live control process does not list the key in kek_ids of its row: the control process <id> on <host> (hopboxd <release>) reports no key file of <key>. Copy the staged file to the key dir of that server with mode 0400, and promote again after its next renewal, within 5 s.
  6. In one transaction, it sets install_config.promoted_kek to the key (Control store tables), publishes the change event keyring.kek_promoted, and writes the audit entry.
  7. It promotes the file on this server: it links <n>.staged to <n>.key, removes the staged name, and syncs the dir. A second promote of the same key is a no-op. If the file is not in the dir, the call gets failed_precondition with seal: <dir>: the keyring has no staged key file of this key-encryption key file:<n>.
  8. It logs promoted a key-encryption key at level info, with component=service, key_id, and caller.
  9. It waits until every other live control process reports the key as kek_current. It reads the rows every 250 ms. If the deadline of the call ends first, it fails with unavailable and the message <key> is promoted, but the control process <id> still seals with <old key>: .... The flag stays recorded, so the control processes go on.

Each control process applies the promote by itself, from the flag promoted_kek: at its start, at each change event keyring.kek_promoted, and at each renewal of its row while its key dir has a staged file or while it misses the promoted key. It then promotes its own staged copy and logs made the promoted key-encryption key current at level info, with component=service and key_id. A process that has no file of the promoted key logs the error the install promoted a key-encryption key that this control server has no file of. Copy its key file from another control server, with component=control, key_id, and dir, once for each missing key (hopboxd). One hopboxd runs one stage, promote, or rotation at a time.

Example:

$ sudo hopboxd admin kek promote file:2
file:2

Lists the key-encryption keys of the keyring in <data_dir>/kek, and the keys that sealed values name. For each key, it gives the number of values that the key seals. A key that seals no value can go, after a backup (Sealing).

Item Value
Procedure /hopbox.admin.v1.KeyringService/ListKEKs
Policy action keyring.list: local_root only
Idempotent option no
Audit entry action keyring.list, no target

The request ListKEKsRequest has no fields. The response ListKEKsResponse has the field keys, a repeated KEK. The keys of the .key files come first, oldest first, then the staged keys. A key that a value names, but that the keyring does not have, comes last.

KEK field Type Description
id string The ID of the key, such as file:1.
current bool true for the key that seals new values. A staged key is never current.
staged bool true for a staged key, which opens values but seals none until a promote. A staged key has in_keyring set to true.
in_keyring bool false for a key whose key file is gone. A value that it seals does not open any more.
sealed_values int64 The number of sealed values whose data key this key seals.

A keyring dir that the checks refuse gets failed_precondition (Sealing). A missing keyring dir holds no key.

Moves every sealed value of the control store to the current key-encryption key (Sealing). It reseals only the data keys. The values stay as they are.

Item Value
Procedure /hopbox.admin.v1.KeyringService/RewrapSealedValues
Policy action keyring.rewrap: local_root only
Idempotent option no. A second call finds nothing to move.
Audit entry action keyring.rewrap, target kind kek, target ID the current key, details rewrapped: the number of values that moved

The request RewrapSealedValuesRequest has no fields. The response RewrapSealedValuesResponse has these fields:

Field Type Description
current_key_id string The ID of the key that now seals the values.
rewrapped int64 The number of values that moved to it.
keys repeated KEK Every key after the rewrap, as ListKEKs returns them.

Each value commits on its own. A value that changes during the rewrap, for example through SetSMTPConfig or SetOAuthClient, keeps its new seal. A value whose key is gone fails the call with internal, and the values before it stay moved. A failed rewrap still writes its audit entry, with the details rewrapped and failed set to true. If that entry fails too, the call logs the audit entry of a failed rewrap failed at level error, with component=service and err. A keyring without a key gets failed_precondition. The call logs rewrapped the sealed values at level info, with component=service, key_id, rewrapped, and caller.

$ sudo hopboxd admin kek rewrap
rewrapped 1 to file:2
file:1 0
file:2 1 current

hopbox.admin.v1.MailService reads the mail files that the file transport wrote on this control server (Mail). The files hold sign-in links and invitation links. So the policy allows only local_root, through the admin socket of the server that holds the files. An admin API key reaches whichever control server answers, so the policy refuses it. Each control server has its own folder, <data_dir>/mail.

The message MailFile describes one file:

Field Type Description
name string The name of the file, such as 20261023T094531.606059000Z-5cb912a8d0bb45d7.eml. The names sort by the time of the write.
create_time google.protobuf.Timestamp The time of the write, from the name.
to string The To header, such as <ann@example.org>.
subject string The Subject header, decoded.
size_bytes int64 The size of the file.

Lists the mail files of this control server, newest first. It prunes the folder first: it keeps the newest 1000 files, and removes any file older than 7 days (Mail).

Item Value
Procedure /hopbox.admin.v1.MailService/ListMailFiles
Policy action mail_file.list: local_root only
Idempotent option no
Audit entry action mail_file.list, no target

The request ListMailFilesRequest has no fields. The response ListMailFilesResponse has these fields:

Field Type Description
dir string The mail folder of the server, such as /var/lib/hopbox/mail.
files repeated MailFile The files, newest first. Before the first mail, the folder does not exist, and the list is empty.

A file that does not read stays out of the list, such as a symlink that leads out of the folder. The other files still show (Mail).

The files stay after a switch back to MAIL_TRANSPORT_SMTP, until a prune removes them.

Returns one mail file of this control server, with its content.

Item Value
Procedure /hopbox.admin.v1.MailService/GetMailFile
Policy action mail_file.get: local_root only
Idempotent option no
Audit entry action mail_file.get, target kind mail_file, target ID the name of the file

The request GetMailFileRequest has the field name, a string: the name of the file, as ListMailFiles returns it. The response GetMailFileResponse has these fields:

Field Type Description
file MailFile The file.
content bytes The whole file: an RFC 5322 message, with the headers and the body that the SMTP transport sends. The body is in quoted-printable, so a long link breaks over two lines.
text string The body, decoded from its transfer encoding, with plain newlines. A link in it is whole.

A name that no mail file can have, such as a path, gets invalid_argument. A name that is not in the folder gets not_found (Mail).

hopbox.admin.v1.LoginLinkService makes the one-time sign-in links of the first instance admin.

Makes a first-admin login link for an email. The link works once, for 15 minutes (Sessions, cookies, and sign-in links). It signs in to the account of earlier login links for the email, or to a new account, and makes that account an instance admin. The email stays unverified, so it never links the account to another sign-in method.

Item Value
Procedure /hopbox.admin.v1.LoginLinkService/CreateLoginLink
Policy action login_link.create: local_root only
Idempotent option no. Each call makes a new link.
Audit entry action login_link.create, target kind login_link, target ID the UUID of the link, details email. The entry never holds the token.

The request CreateLoginLinkRequest has the field email, a string. The response CreateLoginLinkResponse has these fields:

Field Type Description
url string The link, such as https://example.com/auth/login-link#token=<token>. It is a secret until its use or its end.
email string The email, in lower case.
expire_time google.protobuf.Timestamp The end of the link.
Error Code
The email breaks a rule (Domain rules) invalid_argument
The install has no domain: failed precondition: the install has no domain, and the link needs one. Set it with hopboxd admin config set --domain failed_precondition

hopbox.admin.v1.InstanceAdminService manages the instance admins: the accounts that operate the install. An install keeps at least one instance admin, after the first one signs in. Each grant and revoke locks the table, so two revokes at the same time cannot remove the last two admins.

Lists the instance admins, in the order of their grant.

Item Value
Procedure /hopbox.admin.v1.InstanceAdminService/ListInstanceAdmins
Policy action instance_admin.list: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action instance_admin.list, no target

The request ListInstanceAdminsRequest has no fields. The response ListInstanceAdminsResponse has the field admins, a repeated InstanceAdmin:

Field Type Description
account_id string The UUID of the account.
display_name string The display name of the account.
emails repeated InstanceAdminEmail Each email of the account, with email and verified.
grant_time google.protobuf.Timestamp The time of the grant.

Makes an account an instance admin. A grant to an instance admin changes nothing and succeeds.

Item Value
Procedure /hopbox.admin.v1.InstanceAdminService/GrantInstanceAdmin
Policy action instance_admin.grant: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action instance_admin.grant, target kind account, details already (true for an account that was an instance admin already)

The request GrantInstanceAdminRequest names the account with one of these fields:

Field Type Description
account_id string The UUID of the account.
email string A verified email of the account. An unverified email, such as the email of a login link, names no account, because many accounts can hold it.

The response GrantInstanceAdminResponse has the field account_id. A request without a field, or with an ID that is not a UUID, gets invalid_argument. An unknown account gets not_found. A pending account gets failed_precondition with the message failed precondition: the account waits for approval. Approve it first (ApproveAccount).

Takes the instance admin role from an account. Its sessions lose the role at their next call. The revoke tells the instance admins and the revoked account (Notices to instance admins).

Item Value
Procedure /hopbox.admin.v1.InstanceAdminService/RevokeInstanceAdmin
Policy action instance_admin.revoke: local_root, admin_key, and an admin session
Idempotent option no
Audit entries action instance_admin.revoke, target kind account. Each open instance invitation that the account made gets instance_invitation.revoke, with the details email and reason (inviter no longer an instance admin) (InvitationService).

The request RevokeInstanceAdminRequest has the field account_id. The response RevokeInstanceAdminResponse has no fields.

Error Code
The ID is not a UUID invalid_argument
The account is not an instance admin not_found
The account is the last instance admin: failed precondition: the account <id> is the last instance admin, and an install keeps at least one. Grant the role to another account first failed_precondition
No other instance admin is active, for example because each other one is suspended (SuspendAccount): failed precondition: no other instance admin is active, and an install keeps at least one active instance admin, which can sign in. Unsuspend another instance admin first failed_precondition

Some calls leave something that lasts after the session that made them. For example, a stolen admin session of 10 minutes can make an admin key that works for 365 days. So these calls tell the instance admins, in the console and by email (plan question Q103):

Call When it tells the instance admins
CreateAdminKey Always.
RegisterAdminKey When it makes a key, with registered set to true.
GrantInstanceAdmin When the account was not an instance admin.
The sign-in of a login link (the sign-in, account, and audit API) When it makes the account an instance admin.
A new sign-in method of an account: a link from a session (Sessions, cookies, and sign-in links), or a sign-in that joins the account through a verified email When the account is an instance admin (plan question Q106). A stolen session can link the email or the GitHub user of an attacker, and so keep the role after the session ends. The audit entry account.link_sign_in_method then has the detail instance_admin set to true. The method of a login link never joins an existing account, because it proves no email.
RevokeInstanceAdmin Always. Otherwise a stolen session can revoke the other admins first, so that nobody hears of its later actions. The notice comes before the revoke, so the revoked account gets the email and a notice too. Its notice shows only if it gets the role again.
The admin DeleteAccount (DeleteAccount) When the account is an instance admin, as for the self-delete in the next row. The audit entry admin_account.delete then has the detail instance_admin set to true. The actor is root or an admin API key, so no account gets the copy of the actor. Each email of the deleted account gets the notice as an instance admin.
SuspendAccount and UnsuspendAccount (SuspendAccount) When the account is an instance admin, and the call changes its state. Otherwise a stolen session can suspend the other admins first, so that nobody hears of its later actions, as with a revoke. The audit entry then has the detail instance_admin set to true. A call with already set to true tells nobody.
DeleteAccount (the sign-in, account, and audit API) When the account is an instance admin (Q106). Otherwise a stolen session can remove an admin in silence, as with a revoke. The notice comes before the delete, so each email of the deleted account gets the copy of the actor. The audit entry account.delete then has the detail instance_admin set to true.
SetSMTPConfig and ClearSMTPConfig Always.
SetOAuthClient and ClearOAuthClient Always.
SetObjectStorageConfig and ClearObjectStorageConfig Always. A stolen session can point the backups at a bucket of an attacker.
UpdateInstallConfig When it changes domain, acme_directory_url, acme_email, acme_terms_agreed, mail_transport, or sign_up_mode. The transport decides whether the install uses the SMTP server. The domain decides where the console and every link of the install go, and the ACME settings decide which CA issues the certificate of the install (Q106). A stolen session can set the sign-up mode open, which lets each new person act at once (Q109). The advice of a change of the mode is sudo hopboxd admin config set --sign-up-mode='<old mode>'. A change of public_addresses alone tells nobody. hopboxd admin config set and hopboxd install --domain call UpdateInstallConfig, so their changes tell the instance admins too.

A notice is the audit entry of the call. In the transaction of the call, each instance admin other than the actor gets an open notice in the table admin_notices (Control store tables). The banner of the console and the Admin area show the open notices (Console), and ListAdminNotices returns them. hopboxd admin has no command for them, because root has no account and so no notices.

After the commit, hopbox sends an email to each email of each of these instance admins. When the actor is a session, its account gets a copy too. For a link from a session, the copy also goes to the email of the new method, unless another account holds that email as verified. A method that joins at a sign-in through a verified email is different, because whoever proved the email acted, and that person is maybe not the owner of the account. So the account gets an open notice in the console like each other instance admin, and its email says that a new sign-in method joined the account. The person whose session someone stole is the person who knows best that the action was not theirs. The sign-in of a login link had no session before the grant, so its account gets no copy. An email that no sign-in method verified gets the notice too, because only root adds such an email to an account, in a login link.

The email has these parts:

  • What changed, with the facts of the audit entry, such as the name, the ID, and the end of a new key.
  • Who did it: the session and its account, the CLI token and its account, the admin API key, or root on a control server with its user and process.
  • The time and the ID of the audit entry.
  • How to undo it: the page of the Admin area and the hopboxd admin command. For an action of a session, also how to revoke the role of its account, which closes the admin API to each session of the account at once. For a new sign-in method, the command hopboxd admin account sign-in-method remove with the IDs of the account and of the method. A method that joined at a sign-in through a verified email had no session before, so its advice says to revoke the role first, because the holder of that email can sign in again. Each value in a command of the advice is in POSIX single quotes, and each ' in it is written as '\''. So a POSIX shell, such as sh, bash, or zsh, reads each value as one word, also a value with shell code in it, such as an ACME directory URL with $(...) in its query. In another shell, such as tcsh, these quotes are not safe, so run the command in sh, bash, or zsh. A delete is final, so its advice says to read the audit log for the other actions of the deleted account. The advice of an admin delete by an admin API key gives the command that revokes the key. The advice of a suspend gives the page Accounts of the Admin area and hopboxd admin account unsuspend. The advice of an unsuspend gives the same page and hopboxd admin account suspend.
  • The link to /admin/notices, or for the copy of the actor, a line that says why the actor gets it. A change of the domain names both domains in place of the link.

The email and the notice never hold a secret: no admin key, no client secret, no SMTP password, and no secret key of the object storage. They hold only the facts of the audit entry, which never holds a secret value either.

A change of the mail config sends its email the way that the install sent mail before the change, and the new way only when that fails. The changes of the mail config are SetSMTPConfig, ClearSMTPConfig, and a change of mail_transport. So a new SMTP server that an attacker sets does not swallow the notice of its own change. A change of domain also sends its email the old way first. Each email of the change names the old domain in its first line and its subject, also when it goes the new way after the old way failed. The email of a first domain names the new domain there, because the install had no domain before. It has no link to /admin/notices, because the console at the old domain no longer answers, and a link to the new domain can lead to a domain that an attacker set. In place of the link, it says that the console moved from the old domain to the new one. It tells the reader to check the change first, and then to type the new domain in the browser. Some mail clients make the name of the new domain clickable, so the email asks for the check before the reader opens it. A domain set on an install without one gets the same line with none as the old domain, so no email links to a domain that the actor just set. It has no old value to set back. So its advice gives sudo hopboxd admin config set --domain=DOMAIN, with the domain of the install in place of DOMAIN.

A failed email never fails the call. The emails of one notice share one limit of 20 s. The read of the mail config before the emails, and the record of the failed emails after them, each have a limit of 10 s, so a control store that stops answering does not hold the emails longer. For each address that fails, hopbox logs the email of an admin notice failed at level error, with audit_entry, account, and err. It also writes the audit entry admin_notice.mail_failed, with the actor kind system, the target kind audit_entry and the ID of the entry of the call, and the details account, email, and error. The error is the reply of the mail server. If that text looks like a credential, the audit log refuses it, so error holds a fixed text instead, and only the log has the reply. An address can also look like a credential, for example hbx_ops@example.org stored before the audit log refused such values. Then the entry goes without email, and account still names the recipient. The detail email_sha256 holds the first 16 hex digits of the SHA-256 of the address, so you can tell apart the addresses of one account. So one such value never costs the entries of the other addresses. The notice stays in the Admin area. An install without an SMTP config fails each email this way. With the file transport, the email goes to the mail folder (Mail). After the sends, hopbox logs sent the emails of an admin notice at level info, with audit_entry, action, sent, and failed. If it cannot write the audit entries of the failures, it logs the audit entries of the failed emails of an admin notice failed at level error.

A notice has a kind. The notices above have the kind security. A new pending account gives a notice of the second kind, sign_up (Sessions, cookies, and sign-in links). A sign-up is no security action of an admin, so the console lists the two kinds under their own headings.

In the transaction of the first sign-in, each instance admin gets an open notice of the kind sign_up. The notice is the audit entry account.create of the new account. Its details also hold state, client_ip, and login for GitHub (the sign-in, account, and audit API). The sign-in takes LockKeySignIn, then LockKeyAdminNotices (the bundled Postgres). A notice of the kind sign_up sends no email of its own. The digest below covers the emails.

The summary of such a notice has this form:

The account User 1 (<account id>) waits for approval. Signed up with GitHub user user1, from 192.0.2.1.

A new account without a display name shows only its ID. The advice names the page Accounts of the Admin area, and the commands sudo hopboxd admin account approve --account-id='<id>' and sudo hopboxd admin account reject --account-id='<id>'. It also says that the account expires after 30 days without a decision.

When the cap of 50 pending accounts refuses a first sign-in, each instance admin gets a notice of the kind sign_up too, at most one every hour (Sessions, cookies, and sign-in links). Its audit entry has the action admin_notice.sign_ups_full, the actor system, no target, and the detail max_pending_accounts. The refused sign-in rolls back, so the notice goes in a transaction of its own after it, under LockKeyAdminNotices. If it fails, the log record is the notice of the full cap of pending accounts failed at level error, with component=service and err. The summary is:

The install holds 50 pending accounts, the most that it takes, so it refused a new sign-up. It refuses each new sign-up until the count falls. This notice comes at most once an hour.

An approve, a reject, the expiry, and any delete of the account remove the notices of the kind sign_up about it, from every instance admin. The column about_account_id of admin_notices names the account (Control store tables).

An alert of the monitoring bundle gives a notice of the third kind, alert (Q144). Alertmanager sends each alert to the alert webhook of hopboxd (Metrics). The console lists these notices under their own heading.

An alert has the fingerprint of Alertmanager, 16 hex characters that name its set of labels. hopbox keeps one notice for each fingerprint:

Event What hopbox does
A new alert fires In one transaction under LockKeyAdminNotices, hopbox writes the audit entry alert.fire, a row of alerts, and an open notice for each instance admin. After the commit, it answers Alertmanager, then sends the email of the call in the background.
Alertmanager sends the alert again, with the same start time hopbox updates the labels and the annotations of the row. The notice keeps its ID, and a dismissed notice stays dismissed. No email goes out.
Alertmanager reports the alert as resolved hopbox sets the end of the row, from endsAt of Alertmanager, deletes the open notices of the alert, and writes the audit entry alert.resolve. No email goes out. The row stays for 30 days, and ListAdminNotices returns it in resolved_alerts, so the page Notices still shows the alert with its start and its end. The entries alert.fire and alert.resolve stay in the audit log for good.
The alert fires with a new start time while its row is open Alertmanager sent its end, and hopbox missed it. hopbox closes the old alert as on a resolve, with the detail cause set to fired_again, then records the new alert.
A resolve names an alert that hopbox does not know, or that started later Nothing changes. A resolve that arrives before its fire, from a late call, leaves the notice of that fire open until the next resolve of the alert.

The alert Watchdog always fires for the outside check, so it never makes a notice (Monitor an install with Prometheus and Grafana).

The audit entry alert.fire has the actor system, the target kind alert, and the fingerprint as target ID. Its details are alertname, severity, fingerprint, starts_at, the annotations summary, description, and runbook_url that the alert has, and one detail label_<name> for each label that names a machine or a server: machine, name, org, server, and instance. The audit entry alert.resolve has the same actor and target, and the details alertname, notice (the ID of the entry alert.fire), cause (resolved or fired_again), starts_at, and closed_notices, the count of the notices that it closed. Each end of an alert also deletes the rows of alerts that ended more than 30 days before.

hopbox cuts each label and each annotation to 2,000 bytes. A label or an annotation that looks like a credential gets the text (withheld, because the text looks like a credential), so neither the audit log nor an email holds it.

Each call of Alertmanager carries one alert group. The new alerts of one call share one email to each email of each instance admin, so a group of 100 alerts makes one email, not 100 (Q148). The email names the first 20 new alerts of the call, and counts the rest. Each alert still gets its own notice. A call without a new alert sends no email.

The email goes out in the background after hopboxd answers Alertmanager, so the call and maintenance mode never wait for the mail server. A stop of the control role first refuses each new call with 503, and then waits for the calls that run and their emails before it closes the store, at most until the stop timeout of the unit. An email that the timeout cuts is lost. The email goes the way of the other notices, with a limit of 20 s for each address, and the log record and the audit entry admin_notice.mail_failed for each address that fails (Notices to instance admins). The target of that entry is the entry alert.fire of the first alert of the email.

The subject is Alert: <alertname> (<severity>) on <domain> for one alert. For more alerts of one name it is Alerts: <alertname> fires <n> times on <domain>, and for alerts of several names Alerts: <n> new alerts on <domain>. For more than one alert, the text starts with a count of the alerts of each name, such as HopboxEgressScan on 100 machines, where each alert has the label machine. Then it has a block for each named alert: the summary, the start time, the labels that name a machine or a server, the ID of the audit entry, the description, and the link to the entry of the alert in the guide. It ends with the count of the rest and the link to /admin/notices:

Subject: Alerts: HopboxEgressScan fires 2 times on example.com
This is an alert of the monitoring bundle to the instance admins of example.com.
2 new alerts fire: HopboxEgressScan on 2 machines.
The alert HopboxEgressScan fires, severity warning. Machine box1 opens 140 outbound connections per second.
Fires since: Sun, 01 Nov 2026 10:00:00 UTC
Label machine: <machine id>
Label name: box1
Label org: <org id>
Audit entry: <audit entry id>
Machine <machine id> of org <org id> opened 100 or more new outbound connections per second for 10 minutes. Read what the alert means and what to do: https://docs.hopbox.dev/guide/monitor-an-install/#hopboxegressscan The notice closes by itself when the alert ends.
The alert HopboxEgressScan fires, severity warning. Machine box2 opens 120 outbound connections per second.
Fires since: Sun, 01 Nov 2026 10:00:00 UTC
Label machine: <machine id>
Label name: box2
Label org: <org id>
Audit entry: <audit entry id>
Machine <machine id> of org <org id> opened 100 or more new outbound connections per second for 10 minutes. Read what the alert means and what to do: https://docs.hopbox.dev/guide/monitor-an-install/#hopboxegressscan The notice closes by itself when the alert ends.
hopbox sends at most one email for each call of Alertmanager, and none for a repeat of an alert or for its end.
The Admin area lists the open notices of your account: https://example.com/admin/notices
You get this email because you are an instance admin of example.com.

With more than 20 new alerts, the line And <n> more alerts. The page Notices lists each one. follows the 20th block.

A signal of the detection of abuse gives each instance admin a notice of the fourth kind, abuse (Abuse detection). Its audit entry is abuse.detect, with the actor system, and the account or the org of the signal as its target. The notice shows the facts of the signal at the last run in its alert, and closes by itself when the signal ends. The signals also show in resolved_alerts and in firing_alerts of GetOverview, next to the alerts.

The leader sends the instance admins an email digest of the new pending accounts (hopboxd). It checks every minute, and sends at most one digest every 15 minutes (service.SignUpDigestEvery). The clock of Postgres decides, through the column sign_up_digest_at of install_config, so a change of the leader keeps the interval. A digest names the pending accounts that no digest named yet, oldest first, at most 100. The rest wait for the next digest. Without such an account, the leader sends nothing.

The digest goes to each email of each active instance admin. Its subject is 1 new account waits for approval on <domain>, or <n> new accounts wait for approval on <domain>. For each account, it lists the emails, the account ID, the method, and the client address. It also lists the time of the sign-up. For a GitHub sign-up, it adds the GitHub login and the creation date of the GitHub user. It never holds the note of an account, because a note is text of an outside person. It links to the page Accounts of the Admin area, /admin/accounts, and says that a pending account expires after 30 days.

Subject: 1 new account waits for approval on example.com
This is a notice to the instance admins of example.com.
1 new account waits for approval:
- user1@example.org, account <account id>
Signed up with GitHub user user1 (GitHub user since 2026-10-29), from 192.0.2.1, at Fri, 30 Oct 2026 11:32:00 UTC.
Approve or reject each account on the page Accounts of the Admin area: https://example.com/admin/accounts
A pending account that nobody approves expires after 30 days.
You get this email because you are an instance admin of example.com. hopbox sends at most one such email every 15 minutes.

Each digest writes the audit entry admin_notice.sign_up_digest, with the actor system. Its details are accounts, the IDs of the accounts joined by commas, and recipients, the count of the addresses. A failed email writes admin_notice.mail_failed, as for a notice above, with the entry of the digest as its target. The digest marks its accounts as named before it sends, so a failed email sends no second digest of them. An install that sends no mail marks the accounts as named too, because its admins see the notices in the console. The log records are in hopboxd.

Field Type Description
id string The UUID of the audit entry of the action.
action string The action of the audit entry, such as admin_key.create.
summary string What changed, in one or more sentences, such as An admin API key was made: "key1", ID <id>, valid until <time>.
advice string How to undo the change if nobody that the reader trusts made it.
actor_kind string The actor kind of the audit entry: session, cli_token, admin_key, or local_root. A cli_token acts only in the delete of its account.
actor_account_id string The UUID of the account of a session or of a CLI token. Empty for the other actors.
actor_name string The display name of that account with its first email, such as User 1 <user1@example.org>, or its first email alone. Empty for the other actors, and once the account is deleted.
actor_credential_id string The UUID of the session, of the CLI token, or of the admin key. Empty for local_root.
target_kind string The target kind of the audit entry, or empty.
target_id string The target ID of the audit entry, or empty.
create_time google.protobuf.Timestamp The time of the action.
kind string security for an action that lasts after the session that did it, sign_up for a new pending account (Notices of new accounts), alert for an alert of the monitoring bundle (Notices of alerts). abuse for a signal of the detection of abuse inside hopboxd (Notices of abuse signals).
alert AdminAlert The alert of a notice of the kind alert, as Alertmanager sent it last, or the signal of a notice of the kind abuse, as the last run of the detection found it. Absent for the other kinds.

The summary of a notice of the kind alert has the form The alert <alertname> fires, severity <severity>. <summary>. Its advice is the description, the link to the entry of the alert in the guide, and the sentence The notice closes by itself when the alert ends.

Field Type Description
name string The label alertname, such as HopboxMachineCPUSustained.
severity string The label severity: critical, warning, or info.
summary string The annotation summary, or empty.
description string The annotation description, or empty.
runbook_url string The annotation runbook_url, the entry of the alert in Monitor an install with Prometheus and Grafana, or empty.
labels map of string to string The labels that name a machine or a server: machine, name, org, server, and instance. A label that the alert does not have is absent.
start_time google.protobuf.Timestamp The time at which the alert started to fire.
update_time google.protobuf.Timestamp The last time at which Alertmanager sent the alert.
fingerprint string The fingerprint of the alert in Alertmanager, 16 hex characters.
resolve_time google.protobuf.Timestamp The end of the alert: endsAt of Alertmanager, or the time of the call when that is missing. Absent while the alert fires.
resolve_cause string resolved when Alertmanager reported the end, or fired_again when the alert fired again with another start time after an end that hopbox missed. Empty while the alert fires.
kind string alert for an alert of Alertmanager, or abuse for a signal of the detection of abuse inside hopboxd.
id string The ID of the audit entry that started the alert or the signal: alert.fire or abuse.detect. It names one firing of an alert, or one signal, for good, so a client can key a list on it.

An AdminAlert of the kind abuse has the signal as name, such as cpu_sustained, the severity warning, and no fingerprint. Its summary and description are the summary and the advice of its notice (Abuse detection). Its runbook_url is https://docs.hopbox.dev/guide/admin-area/#abuse-signals. Its labels are account for a signal of an account, machine and name of the worst machine of a machine signal, and org. Its update_time is the last run that found the signal, and resolve_cause is resolved after its end.

Lists the open notices of the instance admin of the session, newest first, at most 100.

Item Value
Procedure /hopbox.admin.v1.InstanceAdminService/ListAdminNotices
Policy action admin_notice.list: an admin session only. A notice belongs to an account, so local_root and an admin API key get permission_denied.
Idempotent option no
Audit entry action admin_notice.list, no target

The request ListAdminNoticesRequest has no fields. The response ListAdminNoticesResponse has these fields:

Field Type Description
notices repeated AdminNotice The open notices, newest first, at most 100.
total int32 The count of all open notices of the account. It is more than the length of notices when the account has more than 100.
resolved_alerts repeated AdminAlert The alerts of the monitoring bundle and the abuse signals that ended in the last 30 days, newest end first, at most 50 together (Notices of alerts). The view alert_list of the control store joins both (Control store tables). Their notices closed by themselves. The list is the same for each instance admin, and a dismiss does not change it.

Removes notices from the list of the instance admin of the session. The audit log keeps the entries of the actions.

Item Value
Procedure /hopbox.admin.v1.InstanceAdminService/DismissAdminNotices
Policy action admin_notice.dismiss: an admin session only
Idempotent option no. A second call skips the notices that the first call removed.
Audit entry action admin_notice.dismiss, no target, details notices, the removed IDs joined by commas, and count

The request DismissAdminNoticesRequest has the field ids, 1 to 100 UUIDs of notices. An ID that names no open notice of the account is skipped, also an open notice of another instance admin. The response DismissAdminNoticesResponse has the field dismissed, the count of the removed notices.

Error Code
No ID, more than 100 IDs, or an ID that is not a UUID invalid_argument
A caller other than an admin session permission_denied, or unauthenticated for an anonymous caller

hopbox.admin.v1.AccountService lets an operator recover the sign-in of an account. A person can lose the only sign-in method of the account, for example the GitHub user. A new GitHub user with the same verified email then fails, because the account has an identity of a provider (Sign-in with GitHub and Google). The operator removes the old method. The account then has no identity of a provider, so a magic link or the new GitHub user links through the verified email.

The service also lists the accounts of the install (ListAccounts). It suspends an account and ends the suspension (SuspendAccount, UnsuspendAccount). It deletes an account, for example an account of the sign-up mode open that abused the install (DeleteAccount). It approves and rejects pending accounts (ApproveAccount, RejectAccount). It also keeps the block list of sign-ups (ListSignUpBlocks, BlockSignUp, UnblockSignUp). An admin session makes only ListAccounts, SuspendAccount, UnsuspendAccount, and the calls of pending accounts and of the block list (Admin sessions).

Lists the sign-in methods of one account, oldest first.

Item Value
Procedure /hopbox.admin.v1.AccountService/ListAccountSignInMethods
Policy action admin_account.list_sign_in_methods: local_root and admin_key
Idempotent option no
Audit entry action admin_account.list_sign_in_methods, target kind account, in the personal org of the account, so its owner reads the entry

The request ListAccountSignInMethodsRequest has the oneof account: account_id, the UUID of the account, or email, a verified email of the account. An unverified email names no account. The response ListAccountSignInMethodsResponse has account_id and methods, a list of AccountSignInMethod:

Field Type Description
id string The UUID of the method.
kind string email_link, login_link, github, or google.
subject string The identity that the method proves: the email of a link, the numeric user ID at GitHub, or the sub claim at Google.
email string The email that the method names.
last_use_time google.protobuf.Timestamp The time of the last sign-in with the method.
create_time google.protobuf.Timestamp The time of the link of the method to the account.
Error Code
Both or neither of account_id and email, an ID that is not a UUID, or an email that breaks the rules of Domain rules invalid_argument
No account has the ID, or the verified email not_found

Removes one sign-in method of an account. The emails of the account stay. While the account has no identity of GitHub or Google, a later sign-in that proves a verified email of the account links its method again (Sessions, cookies, and sign-in links). The removal does not end the sessions or the CLI sign-ins that the method started. The person ends them with SignOut and EndCLISignIn (the sign-in, account, and audit API).

Item Value
Procedure /hopbox.admin.v1.AccountService/RemoveAccountSignInMethod
Policy action admin_account.remove_sign_in_method: local_root and admin_key
Idempotent option no
Audit entry action admin_account.remove_sign_in_method, target kind sign_in_method, in the personal org of the account. The details are account, kind, email, and last_method (true or false). The owner of the account reads the entry in the audit log of the personal org.

The request RemoveAccountSignInMethodRequest has these fields:

Field Type Default Description
account_id string none, required The UUID of the account.
method_id string none, required The UUID of the method, as ListAccountSignInMethods returns it.
allow_last bool false Removes also the last method of the account. Then the account signs in only through a new method that proves one of its verified emails.

The response RemoveAccountSignInMethodResponse has no fields.

Error Code
An ID is not a UUID invalid_argument
No account has the ID, or the account has no such method not_found
The method is the last one, and allow_last is false: failed precondition: this is the last sign-in method of the account. Allow the removal of the last method to remove it. ... failed_precondition
The method is the last one, and the account has no verified email, such as the account of a login link. No new method can reach such an account: failed precondition: the account has no verified email, so no new sign-in method can reach it. Keep its last method failed_precondition

Deletes an account for an operator, for example an account of the sign-up mode open that abused the install. The delete also removes the notices of the kind sign_up about the account (Notices of new accounts). The call takes the steps of the self-delete DeleteAccount (the sign-in, account, and audit API), with the differences in the second table. It deletes the account, its personal org, its sessions, its emails, its sign-in methods, its CLI sign-ins, its member keys, and its SSH keys. It takes the account out of each other org, and deletes what the account made there and did not share (the org API).

Item Value
Procedure /hopbox.admin.v1.AccountService/DeleteAccount
Policy action admin_account.delete: local_root and admin_key
Idempotent option no. A second call gets not_found.
Audit entries action admin_account.delete, target kind account, in no org. The details are personal_org, reason, deleted_orgs, suspended, and instance_admin. suspended is true for a suspended account, and instance_admin is true for an instance admin. Each one is absent otherwise. deleted_orgs holds the IDs of the deleted orgs, joined by commas, with the personal org first. The entry comes before the entries of the delete itself. Each deleted org other than the personal org gets the action org.delete, with the details name and reason (account deleted). Each other org of the account gets org.member_remove, as for the self-delete. Each open instance invitation that the account made gets instance_invitation.revoke, with the reason inviter deleted.

The admin delete differs from the self-delete in these rules:

Rule Self-delete Admin delete
An org other than the personal org in which the account is the only owner The delete fails. The call deletes the org, its memberships, its invitations, and its resources, as DeleteOrg does. The account never comes back to hand the org over to another member.
A suspended org of the account The delete fails, so that the org keeps its evidence. The call goes on. Its audit entry keeps the evidence: the actor, the reason, and the IDs of the deleted orgs.
A machine that the delete removes The delete removes it. The call fails while such a machine is not deleted. Such a machine is in an org that the call deletes, or the account made it and did not share it. The error names each such machine, up to 20, with its hopboxd admin machine delete command (hopboxd). Run each command, then the call again. A machine with the target deleted does not hold the call back.
The reason none Required. The audit entry keeps it.
A suspended account A suspended account has no session and no CLI token, so it cannot call the self-delete. The call needs confirm_account_id, the account ID a second time. The data of a suspended account is the evidence of its suspension, and the delete ends that evidence.

The rules for the last instance admin and for the notice are the same as for the self-delete. The call fails for the last instance admin, and for the last instance admin that is not suspended. The delete of an instance admin tells the instance admins (Notices to instance admins).

The call checks the confirmation after each other check. So an operator confirms only a delete that then runs. Without confirm_account_id, the delete of a suspended account fails with failed_precondition and the detail hopbox.admin.v1.AccountIDConfirmationRequired. hopboxd admin account delete reads that detail, asks for the ID, and sends the call again (hopboxd). The detail is an empty message.

The request DeleteAccountRequest has these fields:

Field Type Default Description
account_id string none, required The UUID of the account.
reason string none, required Why the account goes. At most 256 characters, without control characters. The server drops the spaces around it.
confirm_account_id string empty The account ID a second time. The delete of a suspended account needs it. The server drops the spaces around it. A value for an account that is not suspended must match too.

The response DeleteAccountResponse has the field deleted_org_ids, the UUIDs of the deleted orgs, with the personal org first.

Error Code
The ID is not a UUID, or the reason is empty or breaks a rule. An empty reason gets invalid argument: give the reason of the delete, which the audit log keeps. invalid_argument
confirm_account_id is not empty, and is not the account ID: invalid argument: the account ID of the confirmation, "<value>", is not <id>. Give the same account ID twice invalid_argument
No account has the ID: not found: no account has the ID <id> not_found
The account is the last instance admin: failed precondition: the account is the last instance admin, and an install keeps at least one. Make another account an instance admin first failed_precondition
No other instance admin is active, for example because each other one is suspended: failed precondition: no other instance admin is active, and an install keeps at least one active instance admin, which can sign in. Unsuspend another instance admin first failed_precondition
The account is suspended, and confirm_account_id is empty: failed precondition: the account is suspended, and its data is the evidence of the suspension. The delete ends that evidence, so give the account ID a second time to confirm, with the detail hopbox.admin.v1.AccountIDConfirmationRequired failed_precondition
A machine is not deleted: failed precondition: 2 machines are not deleted, and the delete of an account deletes no machine. Delete each one first: hopboxd admin machine delete --id=<id> ("box1" in the org <org id>), hopboxd admin machine delete --id=<id> ("box2" in the org <org id>). The error names the 20 oldest such machines, with the command for each. If more machines hold the call back, the error ends with . <n> more machines are not deleted, so run the delete again after these. For one more machine, it says 1 more machine is not deleted. failed_precondition

The message Account is an account as an instance admin sees it:

Field Type Description
id string The UUID of the account.
display_name string The display name of the account, or empty.
emails repeated AccountEmail Each email of the account. email is the address, in lower case. verified is true for an email that a sign-in method proved.
state AccountState ACCOUNT_STATE_PENDING, ACCOUNT_STATE_ACTIVE, or ACCOUNT_STATE_SUSPENDED.
tier AccountTier ACCOUNT_TIER_LIMITED or ACCOUNT_TIER_FULL. A suspension keeps it. A pending account is limited until the approve. The tier sets the default limits of the personal org of the account, and whether the account creates orgs (the org API). SetAccountTier changes it.
instance_admin bool true for an instance admin.
personal_org_id string The UUID of the personal org of the account.
suspend_time google.protobuf.Timestamp The start of the suspension. Unset for an account that is not suspended.
suspend_reason string The reason of the suspension, or empty.
version int64 The row version. It grows by 1 with each change of the account.
create_time google.protobuf.Timestamp The creation time of the account.
sign_in_methods repeated string The kinds of the sign-in methods of the account, once each, in the order of their link: email_link, login_link, github, or google.
sign_up AccountSignUp The facts of the first sign-in of the account. Unset for an account from before migration 0062, and for an account of a first-admin login link.

The message AccountSignUp is what an instance admin sees of the first sign-in of an account (Sessions, cookies, and sign-in links). The table account_sign_ups keeps it (Control store tables).

Field Type Description
method string The kind of the first sign-in: email_link, github, or google.
client_ip string The IP address that asked for the magic link, or that started the flow of GitHub or Google. It is empty for a request without an address.
github_login string The GitHub login of a GitHub sign-up, or empty.
github_create_time google.protobuf.Timestamp The creation time of the GitHub user of a GitHub sign-up, from the field created_at of GET /user (Sign-in with GitHub and Google). A GitHub user made the same day is a hint of abuse. Unset for another sign-up.
note string The note of a pending account to the instance admins, at most 500 characters, or empty (the sign-in, account, and audit API). The note is text of an outside person, so a client shows it as plain text.
create_time google.protobuf.Timestamp The time of the sign-up.

The message SignUpBlock is one entry of the block list of sign-ups. An entry stops only new accounts: an account that exists still signs in. If an entry matches the email, the domain of the email, or the identity at GitHub or Google, a first sign-in fails (Sessions, cookies, and sign-in links).

Field Type Description
id string The UUID of the entry.
kind string What the entry matches: email, email_domain, github (the numeric user ID), or google (the sub claim).
value string The email or the domain, in lower case, or the ID at the provider.
reason string Why the entry exists, or empty.
create_time google.protobuf.Timestamp The time of the entry.

Lists the accounts of the install, oldest first, one page at a time.

Item Value
Procedure /hopbox.admin.v1.AccountService/ListAccounts
Policy action admin_account.list: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action admin_account.list, no org, no target. The detail state holds the state of the filter, such as suspended. A request without a filter has no detail.
Field Type Default Description
page_size int32 100 The most accounts in one response, 1 to 1000. 0 means 100.
page_token string empty The next_page_token of the response before. Leave it empty for the first page.
state AccountState ACCOUNT_STATE_UNSPECIFIED Lists only the accounts in this state. ACCOUNT_STATE_UNSPECIFIED lists every account.

The response ListAccountsResponse has the fields accounts, a repeated Account, and next_page_token. The token is empty on the last page. A page size out of range, a page token that does not decode, or an unknown state gets invalid_argument.

Suspends an account, for example to handle abuse. The call deletes nothing. In its transaction, it does these steps:

  1. It sets the state of the account to suspended, with the reason and the time.
  2. It deletes every session and every CLI sign-in of the account (Sessions, cookies, and sign-in links, CLI tokens, API keys, admin API keys, and SSH keys). So the private machine URLs of those sessions stop too (Control store tables).
  3. It suspends the personal org of the account, and each org in which the account is the only owner, with the same reason. An org that is suspended already keeps its suspension and its reason. Each org that the call suspends stops its machines, as for SuspendOrg. The column suspended_with_account of the org names the account (Control store tables).
  4. In each other org of the account, it sets the target stopped on each private machine of the account. A shared machine keeps running, because the org uses it. A hibernated machine stays hibernated, and a pending or failed wake goes back to hibernated (Domain rules). While the account is suspended, such a private machine does not wake: WakeMachine fails with failed_precondition (the machine API).

While the account is suspended, these rules hold:

What Result
A sign-in with a magic link, a login link, GitHub, or Google It fails with permission_denied and the message permission denied: an instance admin suspended this account, so it cannot sign in. The reason: <reason>. No session starts (Sessions, cookies, and sign-in links).
The poll of a device sign-in that a person approved before the suspend It fails with the same error, and uses up the device code (CLI tokens, API keys, admin API keys, and SSH keys).
The member API keys and the SSH keys of the account They stay in the store, but they do not work. They work again after the unsuspend (CLI tokens, API keys, admin API keys, and SSH keys, the SSH front door).
An open stream, such as WatchMachines, of a credential of the account It ends at its next check of the credential (the API server).
An open SSH connection with a key of the account It ends at the next check (the SSH front door).
Any call with a credential of the account that the request gate let in before the suspend No change lands after the commit of the suspend. In each org, the account has no role from that commit, so a call in an org, also a read, fails as for an account that is not a member (Control store tables). For a machine, that is not_found. A change of the account itself takes the key lock of the account first, and then fails with permission_denied and the message permission denied: an instance admin suspended this account. The reason: <reason>. These changes are CreateOrg, AcceptInvitation, AddSSHKey, RemoveSSHKey, UpdateAccount, the self DeleteAccount, RemoveSignInMethod, the link of a new sign-in method, CreateAPIKey, RevokeAPIKey, EndCLISignIn, and ApproveDevice. SignOut still works.

A second call on a suspended account changes nothing. It keeps the first reason, and returns the account.

Item Value
Procedure /hopbox.admin.v1.AccountService/SuspendAccount
Policy action admin_account.suspend: local_root, admin_key, and an admin session
Idempotent option no. A second call changes nothing.
Audit entries action admin_account.suspend, org the personal org of the account, so the account reads it later. Target kind account. The details are reason, already, suspended_orgs, sessions, cli_sign_ins, and instance_admin set to true for an instance admin. suspended_orgs holds the IDs of the orgs that the call suspended, joined by commas. sessions and cli_sign_ins are the counts of the deleted rows. For an account that was suspended already, already is true, reason is the first reason, and the entry has no other details. Each org that the call suspends gets org.suspend, with the details reason, already (false), and account. The detail account is the ID of the account. Each machine that the call stops gets machine.stop, with the details old_target and reason. The reason is org suspended in an org that the call suspends, and account suspended in another org.

The request SuspendAccountRequest has these fields:

Field Type Default Description
account_id string none, required The UUID of the account.
reason string none, required Why the account is suspended. At most 256 characters, without control characters. The server drops the spaces around it. The account sees the reason at its sign-in, and the members of its suspended orgs see it.

The response SuspendAccountResponse has the field account, the Account after the change.

The suspend of an instance admin tells the other instance admins (Notices to instance admins). An install keeps at least one instance admin that can sign in. So the call fails for the last instance admin, and for the last instance admin that is not suspended.

Error Code
The ID is not a UUID, or the reason breaks a rule. An empty reason gets invalid argument: give the reason of the suspension, which the account sees at its sign-in. invalid_argument
No account has the ID: not found: no account has the ID <id> not_found
A live control process runs a release of the schema version below 61: failed precondition: the control process <process> knows the migrations up to <n>, and only a hopboxd that knows migration 61 suspends accounts. Upgrade it first. Such a release lets a suspended account sign in. The check covers only the processes that run at the time of the call: such a release that starts later, for example after a rollback, lets the suspended account act again (Control store tables). failed_precondition
The account is pending: failed precondition: the account waits for approval. Approve or reject it instead failed_precondition
The account is the last instance admin: failed precondition: the account is the last instance admin, and an install keeps at least one. Make another account an instance admin first failed_precondition
No other instance admin is active, for example because each other one is suspended: failed precondition: no other instance admin is active, and an install keeps at least one active instance admin, which can sign in. Unsuspend another instance admin first failed_precondition

Ends the suspension of an account. The account signs in again, and its member API keys and SSH keys work again. The call also ends the suspension of each org that the suspend of the account suspended, and of no other org. An org that an instance admin suspended with SuspendOrg stays suspended. So does an org that was suspended before the suspend of the account. The machines stay stopped until their users start them. An account that is not suspended stays as it is, and the call succeeds.

Item Value
Procedure /hopbox.admin.v1.AccountService/UnsuspendAccount
Policy action admin_account.unsuspend: local_root, admin_key, and an admin session
Idempotent option no
Audit entries action admin_account.unsuspend, org the personal org of the account, target kind account. The details are old_reason, already (true for an account that was not suspended), and instance_admin set to true for an instance admin. A call that ends a suspension also has unsuspended_orgs, the IDs of the orgs that it unsuspended, joined by commas. Each such org gets org.unsuspend, with the details old_reason, already (false), and account.

The request UnsuspendAccountRequest has the field account_id. The response UnsuspendAccountResponse has the field account, the Account after the change. The unsuspend of an instance admin tells the other instance admins (Notices to instance admins).

Error Code
The ID is not a UUID invalid_argument
No account has the ID: not found: no account has the ID <id> not_found

Approves a pending account. The call sets the state active and the tier of the request. It removes the notices of the kind sign_up about the account (Notices of new accounts). The account then acts as any other account. hopboxd admin account approve calls it (hopboxd).

Item Value
Procedure /hopbox.admin.v1.AccountService/ApproveAccount
Policy action admin_account.approve: local_root, admin_key, and an admin session
Idempotent option no. A second call fails with failed_precondition, because the account is no longer pending.
Audit entry action admin_account.approve, org the personal org of the account, target kind account, detail tier (full or limited)

The request ApproveAccountRequest has these fields:

Field Type Default Description
account_id string none, required The UUID of the pending account.
tier AccountTier ACCOUNT_TIER_FULL The tier of the account after the approve. ACCOUNT_TIER_UNSPECIFIED gives ACCOUNT_TIER_FULL.

The response ApproveAccountResponse has the field account, the Account after the change.

If the install sends mail, hopbox sends an email to the first email of the account after the commit. A failed email never fails the call. Without mail, hopbox logs the install sends no mail, so the approval of an account sent none at level info. A failed email logs the approval email failed at level error. Both records have account and err.

Subject: Your account on example.com is ready
An instance admin of example.com approved your account. Sign in to use it:
https://example.com/
You get this email because you signed up on example.com.
Error Code
The ID is not a UUID, or the tier is unknown invalid_argument
No account has the ID: not found: no account has the ID <id> not_found
The account is not pending: failed precondition: the account is active, not pending failed_precondition
The tier is ACCOUNT_TIER_LIMITED, and a control process of an older release is live: failed precondition: the control process <id> knows the migrations up to <n>, and only a hopboxd that knows migration 63 applies the limits of the tier limited. Upgrade it first failed_precondition

Moves an active or a suspended account to the tier limited or full. The tier sets the default limits of the personal org of the account, and whether the account creates orgs (the org API). A move keeps what the account has: its machines, its orgs, and its public URLs. The limits refuse only what comes after it. A pending account takes its tier from ApproveAccount. hopboxd admin account set-tier calls it (hopboxd).

Item Value
Procedure /hopbox.admin.v1.AccountService/SetAccountTier
Policy action admin_account.set_tier: local_root, admin_key, and an admin session
Idempotent option no. A second call with the same tier changes nothing, and the row version stays.
Audit entry action admin_account.set_tier, org the personal org of the account, target kind account, details tier, old_tier, and already (true when the account had the tier already)

The request SetAccountTierRequest has these fields:

Field Type Default Description
account_id string none, required The UUID of the account.
tier AccountTier none, required ACCOUNT_TIER_LIMITED or ACCOUNT_TIER_FULL.
expected_version optional int64 none The version of the account that the caller read. If the account has another version now, the call fails with aborted and changes nothing.

The response SetAccountTierResponse has the field account, the Account after the change. The call locks the row of the account, then the row of its personal org. A create or a start of a machine in that org holds the lock of the org while it checks the limits, so it sees the tier before or after the move, never a mix.

Error Code
The ID is not a UUID, or the tier is unspecified or unknown invalid_argument
No account has the ID: not found: no account has the ID <id> not_found
The account is pending: failed precondition: the account waits for approval. Approve it with a tier instead failed_precondition
The tier is ACCOUNT_TIER_LIMITED, and a control process of an older release is live: failed precondition: the control process <id> knows the migrations up to <n>, and only a hopboxd that knows migration 63 applies the limits of the tier limited. Upgrade it first failed_precondition
expected_version differs from the version of the account aborted

Rejects a pending account. The call deletes the account and its personal org, and removes the notices of the kind sign_up about the account. It clears the note of the account, and keeps the rest of its sign-up row for the limit of its client (Control store tables). With block, it also puts the identities of the account on the block list of sign-ups, each entry once. Two emails that differ only in their +tag give one entry. An email that has no form in the block list, such as an email from before the rules of Domain rules, stays off it, and the log has an email of a rejected account stays off the block list. So the same identity cannot sign up again. hopboxd admin account reject calls it (hopboxd).

Item Value
Procedure /hopbox.admin.v1.AccountService/RejectAccount
Policy action admin_account.reject: local_root, admin_key, and an admin session
Idempotent option no. A second call gets not_found.
Audit entry action admin_account.reject, no org, target kind account. The details are personal_org and emails, the emails of the account joined by commas. A request with a reason adds reason. With block, blocks holds the IDs of the entries of the block list, joined by commas. The audit log keeps the entries of the account.

The request RejectAccountRequest has these fields:

Field Type Default Description
account_id string none, required The UUID of the pending account.
block bool false Puts each verified email of the account on the block list, with the kind email. It also puts a GitHub identity there, with the kind github and the numeric user ID. A Google identity goes there with the kind google and the sub claim.
reason string empty Why, at most 256 characters, without control characters. The server drops the spaces around it. The audit entry and each new entry of the block list keep it.

The response RejectAccountResponse has the field blocks, a repeated SignUpBlock: the entries that the block added or found. An entry that exists stays as it is, with its first reason. Without block, the list is empty.

The call takes LockKeyAdminNotices, then the row of the account, then its orgs, as the delete of an account does. The row of the account in account_sign_ups stays one more day, so the sign-up still counts toward the limit of its client (Sessions, cookies, and sign-in links).

Error Code
The ID is not a UUID, or the reason breaks a rule invalid_argument
No account has the ID: not found: no account has the ID <id> not_found
The account is not pending: failed precondition: the account is active, not pending failed_precondition
The pending account is a member of another org, or an instance admin: failed precondition: the pending account <id> holds more than its personal org. Delete it with hopboxd admin account delete instead (DeleteAccount) failed_precondition

Lists the block list of sign-ups, oldest first. hopboxd admin account blocks calls it (hopboxd).

Item Value
Procedure /hopbox.admin.v1.AccountService/ListSignUpBlocks
Policy action sign_up_block.list: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action sign_up_block.list, no target

The request ListSignUpBlocksRequest has no fields. The response ListSignUpBlocksResponse has the field blocks, a repeated SignUpBlock.

Adds an entry to the block list of sign-ups, for example a whole email domain. An entry of the kind email_domain also stops the subdomains of the domain. An entry of the kind email loses its +tag, so it stops each +tag of the address (Domain rules). An entry stops only new accounts. An account that exists still signs in. An entry that exists stays as it is, with its first reason, and the call returns it. hopboxd admin account block calls it (hopboxd).

Item Value
Procedure /hopbox.admin.v1.AccountService/BlockSignUp
Policy action sign_up_block.add: local_root, admin_key, and an admin session
Idempotent option no. A second call returns the same entry.
Audit entry action sign_up_block.add, no org, target kind sign_up_block and the ID of the entry, details kind, entry (the value), and reason

The request BlockSignUpRequest has these fields:

Field Type Default Description
kind string none, required email, email_domain, github, or google.
value string none, required An email, such as user1@example.org, follows the rules of Domain rules, and the server keeps it in lower case. A domain, such as example.net, loses a leading @, and the server keeps it in lower case. A GitHub user ID or a Google sub claim has 1 to 255 ASCII characters without spaces. The server drops the spaces around each value.
reason string empty Why, at most 256 characters, without control characters.

The response BlockSignUpResponse has the field block, the SignUpBlock.

Error Code
An unknown kind: invalid argument: invalid block list entry: the kind "<kind>" is not one of email, email_domain, github, google invalid_argument
A value that breaks its rule, such as invalid argument: invalid block list entry: "example" is not an email domain, such as example.org, or a bad reason invalid_argument

Removes an entry from the block list of sign-ups. hopboxd admin account unblock calls it (hopboxd).

Item Value
Procedure /hopbox.admin.v1.AccountService/UnblockSignUp
Policy action sign_up_block.remove: local_root, admin_key, and an admin session
Idempotent option no. A second call gets not_found.
Audit entry action sign_up_block.remove, no org, target kind sign_up_block and the ID of the entry, details kind and entry

The request UnblockSignUpRequest has the field id, the UUID of the entry. The response UnblockSignUpResponse has the field block, the removed SignUpBlock.

Error Code
The ID is not a UUID invalid_argument
No entry has the ID: not found: the block list has no entry <id> not_found

hopbox.admin.v1.InvitationService makes the instance invitations. An instance invitation lets one new person in with an active account of the tier full, in every sign-up mode (Sessions, cookies, and sign-in links). hopboxd admin invite calls this service (hopboxd), and so does the section “Invitations” of the page Accounts of the Admin area (Console).

An instance invitation has the shape of an org invitation (the org API):

Rule Value
Link https://<domain>/join#token=<token>. The token is 32 random bytes in base64url, as for a sign-in link (Sessions, cookies, and sign-in links). It is in the fragment, so a browser never sends it to a server. The console page /join drops it from the address bar, and shows the sign-in methods. The verified email of the sign-in is the key, not the token, so a person who knows the link but cannot prove the email gets no account.
Use The first sign-in of a new person whose verified email is the email of the invitation uses it. The person signs in with any method that proves the email, also without the link. A login link proves no email, so it uses no invitation.
Storage The control store keeps only the SHA-256 of the token (Control store tables). The audit log never holds the token.
Lifetime 7 days
Use count once
Open invitations one for each email. A new invitation for the email revokes the open one, so its link stops working.
Rate limits The install makes at most 20 instance invitations in an hour. A caller makes at most 20 invitations in an hour, its org invitations and its instance invitations together. An email gets at most 5 in an hour, from every org and the install together. The control store counts them in org_invitation_sends, with an empty org_id for an instance invitation (Control store tables). The caller is the account of an admin session, the admin API key, or local root. Each new invitation takes the transaction lock LockKeyInvitations (the bundled Postgres).
Email With an SMTP config, the server sends the link to the email (SMTP config). Without one, only the caller gets the link. With the file mail transport, the server writes the email to a file on the server, and the caller passes the link on (Mail).
Block list The block list comes first. An invitation lets no blocked email or identity in (Sessions, cookies, and sign-in links).
Rights of the inviter An invitation never outlives the right of its inviter, as for an org invitation (the org API). RevokeInstanceAdmin revokes each open instance invitation of the account, and so does the delete of the account, by itself or by an operator. The invitations of local root and of an admin API key name no account, so they stay. A call of an admin session holds the role of its account until the commit, so a revoke at the same time waits for it, and then revokes the new invitation too.

The leader deletes an instance invitation 24 hours after its end: its use, its revoke, or its expiry (hopboxd).

The message InstanceInvitation has these fields:

Field Type Description
id string The UUID of the invitation.
email string The email that the invitation is for, in lower case.
inviter_account_id string The UUID of the account of the admin session that made the invitation. It is empty for local root and an admin API key, and after the delete of that account.
create_time google.protobuf.Timestamp The time of the invitation.
expire_time google.protobuf.Timestamp The end of the invitation, 7 days after create_time.

Invites an email to make an account of the tier full, and returns the link. With an SMTP config, it also sends the link to the email.

Item Value
Procedure /hopbox.admin.v1.InvitationService/CreateInstanceInvitation
Policy action instance_invitation.create: local_root, admin_key, and an admin session
Idempotent option no. The response holds the link. A retry revokes the invitation of the first try and makes a new one.
Audit entries action instance_invitation.create, no org, target kind instance_invitation, detail email. A replaced invitation gets the action instance_invitation.revoke with the details email and reason (replaced).

The request CreateInstanceInvitationRequest has the field email, the email of the person, such as user1@example.org (Domain rules).

The response CreateInstanceInvitationResponse has these fields:

Field Type Description
invitation InstanceInvitation The new invitation.
url string The link. The sign-in matches the invitation by the verified email, not by the link, so the link alone lets nobody in.
email_sent bool true after a sent email. It is false without an SMTP config, after a failed email, and with the file mail transport, because that email reaches nobody.

The server sends the email after the invitation commits, and waits at most 20 s for the SMTP server. A failed email does not fail the call, because the caller has the link. The server then logs the instance invitation email failed at level error, with component=service, invitation, and err.

The email has this form:

From: hopbox <no-reply@example.org>
To: user1@example.org
Subject: Your invitation to example.com
An instance admin of example.com invites you to make an account there.
Open this link, and sign in with the email user1@example.org to make your account:
https://example.com/join#token=<token>
The link works once, until Fri, 23 Oct 2026 15:47:31 UTC. If you did not expect it, you can ignore this email.
Error Code
The email breaks a rule invalid_argument
The install has no domain: failed precondition: the install has no domain, and the invitation link needs one failed_precondition
An account holds the email as a verified email: failed precondition: the account with the verified email user1@example.org exists already failed_precondition
An admin session whose account lost the instance admin role after the request gate let the call in: permission denied: the account is no longer an instance admin. The call changes nothing. permission_denied
The install made 20 instance invitations in the last hour: too many requests: this install made the most instance invitations of an hour. Wait, then retry resource_exhausted
The caller made 20 invitations in the last hour: too many requests: this caller made the most invitations of an hour. Wait, then retry resource_exhausted
The email got 5 invitations in the last hour: too many requests: this email got the most invitations of an hour. Wait, then retry resource_exhausted
The SMTP password does not open, for example after the loss of its key-encryption key internal
sudo curl -s --unix-socket /run/hopbox/admin.sock \
-H 'Content-Type: application/json' -d '{"email":"user1@example.org"}' \
http://hopboxd/hopbox.admin.v1.InvitationService/CreateInstanceInvitation
{"invitation":{"id":"01a14565-a316-74dd-968e-fac72d706827","email":"user1@example.org","createTime":"2026-10-16T15:47:31.221754Z","expireTime":"2026-10-23T15:47:31.221754Z"},"url":"https://example.com/join#token=vH_2434xeosR22NllAU0tHE8LoqC08ZYHX1JhHZK4UA","emailSent":true}

Lists the open instance invitations, oldest first. An open invitation is not used, not revoked, and not expired.

Item Value
Procedure /hopbox.admin.v1.InvitationService/ListInstanceInvitations
Policy action instance_invitation.list: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action instance_invitation.list, no target

The request ListInstanceInvitationsRequest has no fields. The response ListInstanceInvitationsResponse has the field invitations, a repeated InstanceInvitation. It never holds a link.

Ends an open instance invitation, so its link stops working.

Item Value
Procedure /hopbox.admin.v1.InvitationService/RevokeInstanceInvitation
Policy action instance_invitation.revoke: local_root, admin_key, and an admin session
Idempotent option no. A second call gets not_found.
Audit entry action instance_invitation.revoke, no org, target kind instance_invitation, detail email

The request RevokeInstanceInvitationRequest has the field id, the UUID of the invitation. The response RevokeInstanceInvitationResponse has no fields.

Error Code
The ID is not a UUID invalid_argument
The install has no open instance invitation with the ID: not found: the install has no open instance invitation <id> not_found

hopbox.admin.v1.AdminKeyService manages the admin API keys (CLI tokens, API keys, admin API keys, and SSH keys). An admin API key has install scope and calls the admin API on the API listener, for example from the hopbox Terraform provider. Only local_root calls this service, so no key makes another key. The keys live in the table admin_keys (Control store tables). hopboxd admin admin-key calls this service (hopboxd).

Field Type Description
id string The UUID of the key.
name string The name that root gave the key, such as terraform.
expire_time google.protobuf.Timestamp The end of the key.
last_use_time google.protobuf.Timestamp The last call with the key, exact to a minute. Unset for a key without a call.
create_time google.protobuf.Timestamp The creation of the key.

The enum AdminKeyLifetime has the values ADMIN_KEY_LIFETIME_UNSPECIFIED (90 days), ADMIN_KEY_LIFETIME_30_DAYS, ADMIN_KEY_LIFETIME_90_DAYS, and ADMIN_KEY_LIFETIME_365_DAYS.

Makes an admin API key. The response holds the only copy of the key.

Item Value
Procedure /hopbox.admin.v1.AdminKeyService/CreateAdminKey
Policy action admin_key.create: local_root and an admin session. An admin API key never manages admin keys.
Idempotent option yes. The install keeps no copy of the secret. So a retry with the same idempotency key fails with already_exists and the ID of the key.
Audit entry action admin_key.create, target kind admin_key, details name and expire_time

The request CreateAdminKeyRequest has these fields:

Field Type Default Description
name string none, required A name of 1 to 64 characters, such as terraform (Domain rules).
lifetime AdminKeyLifetime 90 days A preset lifetime. Give it or expire_time, not both.
expire_time google.protobuf.Timestamp none A custom end, in the future and at most 365 days ahead.

The response CreateAdminKeyResponse has the fields key, an AdminKey, and secret, the key itself, which starts with hbxadm_.

Error Code
No name, a bad name, an unknown lifetime, or an expiry in the past or more than 365 days ahead invalid_argument
A caller other than local_root permission_denied, or unauthenticated for an anonymous caller
A retry with an idempotency key that made a key already already_exists

Makes an admin API key from the SHA-256 of its secret, so the secret never reaches the server. hopboxd install registers the first key of an install this way. A second registration of the same hash returns the key of the first one, unchanged, with its first name and expiry.

Item Value
Procedure /hopbox.admin.v1.AdminKeyService/RegisterAdminKey
Policy action admin_key.register: local_root only
Idempotent option yes. A retry with the same idempotency key returns the first response.
Audit entry action admin_key.register, target kind admin_key, details name, expire_time, and new (false for a hash that a key had already)

The request RegisterAdminKeyRequest has the fields of CreateAdminKeyRequest, plus sha256: the SHA-256 of the whole key text, hbxadm_ included, in 64 lowercase hex characters (CLI tokens, API keys, admin API keys, and SSH keys). The response RegisterAdminKeyResponse has these fields:

Field Type Description
key AdminKey The key of the hash.
registered bool true for a key that this call made. false for a hash that an earlier call registered.

A hash that is not 64 lowercase hex characters gets invalid_argument with the message invalid argument: the hash must be the SHA-256 of the key in 64 lowercase hex characters. The hash of an expired key gets failed_precondition with the message failed precondition: the admin key <id> of this hash expired at <time>. Make a new key with a new hash. The other errors are those of CreateAdminKey.

Lists the admin API keys, oldest first. An expired key stays in the list for 30 days. Then the leader deletes it.

Item Value
Procedure /hopbox.admin.v1.AdminKeyService/ListAdminKeys
Policy action admin_key.list: local_root and an admin session. An admin API key never manages admin keys.
Idempotent option no
Audit entry action admin_key.list, no target

The request ListAdminKeysRequest has no fields. The response ListAdminKeysResponse has the field keys, a repeated AdminKey.

Deletes an admin API key at once. The next call with the key gets unauthenticated.

Item Value
Procedure /hopbox.admin.v1.AdminKeyService/RevokeAdminKey
Policy action admin_key.revoke: local_root and an admin session. An admin API key never manages admin keys.
Idempotent option no
Audit entry action admin_key.revoke, target kind admin_key, details name

The request RevokeAdminKeyRequest has the field id, the UUID of the key. The response RevokeAdminKeyResponse has no fields. An ID that is not a UUID gets invalid_argument. An unknown key gets not_found.

Example:

sudo curl -s --unix-socket /run/hopbox/admin.sock \
-H 'Content-Type: application/json' -d '{}' \
http://hopboxd/hopbox.admin.v1.AdminKeyService/ListAdminKeys

hopbox.admin.v1.ServerService enrolls servers and manages the servers of the install. The servers live in the table servers (Control store tables). Enrollment and the install PKI describes the enrollment, and the control channel the heartbeats that keep each server current.

The message Server is one enrolled server, with the facts of its last heartbeat:

Field Type Description
id string The ID of the server, a UUID.
pool string The name of the pool of the server, for example default.
hostname string The host name that the server sent at its enrollment.
roles repeated string The roles of the server, for example node or dns. Its certificate carries them.
state ServerState The state of the server.
cordoned bool True while an instance admin keeps the server cordoned, also while it is unresponsive.
status ServerStatus The health that the server reported in its last heartbeat.
problems repeated string The failed checks of the last heartbeat, one line each, for example kvm: /dev/kvm does not exist. .... The list also has each check of severity warn, also with the status SERVER_STATUS_OK (the preflight check).
labels map of string to string The labels of the server, for example zone=gra. They come from the bootstrap config of the server, until SetServerLabels sets them.
labels_set_by_admin bool True once SetServerLabels set the labels. The heartbeats of the server then no longer change them.
machine_count int32 The machines on the server that their executor has not deleted yet, stopped machines included. The control store counts them. Their disks live on the server.
hopboxd_version string The version of hopboxd on the server, for example v0.1.0.
kernel_release string The release of the host kernel, for example 6.18.57-hopbox1.
cpu CPUFingerprint The CPU of the server.
compatibility_class string The compatibility class: the servers that can restore the memory state of each other, for example cc-9c6a6f2eb2ae6047 (the control channel).
capacity Capacity What the server has for machines.
allocations repeated Allocation The resources that the running machines of the server hold, from its last heartbeat. Empty for a server that runs no machine executor (the node executor).
actions repeated ActionInProgress The actions that the executors of the server ran at its last heartbeat, such as boot. Empty for a server that runs no machine executor.
last_heartbeat_time google.protobuf.Timestamp The time of the last heartbeat. Absent before the first one.
enroll_time google.protobuf.Timestamp The time of the enrollment.
certificate_expire_time google.protobuf.Timestamp The end of the newest certificate of the server.
version int64 The row version. It grows by 1 with each change, such as each heartbeat.
update_time google.protobuf.Timestamp The time of the last change.
mesh ServerMesh The part of the server in the mesh. Absent until the server reports the key of its WireGuard device, and for a server outside the mesh (the mesh).
dns_zone_serial optional uint32 The serial of the zones that the DNS role of the server served at its last heartbeat. Absent on a server without the DNS role, and before its first zones. Compare it with the serial of the zones of the install to find a DNS server that lags (the DNS role).
drain ServerDrain The drain of the server (field 26). Absent when the server does not drain, and after the decommission.
peer_address string The peer address of the server (field 27): the public IPv4 address at which the other servers reach it, such as 203.0.113.12 (Enrollment and the install PKI). Empty for a server without one. The enrollment token or SetServerPeerAddress sets it. A heartbeat never changes it.
removal ServerRoleRemoval The pending removal of roles from the server (field 28) (RemoveServerRoles). Absent without one.
removed_roles repeated string The roles that a removal took from the server (field 29). A token adds a role to the enrolled server only when this list holds the role (Enrollment and the install PKI).

The message ServerMesh has these fields:

Field Type Description
address string The mesh address of the server, in 10.239.0.0/16, for example 10.239.0.3.
vrack_address string Deprecated, and always empty. The mesh runs on the peer address of each server, the field peer_address of Server.
public_key string The public key of the WireGuard device hbm0 of the server, in base64, as wg show prints it.

The message ServerDrain has these fields:

Field Type Description
start_time google.protobuf.Timestamp The start of the drain, or of its last retry.
moving int32 The moves from the server that run now.
stranded repeated StrandedMachine The machines that the drain cannot move. Each one keeps its disk on the server.
empty_checks int32 The empty checks in a row: 0 to 3.
last_check_time google.protobuf.Timestamp The time of the last empty check. Absent before the first one.
error string Why the drain waits now, such as a refused decommission. Empty while the drain goes on.
stuck bool True when no move runs, every machine left on the server is stranded, and a machine is stranded or the decommission was refused. A second DrainServer tries again. The drain also tries a machine that no node had room for again once a minute (Cold move).
cordoned_before bool True when the server was cordoned before the drain, or an instance admin cordoned it during the drain. CancelDrain then keeps the cordon. A drain that a release of the schema version 57 or 58 started holds no such record, and shows true.
stranded_disks repeated StrandedDisk The detached extra disks that the drain cannot move. Each one keeps its data on the server (Cold move). moving counts the moves of disks from the server too, and stuck needs each such disk stranded.

The message ServerRoleRemoval has these fields:

Field Type Description
roles repeated string The roles that go, such as dns and edge, in the order node, dns, edge.
start_time google.protobuf.Timestamp The start of the removal. A move that failed before it strands no machine.
cordoned_before bool True when the server was cordoned before the removal. The end and the cancel of the removal lift only a cordon that the removal set.
moving int32 The moves from the server that run now. Only a removal of node has moves.
stranded repeated StrandedMachine The machines that the removal of node cannot move. Each one keeps its disk on the server.
error string Why the removal waits now, such as a machine that has not booted yet. Empty while the removal goes on.
stuck bool True when no move runs, a machine is stranded, and every machine left on the server is stranded. A cancel ends such a removal (CancelRoleRemoval).
ready bool True when an enrollment of the server with the roles that stay can end the removal. A removal without node is ready at once. A removal of node is ready once the server holds no machine, no allocation, and no move from or to it. It must also hold no old copy of a moved machine, and no copy of a disk that a failed move left. It must hold no extra disk, no move of a disk, and no file of a disk that left it (Extra disks).
stranded_disks repeated StrandedDisk The detached extra disks that the removal of node cannot move. Each one keeps its data on the server.

The message StrandedMachine has these fields:

Field Type Description
machine_id string The ID of the machine.
name string The name of the machine.
reason string Why the machine cannot move.
on_server bool False for a machine on another node whose disk copy a failed move left on this server (Cold move).

A drain and the removal of the role node name the machines that they cannot move with this message.

The message StrandedDisk names an extra disk that a drain or a removal of node cannot move:

Field Type Description
disk_id string The ID of the disk.
name string The name of the disk in its org.
reason string Why the disk cannot move, such as its move failed: ... or no capacity: no other node takes the disk disk1 ....

The enum ServerState has these values:

Value Meaning
SERVER_STATE_UNSPECIFIED Never in a response.
SERVER_STATE_READY The server sends heartbeats and takes new machines.
SERVER_STATE_CORDONED An instance admin cordoned the server. It keeps its machines but takes no new one.
SERVER_STATE_UNRESPONSIVE The server sent no heartbeat for 20 s, or none since its enrollment. Its machines stay on it.
SERVER_STATE_DRAINING A drain cordoned the server and moves its machines to other nodes. The server takes no new machine.
SERVER_STATE_SHUTTING_DOWN The drain found the server empty. After 3 empty checks in a row, one minute apart, it decommissions the server.
SERVER_STATE_DECOMMISSIONED The server left the install. The install refuses its certificates.

The enum ServerStatus has these values:

Value Meaning
SERVER_STATUS_UNSPECIFIED The server sent no heartbeat yet.
SERVER_STATUS_OK Every check of severity fail passes.
SERVER_STATUS_DEGRADED A check of severity fail fails. problems says which.

The message CPUFingerprint has these fields:

Field Type Description
arch string The CPU architecture, as Go names it, for example amd64.
vendor string The vendor_id of /proc/cpuinfo, for example GenuineIntel.
family uint32 The cpu family of /proc/cpuinfo.
model uint32 The model of /proc/cpuinfo.
stepping uint32 The stepping of /proc/cpuinfo.
model_name string The model name of /proc/cpuinfo, for example Intel(R) Xeon(R) CPU E5-1650 v4 @ 3.60GHz.
microcode string The microcode revision, for example 0xb000040.
flags_hash string The SHA-256, in hex, of the sorted CPU flags.
cpu_template string The Firecracker CPU template of the server. It is none in phase 1.

The message Capacity has these fields:

Field Type Description
cpu_threads uint32 The count of CPU threads.
memory_bytes uint64 The size of the memory, MemTotal of /proc/meminfo.
disk_bytes uint64 The size of the file system of the data dir.
disk_free_bytes uint64 The free space on that file system, for an unprivileged user.

The message Allocation has the fields machine_id (string, a UUID), vcpus (uint32), memory_bytes (uint64), and disk_bytes (uint64). The message ActionInProgress has the fields machine_id (string, a UUID), action (string, for example start), and start_time (google.protobuf.Timestamp).

Makes a token with which one new server enrolls into a pool (Enrollment and the install PKI). The token works once and expires after its ttl, 1 hour by default. The install keeps only the SHA-256 of its secret, so the response holds the only copy of the token. The first call of an install makes the install CA and seals its key with the current key-encryption key.

Item Value
Procedure /hopbox.admin.v1.ServerService/CreateEnrollmentToken
Policy action enrollment_token.create: local_root and admin_key
Idempotent option yes, without a stored response. See below.
Audit entry action enrollment_token.create, target kind enrollment_token, target ID the token ID, details pool, roles (joined by commas), expire_time (RFC 3339, in UTC), server, and peer_address. Only a token of an enrolled server has server, and only a token with a peer address has peer_address.

The call needs an Idempotency-Key header (the API server). Its response holds the secret of the token, so the control store keeps the response without the field token. A retry with the same key makes no second token, and fails with already_exists and the message this idempotency key made the enrollment token <token ID> already, and the install keeps no copy of its secret. Make a new token with a new idempotency key. Thus the secret never sits in the control store, and a retry never makes a second token. A caller that lost the response makes a new token with a new key. The unused token expires at the end of its ttl.

The request CreateEnrollmentTokenRequest has these fields:

Field Type Description
pool string The name of the live pool that the new server joins (PoolService). Empty means the pool default.
roles repeated string The roles that the new server can enroll with: node, dns, edge, or more than one. Empty means the role node alone.
server_id string The ID of an enrolled server, or empty. The token then adds the roles to that server alone, in its pool. It enrolls no new server (Enrollment and the install PKI). A pool other than the pool of the server fails with invalid_argument. An unknown server fails with not_found, and a decommissioned one with failed_precondition.
peer_address string The peer address of the server that enrolls with the token, such as 203.0.113.12, or empty. It is one public unicast IPv4 address that no other server holds (Enrollment and the install PKI). The enrollment must come from it, and the new server keeps it.
ttl google.protobuf.Duration How long the token works, more than 0 and at most 24 hours. Absent or zero means 1 hour. While the token is live, its peer_address is in the set registered (Enrollment and the install PKI).

The response CreateEnrollmentTokenResponse has these fields:

Field Type Description
token string The enrollment token, hbxe_<id>_<secret>_<cahash>. It is a secret. Pass it to hopboxd enroll --token on the new server (hopboxd).
token_id string The ID of the token, a UUID, as the audit log names it.
pool string The name of the pool of the token.
expire_time google.protobuf.Timestamp The end of the token, ttl after the call.
ca_hash string The SHA-256, in hex, of the certificate of the install CA. The token holds it too.
roles repeated string The roles that the new server can enroll with.
server_id string The enrolled server that the token adds roles to, or empty.
peer_address string The address from which the enrollment must come, or empty.
Error Cause
failed_precondition with failed precondition: the keyring has no key-encryption key to seal or open the value. Run hopboxd admin kek rotate to make the first one The install has no key-encryption key yet, so it cannot make its CA.
failed_precondition with the error of the keyring The keyring is not safe (Sealing).
invalid_argument with invalid argument: invalid name: the pool name ... The pool name is not a lowercase DNS label.
invalid_argument with invalid argument: unknown server role: ... A role that a server cannot enroll with, or a role twice.
invalid_argument with idempotency: invalid key: this method needs an Idempotency-Key header The call has no idempotency key.
already_exists with this idempotency key made the enrollment token <token ID> already, and the install keeps no copy of its secret. Make a new token with a new idempotency key A retry with a key that made a token already.
not_found with not found: no pool is named "<pool>" No pool has the name.
invalid_argument with invalid argument: invalid peer address: ... peer_address is not an IPv4 address, or not a public unicast one. The rest of the message names the address and the reason, such as 10.0.0.1 is a private address. A peer address is one public IPv4 address on the uplink of the server, with no NAT.
already_exists with already exists: the server <id> has the peer address <address>. A peer address belongs to one server until its decommission Another server that is not decommissioned holds peer_address. A token with server_id can name the peer address of that server.
invalid_argument with invalid argument: the server <id> has the peer address <address>, so its token names that address or none A server_id with a peer_address other than the peer address of that server. This is a build default that follows from Q91 and Q92.
failed_precondition with failed precondition: the control process <process> knows the migrations up to <n>, and only a hopboxd that knows migration 54 checks the peer address of an enrollment token. Upgrade it first A peer_address while a live control process runs a release of the schema version below 54. Such a release enrolls the server from any address. A token without peer_address works.
invalid_argument with invalid argument: the ttl of the token is <ttl>, but it must be more than 0 and at most 24h A negative ttl, or one above 24 hours.
invalid_argument with invalid argument: the ttl of the token is not a valid duration: ... The ttl is not a valid google.protobuf.Duration, such as one with seconds and nanos of opposite signs.

Returns every enrolled server, oldest enrollment first. The list has no pages.

Item Value
Procedure /hopbox.admin.v1.ServerService/ListServers
Policy action server.list: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action server.list, no target

The request ListServersRequest has no fields. The response ListServersResponse has the field servers, a list of Server.

Returns the control processes that recorded themselves in the control store, live or not, oldest start first. The control role never enrolls, so ListServers does not show it. A process that stopped cleanly, or that ended without its stop, stays in the list with live set to false until 24 hours after its last renewal. Then the sweep of the leader deletes its row. The list has no pages. hopboxd admin control list calls it (hopboxd).

Item Value
Procedure /hopbox.admin.v1.ServerService/ListControlProcesses
Policy action control.list_processes: local_root and admin_key
Idempotent option no. The method has the option (hopbox.v1.read_only).
Audit entry action control.list_processes, no target

The request ListControlProcessesRequest has no fields. The response ListControlProcessesResponse has the field processes, a list of ControlProcess.

Field Type Description
id string The ID of the process, a UUID. Each start of the control role has a new one.
server_id string The ID of the enrolled server of the same hopboxd. Empty when no role of that hopboxd enrolled.
hostname string The host name of the server of the process.
internal_url string The URL of the internal listener of the process, such as https://203.0.113.11:7443. Empty when the listener listens on every address or on a loopback address.
release string The version of hopboxd of the process, such as v0.2.0.
schema_version int32 The number of the newest migration that the hopboxd of the process knows.
kek_ids list of string The key-encryption keys that the process can open, staged keys too.
kek_current string The key-encryption key with which the process seals new values.
kek_fingerprints list of string The fingerprint of each key file of kek_ids, as <key ID>=<fingerprint>, such as file:2=9f86d081884c7d659a2feaa0c55ad015 (Sealing). It tells whether two key files hold the same key, and nothing of the key. The hopbox Terraform provider checks a copy of the key files against it. A control process of a release before this field reports none.
maintenance bool true when the process applies maintenance mode.
drained bool true in maintenance mode once no call, control channel, or leader job of the process runs.
start_time Timestamp The start of the process.
renew_time Timestamp The last renewal of the row.
live bool true when the row was renewed in the last 20 seconds.
version int64 The row version. It grows by 1 with each renewal.
stop_time Timestamp The clean stop of the process. Absent while it runs, and after an end without a stop. A stopped process keeps its row for 24 hours, and is never live.

Returns one server.

Item Value
Procedure /hopbox.admin.v1.ServerService/GetServer
Policy action server.get: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action server.get, target kind server, target ID the server ID

The request GetServerRequest has the field id, the ID of the server. The response GetServerResponse has the field server, a Server.

Stops new machines from landing on a server. Its machines keep running. The call sets the flag cordoned. A ready server turns cordoned. An unresponsive server stays unresponsive, and turns cordoned with its next heartbeat. A cordon of a cordoned server changes nothing, and its row version stays.

Item Value
Procedure /hopbox.admin.v1.ServerService/CordonServer
Policy action server.cordon: local_root, admin_key, and an admin session
Idempotent option no. A second call changes nothing.
Audit entry action server.cordon, target kind server, target ID the server ID, details old_state and state

The request CordonServerRequest has the field id, the ID of the server. The response CordonServerResponse has the field server, the Server after the change.

Lets new machines land on a cordoned server again. The call clears the flag cordoned. A cordoned server turns ready. An unresponsive server stays unresponsive, and turns ready with its next heartbeat. An uncordon of a server that is not cordoned changes nothing. A server that drains stays cordoned until its decommission or the cancel of the drain, so the call refuses it (DrainServer, CancelDrain). The removal of the role node keeps its server cordoned too, so the call refuses such a server until the end or the cancel of the removal (RemoveServerRoles).

Item Value
Procedure /hopbox.admin.v1.ServerService/UncordonServer
Policy action server.uncordon: local_root, admin_key, and an admin session
Idempotent option no. A second call changes nothing.
Audit entry action server.uncordon, target kind server, target ID the server ID, details old_state and state

The request UncordonServerRequest has the field id, the ID of the server. The response UncordonServerResponse has the field server, the Server after the change.

Replaces the labels of a server. Placement filters use labels. The hopbox Terraform provider calls it with the labels in its Terraform files (hopbox Terraform provider). From then on, the install keeps these labels, and the heartbeats of the server no longer change them. So channel.labels of the bootstrap config of the server has no effect after the first call (the bootstrap config of hopboxd).

Item Value
Procedure /hopbox.admin.v1.ServerService/SetServerLabels
Policy action server.set_labels: local_root, admin_key, and an admin session
Idempotent option no. A second call with the same labels changes only the row version.
Audit entry action server.set_labels, target kind server, target ID the server ID. The details old_labels and labels hold key=value pairs, sorted by key and joined by commas.

The request SetServerLabelsRequest has the fields id, the ID of the server, and labels, a map of string to string. The labels replace every label of the server. An empty map removes them all. The labels follow the rules of channel.labels. A server has at most 64 labels. A key has 1 to 63 characters of a-z, 0-9, ., _, and -, and starts with a lowercase letter. A value is valid UTF-8 of at most 255 bytes, without control characters. The response SetServerLabelsResponse has the field server, the Server after the change.

Sets the peer address of a server: the public IPv4 address at which the other servers reach it (Enrollment and the install PKI). It is for a server that enrolled without a peer address in its token, such as the first server of an install, or a server from before peer addresses. hopboxd install --peer-address calls it on the first server (hopboxd). The call replaces the address of a server that has one. It refuses an address that another server holds, until that server is decommissioned. It refuses every call while a live control process runs a release before migration 0054. The enrollment token and this call are the only ways to set a peer address. A heartbeat never changes it.

Item Value
Procedure /hopbox.admin.v1.ServerService/SetServerPeerAddress
Policy action server.set_peer_address: local_root and admin_key. The Admin area shows the peer address, but does not set it.
Idempotent option no. A second call with the same address changes only the row version.
Audit entry action server.set_peer_address, target kind server, target ID the server ID, details old_peer_address (empty for a server without one) and peer_address

The request SetServerPeerAddressRequest has the fields id, the ID of the server, and peer_address, one public unicast IPv4 address, such as 203.0.113.12. The response SetServerPeerAddressResponse has the field server, the Server after the change.

Takes a server out of the install for good. The state turns decommissioned, and no call changes it again. The install refuses the certificates, the heartbeats, and the renewals of the server from then on. If the control channel of the server runs in the same control process, that process ends it after the commit. A channel in another control process ends at its next heartbeat (the control channel).

The call works from every state but decommissioned. A draining or shutting_down server must be empty. The drain runs this call itself at its third empty check (Cold move).

The call refuses a server that still holds machines. The control store counts each machine on the server that its executor has not deleted yet, stopped machines included. The last heartbeat of the server counts its allocations. The call refuses a server that a move runs from or to. It also refuses a server that keeps the copy of a disk which a failed move left, while the machine lives on another node. It refuses a server that holds an extra disk, with failed precondition: the server <id> holds <n> disks, such as disk1. Drain it first, so that its disks move to other nodes, or delete them. It also refuses a server that a move of a disk runs from or to (Extra disks). The decommission drops the removals of the files of disks that the server still had to do.

The decommission drops the old copies that the server still had to remove. It clears cleanup_server_id of those moves, so that a new move of those machines does not wait. The row of the drain goes too, and so does a pending removal of roles, with its stranded machines. removed_roles stays.

The call also refuses a server that shares its host with the last live control process, while another server is not decommissioned. The other servers need that control role. The check reads the live rows of control_processes (Control store tables). A live process hosts the server when its row names the server ID, or when it is the process that takes the call and its own host has that identity in <data_dir>/server (Enrollment and the install PKI). The call refuses only while no live control process runs on another host, and other servers still belong to the install. A process on another host counts only when its row names no server, or names a server that is not decommissioned. A process on a decommissioned server goes with its server, so it keeps no control plane for the others. A control process of a release before migration 0045 records no row, so the check does not see it: upgrade every control server before a decommission relies on it. So an install with a second control server decommissions the first server in any order, and the server of the last control process goes last. The check takes a transaction lock before it reads, and so does each enrollment. So two decommissions at the same time, such as in one parallel terraform apply, see each other, and a server that enrolls during the check counts. If the control role cannot read that identity, the call fails with failed_precondition. The message names the file: cannot read the server on the host of this control role: read <data_dir>/server/identity.pem: .... A decommission of a decommissioned server changes nothing, and its row version stays. When Terraform destroys a server, the hopbox Terraform provider drains it, and the drain calls it (hopbox Terraform provider). The provider never removes the first server from its state after a decommission outside Terraform.

Item Value
Procedure /hopbox.admin.v1.ServerService/DecommissionServer
Policy action server.decommission: local_root and admin_key
Idempotent option no. A second call changes nothing.
Audit entry action server.decommission, target kind server, target ID the server ID, details old_state and state

The request DecommissionServerRequest has the field id, the ID of the server. The response DecommissionServerResponse has the field server, the Server after the change.

Moves every machine of a server cold to other nodes, then decommissions the server (Cold move, Drain a node). The call cordons the server and sets its state to draining, then returns at once. A leader job moves the machines, at most 2 at once. A machine that cannot move stays on the server with its disk: a running machine with no room keeps running, a machine whose move failed stays stopped. The drain of the Server names it. Once the server is empty, 3 empty checks in a row, one minute apart, decommission it. A drain never deletes a machine.

A second call starts the drain again, as a retry. It clears the stranded list, restarts start_time, and counts the empty checks from zero. The drain records whether the server was cordoned at its first start, and a retry keeps that record. CordonServer during the drain sets it too. CancelDrain ends the drain. A server that drains stays cordoned, so UncordonServer refuses it with failed precondition: the server <id> drains, and stays cordoned until the drain decommissions it. To keep the server, cancel the drain with hopboxd admin server cancel-drain <id>. An unresponsive server keeps that state with the flag set, and turns draining at its next heartbeat.

Item Value
Procedure /hopbox.admin.v1.ServerService/DrainServer
Policy action server.drain: local_root, admin_key, and an admin session
Idempotent option no. A second call starts the drain again.
Audit entry action server.drain, target kind server, target ID the server ID, details old_state, state, and retry (true or false)

The call refuses a server with a pending removal of roles (RemoveServerRoles). A removal and a drain exclude each other on one server.

The request DrainServerRequest has the field id, the ID of the server. The response DrainServerResponse has the field server, the Server after the change, with its drain.

Starts the removal of the roles edge, dns, node, or more than one from a running server, the first server too (plan questions Q97 and Q100). The server keeps its ID and the data of its other roles. The call returns at once. hopboxd admin server remove-role calls it (hopboxd), and the Terraform provider calls it when a plan drops a role (hopbox Terraform provider).

The call refuses the role control with unimplemented. The control role never enrolls, and it goes from a server only through a second control server on the external Postgres. It refuses a removal that leaves the server no role that enrolls (node, dns, or edge), because its certificate needs one. A drain takes a whole server out (DrainServer). The role dns runs only on edge servers, so the removal of edge from a server with dns must name dns too.

These checks run in the transaction of the call. Each refusal gives failed_precondition with the reason:

  1. The server runs a release whose heartbeats name the feature remove-role (the control channel). The control role takes the features only from the heartbeats of the release that the server runs now.
  2. Another server keeps each role that goes. That server is ready, or cordoned for edge and dns, and has no pending removal of the role. For edge, that server holds at least one floating address: its heartbeats report edge.public_ipv4, edge.floating_addresses, or edge.public_ipv6.
  3. For node, another ready node exists. A machine without room elsewhere does not fail the call. It stays on the server, as in a drain.
  4. For edge and dns, the public addresses of the install, which the zone names, hold no address of the server: its peer address, the floating addresses of its heartbeats, and the public addresses on its interfaces (the API server). Set the public addresses first with hopboxd admin config set --public-address.
  5. No live control process runs a release of the schema version below 56.

The call takes the advisory lock of the server registry, so two removals run one after the other, and each sees the other. It records the removal on the server row (removal_roles, removal_cordoned_before, removal_started_at), and writes the audit entry server.remove_roles_start. The registry keeps every role until the end of the removal, so the certificate of the server stays valid and its control channel goes on (Enrollment and the install PKI).

For node, the call cordons the server first. A leader job then moves each machine of the server cold to another node, as the drain does, at most 2 at once (Cold move). No decommission comes at the end. A machine that cannot move stays on the server with its disk, the removal waits, and removal.stranded names the machine. The removal records whether the server was cordoned before it. Its end and its cancel lift only a cordon that it set, so a cordon of the operator stays.

A removal without node is ready at once. A removal of node is ready once the server holds nothing for a move (removal.ready). An enrollment of the server with the roles that stay then ends the removal (Enrollment and the install PKI). The end adds the roles that went to removed_roles.

One removal runs at a time on a server. A second call for a server with a pending removal returns that removal when it names the same roles, in any order. So a retry of the Terraform provider goes on with it. A call with other roles fails. DrainServer refuses a server with a pending removal, and this call refuses a server that drains.

Item Value
Procedure /hopbox.admin.v1.ServerService/RemoveServerRoles
Policy action server.remove_roles_start: local_root and admin_key
Idempotent option no. A second call with the same roles returns the pending removal, and writes no second audit entry.
Audit entry action server.remove_roles_start, target kind server, target ID the server ID, details roles and cordoned_before (true or false)

The request RemoveServerRolesRequest has the fields id, the ID of the server, and roles, the roles that go. The response RemoveServerRolesResponse has the field server, the Server with its removal.

Ends the pending removal of roles from a server that cannot finish. An example is a removal of node with a machine that has no room elsewhere. No new move starts. Each move from the server that started with a removal of node and still runs ends as CancelMove ends it (the machine API). A removal of edge or dns has no moves, so its cancel ends no move, also a move that an admin started. A machine that moved stays on its new node. The registry keeps every role of the server, removed_roles does not change, and the stranded machines go. The cordon of the removal goes. A cordon that the server had before the removal stays.

The cancel takes the lock of the server registry first, before the rows of the machines and the row of the server, as the start and the end of a removal do (the bundled Postgres). So the checks of a removal from another server, and the end, the resync, or the decommission of the same server, see the cancel whole or not at all. If a move of the removal starts during the cancel, the cancel tries again, at most 3 times. A control process of an older build can end the removal during the cancel. The cancel then fails with failed_precondition.

hopboxd admin server cancel-remove-role calls it (hopboxd). After a cancel, put the role back in the Terraform configuration, so the next plan shows no change (hopbox Terraform provider).

Item Value
Procedure /hopbox.admin.v1.ServerService/CancelRoleRemoval
Policy action server.remove_roles_cancel: local_root and admin_key
Idempotent option no. A second call fails, because the removal is gone.
Audit entry action server.remove_roles_cancel, target kind server, target ID the server ID, details roles and moved, the count of machines that moved before the cancel. Each move that the cancel ends writes the entry machine.cancel_move with the detail removal.

The request CancelRoleRemovalRequest has the field id, the ID of the server. The response CancelRoleRemovalResponse has the field server, the Server after the cancel.

Ends the drain of a server (plan question Q102). An example is a drain that started by mistake. No new move starts. Each move from the server that started since the first start of the drain, and whose source still stops its machine, ends as CancelMove ends it (CancelMove). Its machine keeps its own target on the server, so a running machine boots there again. Each move whose target pulls the disk goes on to its end, because its machine stopped already, and a cancel of the pull leaves it stopped on the source. Such a move ends done on the target, or fails and gives the machine back by the rules of a move (Cold move). A machine that moved stays on its new node. The stranded machines stay on the server.

The server turns cordoned when drain.cordoned_before is true, and ready otherwise. A shutting_down server turns the same way. An unresponsive server keeps that state with the flag of its cordon, and its next heartbeat gives it the state of the cordon. The row of the drain goes.

hopboxd admin server cancel-drain calls it (hopboxd), and so does the button “Cancel drain” of the Admin area (Use the Admin area). For a server that Terraform manages, a cancel during terraform destroy fails the destroy (hopbox Terraform provider).

The call refuses while a live control process runs a release of the schema version below 59. The leader of such a release does not know the cancel, and can set the drain going again.

Item Value
Procedure /hopbox.admin.v1.ServerService/CancelDrain
Policy action server.drain_cancel: local_root, admin_key, and an admin session
Idempotent option no. A second call fails, because the drain is gone.
Audit entry action server.drain_cancel, target kind server, target ID the server ID, details old_state, state, cordoned (true or false), moved, the count of machines that moved before the cancel, canceled_moves, and pulling, the moves that go on. Each move that the cancel ends writes the entry machine.cancel_move with the detail drain.

The request CancelDrainRequest has the field id, the ID of the server. The response CancelDrainResponse has the field server, the Server after the cancel, without a drain.

GetServer, CordonServer, UncordonServer, SetServerLabels, SetServerPeerAddress, DecommissionServer, DrainServer, RemoveServerRoles, CancelRoleRemoval, and CancelDrain check the policy first, and then the ID.

Error Cause
invalid_argument with invalid argument: the server ID "<id>" is not a UUID The ID is not a UUID.
not_found with not found: no server has the ID <id> No server has the ID.
failed_precondition with failed precondition: the server <id> is decommissioned CordonServer, UncordonServer, SetServerLabels, SetServerPeerAddress, or DrainServer of a decommissioned server.
already_exists with already exists: the server <id> has the peer address <address>. A peer address belongs to one server until its decommission SetServerPeerAddress with the address of another server that is not decommissioned.
failed_precondition with failed precondition: the control process <process> knows the migrations up to <n>, and only a hopboxd that knows migration 54 checks the source address of an enrollment. Upgrade it first SetServerPeerAddress while a live control process runs a release of the schema version below 54. Such a release enrolls a token without a peer address from any address (Enrollment and the install PKI).
invalid_argument with invalid argument: invalid peer address: ... SetServerPeerAddress with an address that is not one public unicast IPv4 address. The rest of the message names the address and the reason, such as 10.239.0.3 is in the mesh range 10.239.0.0/16.
invalid_argument with invalid argument: invalid label: ... SetServerLabels with a label that breaks a rule. The rest of the message names the label and the rule.
failed_precondition with failed precondition: the server <id> holds <n> machines, such as <names>. Drain it first, so that its machines move to other nodes, or delete them DecommissionServer of a server with machines. <names> holds up to 5 names. Without names, the message reads holds <n> machines. Drain it first, ....
failed_precondition with failed precondition: the move <move id> of the machine <machine id> runs from or to the server <id>. Wait for its end, or cancel it DecommissionServer of a server that a move runs from or to.
failed_precondition with failed precondition: the server <id> keeps a copy of the disk of the machine <name>, which a failed move left <state> on another node. Give the machine back with hopboxd admin machine move --cancel --give-back, delete it, or keep the server DecommissionServer of a server that keeps the only copy of a disk after a failed move.
failed_precondition with failed precondition: the server <id> drains, and stays cordoned until the drain decommissions it. To keep the server, cancel the drain with hopboxd admin server cancel-drain <id> UncordonServer of a server that drains.
failed_precondition with failed precondition: the control process <process> knows the migrations up to <n>, and only a hopboxd that knows migration 51 drains servers. Upgrade it first DrainServer while a live control process runs a release of the schema version below 51.
failed_precondition with failed precondition: the server <id> has no role node, so it holds no machine to move. Decommission it instead DrainServer of a server without the role node.
permission_denied with permission denied: the server <id> hosts a control process, so only root on a control server or an admin API key drains it DrainServer by an admin session of a server that hosts a control process. A new sign-in does not change it.
failed_precondition with failed precondition: the server <id> shares its host with the last live control process of the install, and <n> other servers still belong to the install. Decommission them first, or start the control role on another server DecommissionServer of the server on the host of the last live control process, before the other servers.
failed_precondition with failed precondition: the server <id> has a pending removal of the roles <roles>. Wait for its end, or cancel it with hopboxd admin server cancel-remove-role <id> DrainServer of a server with a pending removal, and RemoveServerRoles with other roles than the pending removal.
failed_precondition with failed precondition: the removal of the node role keeps the server <id> cordoned, so that its machines move off. Cancel the removal first with hopboxd admin server cancel-remove-role <id> UncordonServer of a server with a pending removal of node.
unimplemented with unimplemented: the role control cannot leave a running server in this release. The way that exists: move the control store to an external Postgres with hopboxd admin db export, add a second control server on it, and decommission this server RemoveServerRoles that names control.
invalid_argument with invalid argument: name at least one role to remove: edge, dns, or node, invalid argument: unknown role "<role>". A removal takes edge, dns, or node, or invalid argument: the role <role> appears twice RemoveServerRoles without a role, with an unknown role, or with a role twice.
failed_precondition with failed precondition: the server <id> drains, and the drain takes the whole server out RemoveServerRoles of a server that drains.
failed_precondition with failed precondition: the server <id> has no role <role>. It has the roles <roles> RemoveServerRoles of a role that the server does not have.
failed_precondition with failed precondition: the removal of <roles> leaves the server <id> no role that enrolls, and its certificate needs one. To take the whole server out, drain it: hopboxd admin server drain <id> RemoveServerRoles of every role of the server that enrolls.
failed_precondition with failed precondition: the role dns runs only on edge servers, so the removal of edge from the server <id> takes dns too: name edge and dns RemoveServerRoles of edge alone on a server with dns.
failed_precondition with failed precondition: the control process <process> knows the migrations up to <n>, and only a hopboxd that knows migration 56 removes roles from servers. Upgrade it first RemoveServerRoles while a live control process runs a release of the schema version below 56.
failed_precondition with failed precondition: the roles <roles> cannot leave the server <id>: <reason> RemoveServerRoles that breaks a check. The reason is one of these: the server runs hopboxd <version>, whose heartbeats name no feature remove-role. Upgrade the server first, no other ready server keeps the role <role>, and the install needs one, no other ready edge server holds a floating address, and the public addresses of the install must be floating addresses. Give an edge server a floating address first, no other ready node exists, so the machines of the server have nowhere to go, or the public addresses of the install name the address <address> of the server, so the zone still sends traffic to it. Set the public addresses without it first: hopboxd admin config set --public-address.
failed_precondition with failed precondition: the server <id> has no pending removal of a role CancelRoleRemoval of a server without a removal.
aborted with conflict: moves from the server <id> kept starting during the cancel. Retry CancelRoleRemoval while moves of the removal kept starting, or the removal changed, in 3 tries. CancelDrain while moves of the drain kept starting, or a new drain replaced the drain, in 3 tries.
failed_precondition with failed precondition: the server <id> does not drain CancelDrain of a server without a drain.
failed_precondition with failed precondition: the control process <process> knows the migrations up to <n>, and only a hopboxd that knows migration 59 cancels drains. Upgrade it first CancelDrain while a live control process runs a release of the schema version below 59.

Example:

sudo curl -s --unix-socket /run/hopbox/admin.sock \
-H 'Content-Type: application/json' -d '{}' \
http://hopboxd/hopbox.admin.v1.ServerService/ListServers

hopbox.admin.v1.MonitorService reads the history of samples for the pages Overview, Capacity, Machines, and Accounts of the Admin area (Console). The history holds the values of the metric families that the pages draw, 24 hours at 1-minute steps, in the table metric_samples (Metrics). Each call reads the same metric families as the matching dashboard of the monitoring bundle, so the numbers match Grafana (Q139). The facts that no metric holds, such as the state of a server or the name of an org, come from the control store.

The calls write no audit entry, unlike every other call of the admin API. The console reads each page again every minute while the page is visible, and an entry for each read fills the append-only audit log with noise (decided by the owner on 2026-10-31). The policy still refuses every caller that is not an instance operator or an admin session.

The message SamplePoint is one value of a trend:

Field Type Description
time google.protobuf.Timestamp The end of the step of the value.
value double The value.

The message MachineUse is what one running machine uses. A machine runs when its node served hopbox_machine_info for it in the last 3 minutes. A series with the state saved, of a hibernated machine, does not count (Metrics).

Field Type Description
machine_id string The ID of the machine.
name string The name of the machine.
org_id string The ID of the org of the machine.
org_name string The name of the org, or empty when the org is gone.
owner_email string The first email of the first owner of the org, so the admin knows the person.
size string The name of the size of the machine.
vcpus int32 The vCPUs of the size.
memory_bytes int64 The RAM of the size.
disk_bytes int64 The disk of the size.
server_id string The ID of the node of the machine. It is empty when the node took the sample before its enrollment.
url_visibility hopbox.v1.URLVisibility The visibility of the URL of the machine. It is unspecified when the machine is gone from the control store.
cpu_share_5m double The share of its vCPUs that the machine used in the last 5 minutes, from hopbox_machine_cpu_seconds_total. 1 is every vCPU all the time.
cpu_share_30m optional double The same share over the last 30 minutes. It is absent until the samples of the machine cover the 30 minutes, such as for a machine that started 10 minutes ago. The samples of a machine go on across a restart of hopboxd and a move to another node (Metrics).
cpu_share_1h optional double The same share over the last hour, absent until the samples cover the hour.
cpu_history repeated SamplePoint The share in each 30 minutes of the last 24 hours. Only ListTopMachines fills it. A step in which the machine did not run has no point.
memory_used_bytes int64 The host RAM that the machine holds now, from hopbox_machine_memory_bytes.
disk_used_bytes int64 The bytes that the sparse disk file holds now, from hopbox_machine_disk_bytes.
egress_bytes int64 The bytes that the machine sent out in the last 24 hours, from hopbox_machine_egress_bytes_total. A stop and a start of the machine give it a new cgroup and connect its tap device again, so its CPU time and its egress counters start again from 0, and a reader counts the value after the start whole.
egress_connections int64 The outbound connections that the machine opened in the last 24 hours, from hopbox_machine_egress_connections_total.

Returns the state of the whole install, the dashboard D1 of the monitoring bundle.

Item Value
Procedure /hopbox.admin.v1.MonitorService/GetOverview
Policy action monitor.get_overview: local_root, admin_key, and an admin session
Idempotent option no
Audit entry none

The request GetOverviewRequest has no fields. The response GetOverviewResponse has these fields:

Field Type Description
sample_time google.protobuf.Timestamp The time of the newest sample of the leader. It is absent while the history has none, such as in the first minute after the start of the control role. The counts of the leader are 0 then.
nodes int32 The servers with the node role that are not decommissioned, from hopbox_server_vcpus.
vcpus int64 The vCPU capacity of every node, with the overcommit of placement.
vcpus_allocated int64 The vCPUs of the machines that hold compute on the nodes.
memory_bytes int64 The RAM of every node.
memory_allocated_bytes int64 The RAM of the machines that hold compute on the nodes.
machines repeated MachineStateCount The machines by current state, from hopbox_machines. A state without a machine is absent. MachineStateCount has the fields state, a hopbox.v1.MachineState, and count, an int64.
pending_accounts int64 The accounts that wait for an instance admin, from hopbox_accounts.
oldest_pending google.protobuf.Duration The age of the oldest pending account, or 0.
public_urls int64 The machines with a public URL.
suspended_orgs int64 The suspended orgs, personal and team, from hopbox_orgs.
last_day EventCounts The events of the last 24 hours.
health repeated HealthLine One line for each HealthArea, in the order of the enum.
busy_machines repeated MachineUse The running machines that used 90% or more of their vCPUs over the last 30 minutes, the busiest first. The alert HopboxMachineCPUSustained fires when this lasts 2 hours. cpu_history is empty.
grafana_url string grafana_url of the install config, or empty.
servers repeated ServerHealth The servers that are not decommissioned, from the control store, oldest enrollment first.
pending_emails repeated string The first emails of the 5 oldest pending accounts, oldest first.
open_notices int32 The open notices of the caller (ListAdminNotices). A caller without an account, such as an admin API key, has none.
public_url_orgs int32 The orgs with a machine with a public URL, from the control store.
firing_alerts repeated FiringAlert The alerts of the monitoring bundle and the abuse signals that fire now, newest first, at most 20 together, from the view alert_list (Notices of alerts, Notices of abuse signals).
firing_alert_count int32 The count of every alert and every abuse signal that fires now, also those after the first 20.
firing_abuse_count int32 The count of the abuse signals of firing_alert_count.

The message FiringAlert has the fields name, severity, summary, start_time, fingerprint, kind, and id, as in AdminAlert.

The message ServerHealth has the fields server_id, hostname, state (a ServerState), and status (a ServerStatus, unspecified before the first heartbeat) of one server (Server).

The message EventCounts counts the events of the range over every control process and node. A counter that restarts counts from 0 again, as the recording rules of the monitoring bundle count it (Metrics).

Field Type Description
sign_ups int64 The new accounts that were not refused, from hopbox_account_creations_total.
org_creations int64 The new orgs, from hopbox_audit_entries_total with the action org.create.
api_key_creations int64 The new API keys of every kind, from hopbox_api_key_creations_total.
urls_made_public int64 The changes of the visibility of a machine URL from private to public, from the audit entries machine.set_url_visibility of the control store. No metric names the visibility.
rate_limited int64 The requests that a rate limit refused, from hopbox_rate_limited_total.
limit_refusals int64 The calls that an org limit refused, from hopbox_limit_refusals_total.
api_errors int64 The API calls that ended with the code internal, unavailable, unknown, or data_loss, from hopbox_api_calls_total.
executor_failures int64 The failed actions of the executors, from hopbox_executor_actions_total with the result failed.
url_changes int64 The changes of the port and the visibility of machine URLs, from hopbox_audit_entries_total with the actions machine.set_url_port and machine.set_url_visibility, as the alert HopboxURLChurn counts them. urls_made_public is a part of them.

The message HealthLine has the fields area, a HealthArea, state, a HealthState, and problems, a repeated string with one line for each problem, the worst first. Each check uses the threshold of the alert of the monitoring bundle that names the same problem.

HealthArea Number Checks
HEALTH_AREA_UNSPECIFIED 0 Never in a response.
HEALTH_AREA_CONTROL_PLANE 1 The leader took a sample in the last 3 minutes. 5 or more API calls of the last 10 minutes, and more than 5% of them, failed, as HopboxAPIErrors counts them (warning). The first value of a new series counts whole in both. The alert waits 1 minute, so it comes up to 2 minutes after this line. Neither counts while maintenance mode is on, or in the 10 minutes after it, because it refuses calls by design.
HEALTH_AREA_NODES 2 A server is unresponsive (critical) or degraded (warning). A node has 90% or more of its vCPUs or of its RAM allocated (warning). The data dir of a node has less than 15% free (warning) or less than 5% free (critical). An action of an executor failed in the last 15 minutes (warning).
HEALTH_AREA_EDGE 3 The edge: it has no certificate (critical), or its certificate ends within 3 days (critical) or 14 days (warning). DNS and the SSH front door get their checks with milestone O6.
HEALTH_AREA_NETWORK 4 The host firewall of a server is down (critical). hopboxd repaired the node network in the last hour (warning).
HealthState Number Meaning
HEALTH_STATE_UNSPECIFIED 0 Never in a response.
HEALTH_STATE_OK 1 No check of the area found a problem.
HEALTH_STATE_WARNING 2 A check found a problem that a warning alert names.
HEALTH_STATE_CRITICAL 3 A check found a problem that a critical alert names.
HEALTH_STATE_UNKNOWN 4 The history has no recent sample of the area, such as an edge on a server without the control role, or no sample of the leader yet.

Returns the capacity of each node, what its machines hold and use, and the trends, the dashboard D2 of the monitoring bundle.

Item Value
Procedure /hopbox.admin.v1.MonitorService/GetCapacity
Policy action monitor.get_capacity: local_root, admin_key, and an admin session
Idempotent option no
Audit entry none

The request GetCapacityRequest has the field range, a HistoryRange:

HistoryRange Number Meaning
HISTORY_RANGE_UNSPECIFIED 0 The same as HISTORY_RANGE_DAY.
HISTORY_RANGE_DAY 1 The last 24 hours, in steps of 5 minutes.
HISTORY_RANGE_HOUR 2 The last hour, in steps of 1 minute.

The response GetCapacityResponse has the fields sample_time (the newest sample of the leader, or absent), step (a google.protobuf.Duration, the time between two points of each trend), servers (a list of ServerCapacity, by ID), and grafana_url. The servers are the servers with the node role that are not decommissioned.

The message ServerCapacity holds one node:

Field Type Description
server_id string The ID of the server.
hostname string The host name of the server, or empty when the control store no longer has the server.
pool string The pool of the server, or empty as hostname.
roles repeated string The roles of the server.
state ServerState The state of the server, or unspecified as hostname.
cpu_threads int32 The CPU threads of the node. vcpus is cpu_threads times the vCPU overcommit of placement, so a page compares cpu_used with it.
vcpus int64 The vCPU capacity, with the overcommit of placement: 2 vCPUs for each CPU thread.
vcpus_allocated int64 The vCPUs of the machines that hold compute on the node.
memory_bytes int64 The RAM of the node.
memory_allocated_bytes int64 The RAM of the machines that hold compute on the node.
disk_bytes int64 The size of the file system of the data dir.
disk_free_bytes int64 The free space of that file system.
disk_allocated_bytes int64 The disk sizes of the machines on the node.
cpu_used optional double The CPU threads that the machines of the node used between the two newest samples of the range, 1 minute or 5 minutes apart, from hopbox_machines_cpu_seconds_total. It is absent when the history has no recent sample of the node, such as for a node without the control role.
memory_used_bytes optional int64 The host RAM that the machines of the node hold now, from hopbox_machines_memory_bytes. It is absent as cpu_used is.
cpu_used_history repeated SamplePoint cpu_used, the average of each step of the range.
memory_used_history repeated SamplePoint memory_used_bytes at the end of each step.
vcpus_allocated_history repeated SamplePoint vcpus_allocated at the end of each step.
memory_allocated_history repeated SamplePoint memory_allocated_bytes at the end of each step.
disk_free_history repeated SamplePoint disk_free_bytes at the end of each step.

The call reads one sample of each step of the range, the newest of the step, and not every sample. A step without a sample has no point. An unknown range gets invalid_argument with the message invalid argument: the range <range> is not day or hour.

Returns the running machines that use the most, the dashboard D3 of the monitoring bundle.

Item Value
Procedure /hopbox.admin.v1.MonitorService/ListTopMachines
Policy action monitor.list_top_machines: local_root, admin_key, and an admin session
Idempotent option no
Audit entry none

The request ListTopMachinesRequest has the fields order_by, a MachineUseOrder, and limit, an int32: the most machines in the response, 1 to 100. 0 means 20. Machines with the same value come in the order of their names.

MachineUseOrder Number Order
MACHINE_USE_ORDER_UNSPECIFIED 0 The same as MACHINE_USE_ORDER_CPU.
MACHINE_USE_ORDER_CPU 1 The share of its vCPUs that a machine used in the last hour, the most first.
MACHINE_USE_ORDER_MEMORY 2 The host RAM that a machine holds now.
MACHINE_USE_ORDER_DISK 3 The bytes that the disk file of a machine holds now.
MACHINE_USE_ORDER_EGRESS 4 The bytes that a machine sent out in the last 24 hours.

The response ListTopMachinesResponse has the fields sample_time (the newest sample of a machine, or absent), machines (a list of MachineUse, with cpu_history), total (the running machines of the history, also those past limit), and grafana_url.

The per-machine families are most of the rows of the history. So the call reads the newest values of hopbox_machine_info, hopbox_machine_memory_bytes, and hopbox_machine_disk_bytes, and the last hour of hopbox_machine_cpu_seconds_total. For the CPU trend and the egress of 24 hours, it reads one sample of each 30 minutes of each process, the newest of the 30 minutes, in steps from the start of the 24 hours, and one step before it. A restart of the network of a node within 30 minutes thus loses the egress of that machine between the sample before and the restart. At 1,000 running machines on one control process, a call takes about 0.25 s (Control store tables).

A limit below 0 or above 100 gets invalid_argument with the message invalid argument: the limit <n> is not 1 to 100. An unknown order gets invalid_argument with the message invalid argument: the order <order> is not cpu, memory, disk, or egress.

Returns the account activity of the last 24 hours, hour by hour, the dashboard D4 of the monitoring bundle. The Accounts page shows it.

Item Value
Procedure /hopbox.admin.v1.MonitorService/GetAccountActivity
Policy action monitor.get_account_activity: local_root, admin_key, and an admin session
Idempotent option no
Audit entry none

The request GetAccountActivityRequest has no fields. The response GetAccountActivityResponse has these fields:

Field Type Description
sample_time google.protobuf.Timestamp The time of the newest sample of the leader, or absent without one.
hours repeated ActivityHour The 24 hours that end at the time of the call, oldest first. An increase between two samples counts in the hour of the second sample.
last_day EventCounts The events of the 24 hours.
rate_limited repeated LimitCount The refusals of each rate limit in the 24 hours, from hopbox_rate_limited_total, the most first. A limit without a refusal is absent. LimitCount has the fields limit, a string such as account_creations, and count, an int64.
public_urls int64 The machines with a public URL now.
public_url_orgs int32 The orgs with a machine with a public URL now, from the control store.
suspended_orgs int64 The suspended orgs now.
grafana_url string grafana_url of the install config, or empty.

The message ActivityHour has the field start_time, the start of the hour, and the counts sign_ups, org_creations, api_key_creations, urls_made_public, rate_limited, and url_changes of the hour, as in EventCounts. The URLs made public of each hour come from the audit log in one count per hour.

hopbox.admin.v1.PoolService manages the pools. A pool is a named group of servers. Each enrollment token enrolls a server into one pool, and all servers of a pool have identical hardware. An operator size can keep its machines in one pool (SizeService). The pools live in the table pools (Control store tables). Every install has the pool default, and an enrollment token without a pool enrolls into it.

A pool records the hardware of its servers. The first server that enrolls into the pool records it. The enrollment of a server with other hardware fails (plan question Q61). A pool records no plan of a provider, because the operator orders each server at its provider.

The message Pool holds one pool:

Field Type Description
id string The ID of the pool, a UUID.
name string The name of the pool, a lowercase DNS label, such as default.
ovh_plan string Deprecated, and always empty. A pool records no plan of a provider.
hardware PoolHardware The hardware of the first server that enrolled into the pool. It is absent before that enrollment. A pool whose servers are all decommissioned takes the hardware of its next server (Enrollment and the install PKI).
server_count int32 The count of servers of the pool that are not decommissioned.
size_count int32 The count of sizes that name the pool and are not retired.
version int64 The row version. It grows by 1 with each change, such as the record of the hardware.
create_time google.protobuf.Timestamp The time of the create.
update_time google.protobuf.Timestamp The time of the last change.

The message PoolHardware holds the hardware that a server reports at its enrollment (Enrollment and the install PKI):

Field Type Description
cpu_model string The model name of the CPU, such as AMD EPYC 4244P 6-Core Processor.
cpu_threads uint32 The count of CPU threads.
memory_bytes uint64 The RAM that the kernel sees, in bytes.
disk_bytes repeated uint64 The sizes of the whole disks, in bytes, smallest first.

Adds a pool.

Item Value
Procedure /hopbox.admin.v1.PoolService/CreatePool
Policy action pool.create: local_root, admin_key, and an admin session
Idempotent option yes. A retry with the same key returns the first result.
Audit entry action pool.create, target kind pool, target ID the pool ID, details name

The request CreatePoolRequest has these fields:

Field Type Description
name string The name of the pool: a lowercase DNS label of 1 to 63 characters that starts with a letter. No other live pool can have it. The name of a deleted pool is free.
ovh_plan string Deprecated. The call ignores it.

The response CreatePoolResponse has the field pool, the new Pool.

Returns one pool.

Item Value
Procedure /hopbox.admin.v1.PoolService/GetPool
Policy action pool.get: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action pool.get, target kind pool, target ID the pool ID

The request GetPoolRequest has the field name, the name of the pool. The response GetPoolResponse has the field pool, a Pool.

Returns every pool, by name. The list has no pages, and it leaves out the deleted pools.

Item Value
Procedure /hopbox.admin.v1.PoolService/ListPools
Policy action pool.list: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action pool.list, no target

The request ListPoolsRequest has no fields. The response ListPoolsResponse has the field pools, a list of Pool.

Deletes a pool and frees its name. The row stays in the table pools, because the decommissioned servers and the retired sizes of the pool still name it. A deleted pool takes no enrollment: an unused token of the pool fails (Enrollment and the install PKI).

The call refuses these pools:

  • the pool default, because an enrollment token without a pool enrolls into it
  • a pool that holds a server that is not decommissioned
  • a pool that a size names that is not retired

The call locks the row of the pool. An enrollment into the pool and a create of a size that names the pool wait for the lock, so neither one can slip in during the check.

Item Value
Procedure /hopbox.admin.v1.PoolService/DeletePool
Policy action pool.delete: local_root, admin_key, and an admin session
Idempotent option no. A second call fails with not_found.
Audit entry action pool.delete, target kind pool, target ID the pool ID, detail name

The request DeletePoolRequest has the field name, the name of the pool. The response DeletePoolResponse has no fields.

Error Cause
invalid_argument with invalid argument: invalid name: the pool name ... CreatePool with a name that is not a lowercase DNS label.
invalid_argument with idempotency: invalid key: this method needs an Idempotency-Key header CreatePool without an idempotency key.
already_exists with already exists: a pool is named "<name>" already CreatePool with the name of a live pool.
not_found with not found: no pool is named "<name>" GetPool or DeletePool of a name that no live pool has.
failed_precondition with failed precondition: the pool default stays, because an enrollment token without a pool enrolls into it DeletePool of the pool default.
failed_precondition with failed precondition: the pool <name> holds <n> servers. Decommission them first DeletePool of a pool with servers.
failed_precondition with failed precondition: <n> sizes name the pool <name>. Retire them first DeletePool of a pool that live sizes name.

Example:

sudo curl -s --unix-socket /run/hopbox/admin.sock \
-H 'Content-Type: application/json' -H "Idempotency-Key: $(uuidgen)" \
-d '{"name":"big"}' \
http://hopboxd/hopbox.admin.v1.PoolService/CreatePool

hopbox.admin.v1.SizeService manages the sizes of machines. A fresh install has the sizes default and tiny (Domain rules). tiny is the size of a create without a size in the personal org of a limited account (the machine API). An instance admin adds bigger sizes with this service. A user picks a size at the create of a machine, and never a pool (the machine API). The sizes live in the table sizes (Control store tables).

A size can name a pool and labels. They become the placement filters 4 and 5 of each machine of the size (Placement), so its machines land only on the nodes of that pool that have each label (plan question Q60). A size that names no pool takes any pool.

A size never changes. A machine copies the vCPUs, the RAM, and the disk of its size at its create. To change a size, add a size with a new name and retire the old one. A retired size takes no new machine. Its machines keep it, and its name stays taken, because the machines name it. The sizes default and tiny cannot retire, because a create without a size takes them.

The message Size holds one size:

Field Type Description
name string The name of the size, a lowercase DNS label, such as default.
vcpus int32 The count of vCPUs, 1 to 32.
memory_bytes int64 The RAM, in bytes: at least 128 MiB, and a whole number of MiB.
disk_bytes int64 The size of the sparse disk, in bytes: at least 1 GB, and a whole number of 512-byte sectors.
pool string The name of the pool of the machines of the size, or empty for any pool. A retired size can name a deleted pool.
labels map of string to string The labels that a node must have to take a machine of the size, such as disk=nvme.
retire_time google.protobuf.Timestamp The time of the retirement. It is absent while the size takes new machines.
version int64 The row version. It grows by 1 with the retirement.
create_time google.protobuf.Timestamp The time of the create.
update_time google.protobuf.Timestamp The time of the last change.

Adds a size. The call takes a share lock on the row of the pool that the size names, so a delete of that pool waits for it.

Item Value
Procedure /hopbox.admin.v1.SizeService/CreateSize
Policy action size.create: local_root, admin_key, and an admin session
Idempotent option yes. A retry with the same key returns the first result.
Audit entry action size.create, target kind size, target ID the name of the size. The details are vcpus, memory_bytes, disk_bytes, pool, and labels, the key=value pairs sorted by key and joined by commas.

The request CreateSizeRequest has these fields:

Field Type Description
name string The name of the size: the syntax of a machine name (Domain rules). No other size can have it, also no retired one.
vcpus int32 The count of vCPUs, 1 to 32.
memory_bytes int64 The RAM, in bytes: at least 134217728 (128 MiB), and a whole number of MiB.
disk_bytes int64 The size of the sparse disk, in bytes: at least 1000000000 (1 GB), and a whole number of 512-byte sectors.
pool string The name of a live pool, or empty for any pool.
labels map of string to string The labels that a node must have to take a machine of the size. They follow the rules of the labels of a server (SetServerLabels): at most 64, a key of 1 to 63 of a-z, 0-9, ., _, and - that starts with a letter, and a value of at most 255 bytes of UTF-8 without control characters.

The response CreateSizeResponse has the field size, the new Size.

Returns one size, also a retired one.

Item Value
Procedure /hopbox.admin.v1.SizeService/GetSize
Policy action size.get: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action size.get, target kind size, target ID the name of the size

The request GetSizeRequest has the field name, the name of the size. The response GetSizeResponse has the field size, a Size.

Returns the sizes, smallest first: by vCPUs, then RAM, then name. The list has no pages. ListMachineSizes gives the users the same list without the retired sizes, and without the pools and the labels.

Item Value
Procedure /hopbox.admin.v1.SizeService/ListSizes
Policy action size.list: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action size.list, no target

The request ListSizesRequest has the field include_retired, a bool. With true, the list also holds the retired sizes. The response ListSizesResponse has the field sizes, a list of Size.

Stops new machines of a size. A create with the size fails from then on (the machine API). A create takes a share lock on the row of its size, so the retirement waits for each create that read the size before it, and a create that starts during the retirement waits and then fails. The machines of the size keep running, and keep their size. A retirement of a retired size changes nothing, and its row version stays.

Item Value
Procedure /hopbox.admin.v1.SizeService/RetireSize
Policy action size.retire: local_root, admin_key, and an admin session
Idempotent option no. A second call changes nothing.
Audit entry action size.retire, target kind size, target ID the name of the size, detail already: true for a size that was retired already

The request RetireSizeRequest has the field name, the name of the size. The response RetireSizeResponse has the field size, the Size after the change.

Error Cause
invalid_argument with invalid argument: invalid size: ... CreateSize with numbers out of bounds. The rest of the message names the field and the bound.
invalid_argument with invalid argument: invalid name: the size name ... or invalid argument: invalid name: the pool name ... CreateSize with a name that is not a lowercase DNS label.
invalid_argument with invalid argument: invalid label: ... CreateSize with a label that breaks a rule.
invalid_argument with idempotency: invalid key: this method needs an Idempotency-Key header CreateSize without an idempotency key.
not_found with not found: no pool is named "<pool>" CreateSize with a pool that no live pool has.
already_exists with already exists: a size is named "<name>" already. A retired size keeps its name, so pick a new name CreateSize with the name of a size, also of a retired one.
not_found with not found: no size is named "<name>" GetSize or RetireSize of an unknown name.
failed_precondition with failed precondition: the size default stays, because a create without a size takes it RetireSize of the size default.
failed_precondition with failed precondition: the size tiny stays, because a create without a size in the personal org of a limited account takes it RetireSize of the size tiny.

Example:

sudo curl -s --unix-socket /run/hopbox/admin.sock \
-H 'Content-Type: application/json' -H "Idempotency-Key: $(uuidgen)" \
-d '{"name":"large","vcpus":8,"memoryBytes":"34359738368","diskBytes":"200000000000","pool":"big","labels":{"disk":"nvme"}}' \
http://hopboxd/hopbox.admin.v1.SizeService/CreateSize

hopbox.admin.v1.OrgService lets instance admins see the metadata of every org, suspend an org, and set the usage limits of orgs. It shows no member and no resource of an org. The org API covers the calls of the members of an org. Each call that acts on one org writes its audit entry with that org, so the owners of the org see it.

The message Org holds the metadata of one org:

Field Type Description
id string The UUID of the org.
name string The name of the org.
personal_account_id string The UUID of the account of a personal org, or empty for another org.
tier AccountTier The tier of the account of a personal org, and ACCOUNT_TIER_FULL for another org. The default limits of the org follow it.
member_count int64 The number of members.
suspended bool true while the org is suspended.
suspend_time google.protobuf.Timestamp The start of the suspension. Unset for an org that is not suspended.
suspend_reason string The reason of the suspension, or empty.
limits OrgLimits The limits that apply: each override, else the default of the install for the tier of the org.
limit_overrides OrgLimitOverrides The limits of this org that replace the defaults.
usage OrgUsage What the org uses now.
version int64 The version of the org (the org API).
create_time google.protobuf.Timestamp The creation time of the org.

OrgLimits and OrgUsage have the fields machines (int32), vcpus (int32), memory_bytes (int64), disk_bytes (int64), stored_state_bytes (int64), snapshots (int32), and backup_bytes (int64), as in the org API. OrgLimits also has saved_bytes_per_day (int64), the daily budget of saves, and the bools public_urls and outbound_smtp. OrgUsage also has saved_bytes_last_day (int64), the bytes of the saves of the last 24 hours. OrgLimitOverrides has the fields of OrgLimits, each one optional. A field that is not set takes the default of the install for the tier of the org. A limit of 0 allows nothing.

OrgLimits field Description
public_urls true when a creator can make a machine URL of the org public (the edge role). The default is true for an org, and false for the personal org of a limited account.
outbound_smtp true when the machines of the org reach TCP port 25 (the node network). No default opens it. Only the override of one org does. Each machine takes a change at its next start or reboot.
stored_state_bytes The most stored state that the nodes keep for the org, in bytes: memory files of hibernated machines, checkpoints, and snapshots. A hibernate never checks it. The default is 100 GiB, and 0 for the personal org of a limited account.
snapshots The most snapshots of the org. The default is 10, and 0 for the personal org of a limited account.
backup_bytes The most bytes of the backups of the org in object storage. The default is 100 GiB, and 0 for the personal org of a limited account.
saved_bytes_per_day The most bytes that the saves of the org write in 24 hours. A hibernate above it fails with resource_exhausted, and the machine runs on (Domain rules). The default is 1 TiB, and 20 GiB for the personal org of a limited account.

Lists every org of the install, oldest first, one page at a time.

Item Value
Procedure /hopbox.admin.v1.OrgService/ListOrgs
Policy action org.list_all: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action org.list_all, no org, no target
Field Type Default Description
page_size int32 100 The most orgs in one response, 1 to 1000.
page_token string empty The next_page_token of the response before. Leave it empty for the first page.

The response ListOrgsResponse has the fields orgs, a repeated Org, and next_page_token. The token is empty on the last page. A page size out of range, or a page token that does not decode, gets invalid_argument.

Suspends an org, for example to handle abuse (the org API). A suspended org stays as it is, with its first reason, and the call succeeds again without a change. One exception: on an org that the suspend of an account suspended (SuspendAccount), the call takes over that suspension. It keeps the reason of the account, and clears suspended_with_account. So UnsuspendAccount of that account then leaves the org suspended.

Item Value
Procedure /hopbox.admin.v1.OrgService/SuspendOrg
Policy action org.suspend: local_root, admin_key, and an admin session
Idempotent option no. A second call changes nothing.
Audit entry action org.suspend, org the org, target kind org, details reason and already. The reason is that of the suspension. already is true for an org that was suspended already. A take-over of the suspension of an account adds the details taken_from_account, the ID of that account, and requested_reason, the reason of the request, which the org does not take.
Field Type Description
org_id string The UUID of the org.
reason string The reason, which the members of the org see. At most 256 characters, without control characters. The server drops the spaces around it.

The call stops the resources of the org in its transaction, through OrgSuspending (the org API). It sets the target stopped on each machine of the org, except a hibernated one. A machine with the target running and a memory file gets the target hibernated back, so its wake ends (Domain rules). Each machine that it stops gets an entry machine.stop with the detail reason (org suspended). Each wake that it ends gets an entry machine.hibernate with the details reason and wake (canceled). The response SuspendOrgResponse has the field org, the Org after the change.

Error Code
org_id is not a UUID, or the reason breaks a rule invalid_argument
No org has the ID: not found: no org has the ID <id> not_found

Ends the suspension of an org. Its machines stay stopped until their users start them. An org that is not suspended stays as it is, and the call succeeds. The call also works on an org that the suspend of an account suspended. It then clears suspended_with_account (Control store tables). So a later suspend of the org stays after UnsuspendAccount of that account.

Item Value
Procedure /hopbox.admin.v1.OrgService/UnsuspendOrg
Policy action org.unsuspend: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action org.unsuspend, org the org, target kind org, details old_reason and already (true for an org that was not suspended)

The request UnsuspendOrgRequest has the field org_id. The response UnsuspendOrgResponse has the field org. The errors are those of SuspendOrg.

Replaces the limit overrides of one org. A limit that the request leaves out takes the default of the install for the tier of the org. So a request without overrides puts the org back on the defaults. A new limit below the usage of the org stops nothing. The org then creates and starts no more machines until its usage fits. Likewise, public_urls set to false keeps each URL that is public already. It refuses only a new public URL. outbound_smtp takes effect at the next start or reboot of each machine of the org. A machine that runs keeps the port of its boot (the node network).

Item Value
Procedure /hopbox.admin.v1.OrgService/SetOrgLimits
Policy action org.set_limits: local_root, admin_key, and an admin session
Idempotent option no. A second call sets the same overrides again.
Audit entry action org.set_limits, org the org, target kind org. The details are machines, vcpus, memory_bytes, disk_bytes, stored_state_bytes, snapshots, backup_bytes, saved_bytes_per_day, public_urls, and outbound_smtp, then the same keys with the prefix old_. Each value is a number, true, false, or default for a limit without an override.
Field Type Description
org_id string The UUID of the org.
limit_overrides OrgLimitOverrides The new overrides. Each field is 0 or more.
expected_version optional int64 The version of the org that the caller read. If the org has another version now, the call fails with aborted and changes nothing.

The response SetOrgLimitsResponse has the field org. A limit below 0 gets invalid_argument, for example invalid argument: invalid limit: the vCPU limit -1 is below 0. The limits of saved state name themselves as the stored state limit, the snapshot limit, the backup limit, and the daily save budget. An unknown org gets not_found. A new daily budget below the saves of the last 24 hours stops nothing. The org then hibernates no machine until its saves fit.

Returns the limits of every org without an override. They live in the row of install_config (Control store tables).

Item Value
Procedure /hopbox.admin.v1.OrgService/GetDefaultOrgLimits
Policy action org_limits.get_defaults: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action org_limits.get_defaults, no target

The request GetDefaultOrgLimitsRequest has no fields. The response GetDefaultOrgLimitsResponse has the field defaults, a DefaultOrgLimits:

Field Type Description
limits OrgLimits The default limits of each org, apart from the personal org of a limited account. A fresh install has 3 machines, 6 vCPUs, 24 GiB of RAM, 300 GB of disk, 100 GiB of stored state, 10 snapshots, 100 GiB of backups, 1 TiB of saves a day, and public_urls true.
limited_limits OrgLimits The default limits of the personal org of a limited account. A fresh install has 1 machine, 1 vCPU, 1 GiB of RAM, 5 GB of disk, 0 for stored state, snapshots, and backups, 20 GiB of saves a day, and public_urls false.
max_orgs_per_account int32 The most orgs that a full account owns besides its personal org (the org API). A limited account owns none. The default is 3 on a fresh install. Migration 0063 keeps the value of an install that has accounts, which is 10 from before.
version int64 The version of the whole install config (GetInstallConfig).
update_time google.protobuf.Timestamp The time of the last change of the install config.

Changes the limits of every org without an override, and returns them. A limit that the request leaves out keeps its value. A change adds 1 to the version of the install config.

Item Value
Procedure /hopbox.admin.v1.OrgService/SetDefaultOrgLimits
Policy action org_limits.set_defaults: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action org_limits.set_defaults, no target. The details are the new limits and the old ones, as for SetOrgLimits without outbound_smtp, with max_orgs_per_account and old_max_orgs_per_account. The limits of the personal org of a limited account follow, with the prefixes limited_ and old_limited_.
Field Type Description
machines optional int32 The most machines of an org, 0 or more.
vcpus optional int32 The most vCPUs of an org, 0 or more.
memory_bytes optional int64 The most RAM of an org, in bytes, 0 or more.
disk_bytes optional int64 The most disk of an org, in bytes, 0 or more.
stored_state_bytes optional int64 The most stored state of an org, in bytes, 0 or more.
snapshots optional int32 The most snapshots of an org, 0 or more.
backup_bytes optional int64 The most bytes of the backups of an org, 0 or more.
saved_bytes_per_day optional int64 The most bytes that the saves of an org write in 24 hours, 0 or more.
max_orgs_per_account optional int32 The most orgs that a full account owns besides its personal org, 0 or more. A lower value deletes no org. It only refuses new orgs above it.
public_urls optional bool Whether an org can make a machine URL public.
limited OrgLimitOverrides The limits of the personal org of a limited account to change. A field that it leaves out keeps its value. Its outbound_smtp must stay unset.
expected_version optional int64 The version of the install config that the caller read. If the install config has another version now, the call fails with aborted and changes nothing.

A request that sets no limit gets invalid_argument with the message invalid argument: the update sets no limit. A request with limited.outbound_smtp gets invalid_argument with the message invalid argument: no default opens outbound TCP port 25. Open it for one org with SetOrgLimits. The response SetDefaultOrgLimitsResponse has the field defaults.

$ sudo hopboxd admin org default-limits set --machines 5 --limited-disk-gb 10
machines 5
vcpus 6
memory_bytes 25769803776
disk_bytes 300000000000
stored_state_bytes 107374182400
snapshots 10
backup_bytes 107374182400
saved_bytes_per_day 1099511627776
public_urls true
limited_machines 1
limited_vcpus 1
limited_memory_bytes 1073741824
limited_disk_bytes 10000000000
limited_stored_state_bytes 0
limited_snapshots 0
limited_backup_bytes 0
limited_saved_bytes_per_day 21474836480
limited_public_urls false
max_orgs_per_account 3
version 4
update_time 2026-10-16T15:50:02Z

hopbox.admin.v1.MachineService lets instance admins see the machines of every org, and stop, delete, or move any of them. This also works in a suspended org, for example to handle abuse. It never opens a shell in a machine and never reads its secrets. The machine API covers the calls of the members of an org.

The message Machine of this service is a machine with the facts that only instance admins see:

Field Type Description
machine hopbox.v1.Machine The machine as its users see it (the machine API), but without its start_command, which is always empty here. A start command can hold data of the org, and an instance admin sees the metadata of an org, not its contents.
server_id string The UUID of the node of the machine.
address string The IPv4 address of the machine on the network of its node, such as 10.240.0.2 (the node network). Only ListMachines fills it. It is empty in the responses of StopMachine and DeleteMachine.

A call on one machine names it with id or name, as in the public API (the machine API). The admin calls skip the role check and the suspension check of the public API.

Lists the machines of every org, or of one org, one page at a time, in the order of their IDs. A machine whose current state is deleted is not in the list. The list holds metadata only. A machine of a deleted org stays in the list of every org until its executor deleted it. Its org_id is then empty.

Item Value
Procedure /hopbox.admin.v1.MachineService/ListMachines
Policy action machine.list_all: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action machine.list_all, no target. With org_id, the entry has that org and the detail org_id. Without it, the entry has no org.
Field Type Default Description
org_id optional string none Lists only the machines of this org.
page_size int32 100 The most machines in one response, 1 to 1000.
page_token string empty The next_page_token of the response before. Leave it empty for the first page.

The response ListMachinesResponse has the fields machines, a repeated Machine of this service, and next_page_token. The token is empty on the last page. A page size out of range, a page token that does not decode, or an org_id that is not a UUID gets invalid_argument. An org_id that names no org gets an empty list.

Sets the target of any machine to stopped, and waits for it for up to 60 s. It works as StopMachine of the public API (the machine API), also in a suspended org. A hibernated machine refuses the stop with failed_precondition and the message failed precondition: machine action not allowed: cannot stop a hibernated machine: wake it first. During a pending wake, the message is failed precondition: machine action not allowed: cannot stop a machine that is hibernated: wait for the end of its wake. After a failed wake, drop the file with DiscardMemory (Q206).

Item Value
Procedure /hopbox.admin.v1.MachineService/StopMachine
Policy action machine.admin_stop: local_root, admin_key, and an admin session
Idempotent option no. A second call finds the target stopped, and changes nothing.
Audit entry action machine.admin_stop, org the org of the machine, target kind machine, details name and old_target

The request StopMachineRequest names the machine. The response StopMachineResponse has the fields machine (a Machine of this service), duration, and done, as in the machine API. The call gets the default deadline of 61 s, and waits as the public call does (the machine API).

Sets the target of any machine to deleted, and waits for it for up to 60 s. It works as DeleteMachine of the public API (the machine API), also in a suspended org. The name and the SSH port of the machine stay reserved for its org for 7 days.

Item Value
Procedure /hopbox.admin.v1.MachineService/DeleteMachine
Policy action machine.admin_delete: local_root, admin_key, and an admin session
Idempotent option no. A second call fails with failed_precondition.
Audit entry action machine.admin_delete, org the org of the machine, target kind machine, details name

The request DeleteMachineRequest names the machine. The response DeleteMachineResponse has the fields machine, duration, and done. A machine whose target is deleted already gets failed_precondition with the message failed precondition: machine action not allowed: cannot delete a machine that is being deleted.

$ sudo hopboxd admin machine stop --name box1
id 01a1460c-1f6e-7b8a-9c42-3d5e7f8a9b10
name box1
state pending
target_state stopped
duration 39.001s
done false

Moves any machine cold to another node (Cold move). The node of the machine stops it. The other node then pulls its disk, and boots it if its target is running. The machine keeps its name, its URL, its SSH port, and its address. The call returns at once, with the move in the state stopping. ListMoves follows the move. A move works in a suspended org too.

Item Value
Procedure /hopbox.admin.v1.MachineService/MoveMachine
Policy action machine.move: local_root and admin_key
Idempotent option yes. The call needs an Idempotency-Key header. A retry with the same key returns the first move, and starts no second move. A second call with a new key fails with failed_precondition while the first move runs.
Audit entry action machine.move, org the org of the machine, target kind machine, details name, move, source, target, and old_target. The end of the move writes a second entry with the actor system and the details move and result, and error for a failure.
Field Type Default Description
id, name string Name the machine.
target_server_id string empty The UUID of the node to move the machine to. Empty lets placement pick a node.

The response MoveMachineResponse has the field move, a Move. Cold move lists the refusals. A machine that cannot move, such as a hibernated one, gets failed_precondition. A named node that is the node of the machine, or a target_server_id that is not a UUID, gets invalid_argument. An unknown named node gets not_found. When no node takes the machine, the call fails with unavailable and the message of Placement. While a live control process runs a hopboxd that does not know the moves, the call fails with failed_precondition (Cold move).

Ends the cold move of a machine that runs (Cold move). The move ends in the state failed, with the error an instance admin canceled the move. A machine in stopping gets its own target back on its node. A machine in pulling goes back to its source node with its disk, stopped, and the target node removes what it pulled. A machine that is no longer in moving on the target node stays there (Cold move).

With give_back, the call also asks the target node to give such a machine back to its source node, also after its move failed (plan question Q102, Cold move). The target node answers through its control channel. It gives the machine back only when it never proved the pull of the move. Otherwise it keeps the machine, and the source removes its copy. The call returns at once with give_back MOVE_GIVE_BACK_REQUESTED. Read the answer in give_back of the move with ListMoves. A give_back on a move whose machine stays on its source, or goes back there, only cancels the move.

Item Value
Procedure /hopbox.admin.v1.MachineService/CancelMove
Policy action machine.cancel_move: local_root and admin_key
Idempotent option no. A second call fails with failed_precondition, because the move no longer runs. A second call with give_back asks again while the give-back waits for its answer.
Audit entry action machine.cancel_move, org the org of the machine, target kind machine, details name, move, and state, the state of the move before the cancel, and give_back requested for a give-back. A move in pulling also gets the entry machine.move of a failed move, with the actor system. The answer of the target writes the entry machine.move with the actor system and give_back done or kept.
Field Type Default Description
id, name string Name the machine.
give_back bool false Also ask the target node to give back a machine that the move left there while the source keeps a copy of its disk.
withdraw_give_back bool false Take back a give-back that waits for the answer of the target node, in place of a cancel. The move gets back its state from before the request, without give_back and without its note. A machine without such a give-back gets failed_precondition with the machine has no give-back that waits for an answer. With give_back too, the call fails with invalid_argument. The audit entry is machine.cancel_move with give_back withdrawn.

The response CancelMoveResponse has the field move, a Move. A machine without a move that runs gets failed_precondition with the message the machine has no move that runs. With give_back, the message is the machine has no move that runs, and no failed move left it on its node while another node keeps a copy of its disk. A give-back also refuses with failed_precondition when the target node reports no feature give-back, or while a live control process runs a release of the schema version below 59 (Cold move).

Lists the cold moves of one machine, or of every machine, newest first, one page at a time.

Item Value
Procedure /hopbox.admin.v1.MachineService/ListMoves
Policy action machine.list_moves: local_root and admin_key
Idempotent option yes
Audit entry action machine.list_moves, no target. With machine_id, the entry has the detail machine_id.
Field Type Default Description
machine_id optional string none Lists only the moves of this machine.
page_size int32 100 The most moves in one response, 1 to 1000.
page_token string empty The next_page_token of the response before. Leave it empty for the first page.

The response ListMovesResponse has the fields moves, a repeated Move, and next_page_token. The token is empty on the last page. A page size out of range, a page token that does not decode, or a machine_id that is not a UUID gets invalid_argument.

Field Type Description
id string The UUID of the move.
machine_id string The UUID of the machine.
source_server_id string The UUID of the node that the machine leaves.
target_server_id string The UUID of the node that the machine moves to.
state MoveState The state of the move.
target_state hopbox.v1.MachineState The target state of the machine before the move. The machine keeps it on the target node.
error string Why the move failed.
cleanup_server_id string The UUID of the node that still holds an old copy of the files of the machine: the source after a move that is done, the target after a move that failed. Empty once that node removed them.
create_time Timestamp When the move started.
update_time Timestamp When the move changed last.
give_back MoveGiveBack The give-back that an instance admin asked for, with the answer of the target node.
give_back_note string Why the target node withholds its answer to a give-back that waits, such as a disk file on the target without the proof of the pull (Cold move). Empty otherwise.
MoveGiveBack Meaning
MOVE_GIVE_BACK_UNSPECIFIED No give-back was asked for.
MOVE_GIVE_BACK_REQUESTED The target node did not answer yet.
MOVE_GIVE_BACK_DONE The target node never proved the pull, and the machine went back to its source node, stopped. The target removes what it pulled.
MOVE_GIVE_BACK_KEPT The target node holds the whole disk of the move, so it keeps the machine. The source removes its copy.
MoveState Meaning
MOVE_STATE_STOPPING The source node stops the machine.
MOVE_STATE_PULLING The machine is on the target node, which pulls its disk.
MOVE_STATE_DONE The target node has the disk.
MOVE_STATE_FAILED The move failed, passed its pull deadline, or an instance admin canceled it. The machine and its disk stay on the source node.
$ sudo hopboxd admin machine move --name box1
id 01a1460c-2a7b-7c11-8d23-4e5f6a7b8c9d
machine_id 01a1460c-1f6e-7b8a-9c42-3d5e7f8a9b10
source_server_id 01a14600-0a1b-7c2d-8e3f-405162738495
target_server_id 01a14600-1b2c-7d3e-8f40-516273849506
state stopping

hopbox.admin.v1.DiskService lets instance admins see the extra disks of every org, and delete a detached one, also in a suspended org (Extra disks). An example is a disk that strands the drain of a node. It never reads the data of a disk. Q224 of the phase 3 plan gives these calls.

The message Disk of this service has two fields. disk is the hopbox.v1.Disk as its users see it (Extra disks). server_id is the UUID of the node of the disk.

Lists the disks of every org, or of one node, one page at a time, in the order of their IDs. The list holds metadata only.

Item Value
Procedure /hopbox.admin.v1.DiskService/ListDisks
Policy action disk.list_all: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action disk.list_all, no target. With server_id, the entry has the detail server.
Field Type Default Description
server_id optional string none Lists only the disks of this node.
page_size int32 1000 The most disks in one response, 1 to 1000. A value out of range takes 1000.
page_token string empty The next_page_token of the response before. Leave it empty for the first page.

The response ListDisksResponse has the fields disks, a repeated Disk of this service, and next_page_token. The token is empty on the last page.

Deletes any detached disk with its data, as DeleteDisk of the public API does (Extra disks), also in a suspended org. Its node then removes the file. An attached disk fails with failed_precondition: detach it first, or delete its machine.

Item Value
Procedure /hopbox.admin.v1.DiskService/DeleteDisk
Policy action disk.admin_delete: local_root, admin_key, and an admin session
Idempotent option no. A second call gets not_found.
Audit entry action disk.admin_delete, org the org of the disk, target kind disk, details name

The request DeleteDiskRequest has the field id, the UUID of the disk. The response DeleteDiskResponse is empty.

hopbox.admin.v1.ImageService manages the images that new machines start from: the metadata of image artifacts (Artifact format). The images live in the table images (Control store tables). A create takes the newest image of the name that it asks for, default by default (the machine API). The service holds only the metadata. The URL of an image tells the nodes where to download the compressed disk. An empty URL serves a node that has the image in its cache already.

The message Image holds one image:

Field Type Description
id string The UUID of the image.
name string The name of the image, for example default.
digest string sha256: and the sha256 of the bytes of the artifact.json of the image, in hex.
arch string The CPU architecture of the image, x86_64.
kernel_sha256 string The sha256 of the guest kernel that the image needs, in hex.
disk_size int64 The size of the disk of the image, in bytes.
disk_sha256 string The sha256 of the disk of the image, in hex.
url string The https URL from which nodes download the compressed disk, or empty.
build_time google.protobuf.Timestamp The time of the build: created_at of artifact.json.
register_time google.protobuf.Timestamp The time of the registration.

Adds an image from the bytes of its artifact.json. The newest image of a name is the one that new machines of that name take. The control role also registers the default image of its release at each start (hopboxd). The same bytes a second time change nothing, and return the image that exists. A call to this method records no release on the image, so the control role never skips because of it (hopboxd). The control role registers the default image of its release with the release of its hopboxd, and skips it when the install has an image of the same name from a newer release. Two registrations of the same bytes at the same time also give one image: the second one gets registered false.

Item Value
Procedure /hopbox.admin.v1.ImageService/RegisterImage
Policy action image.register: local_root and admin_key
Idempotent option no. A second call with the same bytes changes nothing.
Audit entry action image.register, no org, target kind image, target ID the image ID. The details are name, digest, and already: true for an image that the install had already.
Field Type Description
metadata bytes The bytes of the artifact.json of the image, unchanged. Their sha256 is the digest, so a reformat makes another image.
url string An https URL of the compressed disk, or empty.

The call reads metadata with the rules of internal/artifact (Artifact format). Format version 1 knows only the kind image. The response RegisterImageResponse has these fields:

Field Type Description
image Image The image.
registered bool true for a new image. false for an image that the install had already. A second call with another url keeps the first URL.
Error Code
metadata breaks a rule of the artifact format, for example invalid argument: invalid artifact metadata: kind "snapshot", want "image" invalid_argument
metadata has a format_version other than 1: invalid argument: unsupported artifact format version ... invalid_argument
url is not an https URL with a host: invalid argument: the image URL "<url>" is not an https URL invalid_argument
$ sudo hopboxd admin image register bin/image/artifact.json --url https://dl.example.org/images/default/disk.raw.zst
id 01a1460a-7c21-7d4e-8f90-1a2b3c4d5e6f
name default
digest sha256:422d31d7a4fd5e6958162b22e3d772f71b5a1465cbd6255d253ae8c087873dc8
registered true

Lists the images of the install, by name, newest first.

Item Value
Procedure /hopbox.admin.v1.ImageService/ListImages
Policy action image.list: local_root, admin_key, and an admin session
Idempotent option no
Audit entry action image.list, no target

The request ListImagesRequest has no fields. The response ListImagesResponse has the field images, a repeated Image. The list has no pages.