Skip to main content

chainmail bootstrap

Set up chainmail on this machine: a daemon that runs as its own user, with its config, vault key and service, and one account whose credentials are stored and tested.

Run it as the user who will use chainmail, never as root. It prints its plan, asks for the account's app password or OAuth client secret and for confirmation, then asks for sudo once. A rerun adds another account or repairs the install, and changes only what differs.

On NixOS it writes Nix files for your configuration to import instead, with the vault key sealed by systemd-creds, and never edits the configuration or rebuilds. Run it again after the rebuild to store the credentials and test the account.

Usage​

chainmail bootstrap <email> [flags]

Examples​

chainmail bootstrap [email protected]
# Google Workspace signs in through the browser with your OAuth client
chainmail bootstrap [email protected] --oauth-client-id 1234.apps.googleusercontent.com
# see what it would change, without changing anything
chainmail bootstrap [email protected] --provider hostinger --dry-run
# no terminal: the password comes from stdin
pass show mail/work | head -n1 | chainmail bootstrap [email protected] --yes --output json

Flags​

--dry-run print the plan and change nothing
--from-pass string read the password or client secret from this pass entry (first line)
--key-backup string vault key backup when a new key is made: none, or show to print it once on the terminal (default "none")
--name string account name (default: the address's local part)
--nix-dir string directory for the Nix files bootstrap writes on NixOS (default ./chainmail-nixos)
--oauth-client string name of the OAuth client table (default google)
--oauth-client-id string OAuth client ID, needed by google-workspace
--provider string provider preset, one of gmail, google-workspace, hostinger, icloud (default: detected from the address)
--yes skip the confirmation and the questions that have defaults

Global flags​

--output string output format: json or table (default $CHAINMAIL_OUTPUT, then cli.toml, then table on a terminal, json otherwise)
--socket string daemon socket (default $CHAINMAIL_SOCKET, then cli.toml, then /run/chainmail/chainmail.sock)

See also​