Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

Self-host Sigillo on your own Cloudflare account

Run Sigillo on your own Cloudflare account with a single command. No git clone, no build step, no wrangler config:
npx @kldzj/sigillo self-host
The command provisions two Workers and their D1 databases on your account: the Sigillo app and its own login provider. It applies the database migrations, uploads the release, and prints your instance URL. It depends on no one else's servers.

What you need

  • A Cloudflare account. The free plan works, with a dashboard page failing now and then; Workers Paid, $5 a month, avoids that (see below). One that holds nothing but Sigillo is best: see the hardening checklist.
  • Node.js, to run npx.
  • A Google Cloud project, where you create the OAuth client people sign in with. The command tells you what to enter.

The free plan

The free plan allows 10 ms of CPU per request. A page of the dashboard often takes 10 to 40 ms: Cloudflare lets that through most of the time, but stops a Worker that keeps going over the limit with error 1102, Worker exceeded resource limits. So on the free plan, expect a dashboard page to fail now and then; loading it again usually works. Workers Paid, $5 a month per account, allows 30 seconds, and its included requests and CPU time are far more than an instance uses. D1 is billed separately, and an instance stays within its included amounts.

What the command does

npx @kldzj/sigillo self-host │ ├──> 1. Unlock ~/.sigillo/selfhost.json with your passphrase ├──> 2. Log in to Cloudflare (reuses wrangler login when present) ├──> 3. Download this version's release bundle from github.com/kldzj/sigillo, and check its SHA-256 ├──> 4. Create the app's D1 database and apply its migrations ├──> 5. Deploy the login provider (<name>-auth): D1, migrations, Worker ├──> 6. Deploy the app (<name>): Worker, static assets ├──> 7. Enable both workers.dev URLs └──> 8. Optionally attach a custom domain to the app
The first run asks for a passphrase. It encrypts ~/.sigillo/selfhost.json, the file where the command keeps your deployment's keys: keep the passphrase in your password manager, and see your deploy file for what's in it.

Google sign-in

People sign in with Google through your login provider. A new deployment needs a Google OAuth client for it, and the command shows you exactly what to register:
  1. Open Google Cloud credentials and choose Create credentials → OAuth client ID → Web application.
  2. Add the redirect URI the command prints, for example https://sigillo-auth.<your-subdomain>.workers.dev/api/auth/callback/google.
  3. Paste the client ID and secret when the command asks for them, or pass --google-client-id and --google-client-secret.
The first time someone signs in to your instance, the login provider asks them to allow it once.

Cloudflare credentials

The command finds credentials in this order:
  1. CLOUDFLARE_API_TOKEN environment variable (or --api-token)
  2. A login saved by a previous self-host run
  3. Your existing wrangler login (refreshed automatically if expired)
  4. Interactive: an OAuth browser login, or a pre-filled API token creation link you can open from any device
Deploying over SSH? Pick the API token option: the pre-filled link opens on your phone or laptop and you paste the token back into the terminal.

Who can sign in

By default, anyone who can sign in with Google gets an account. To let in only certain people, pass a comma-separated list of email addresses and domains:
npx @kldzj/sigillo self-host --allowed-users acme.com,ops@partner.io
A new deployment run in a terminal asks for the list. With --yes or without a terminal, pass --allowed-users, or anyone with a Google account can sign in. Only verified emails match: an address matches itself, a domain matches exactly that domain, not its subdomains. Nobody else can sign up or sign in, in the browser or with the CLI, and a signed-in user taken off the list is signed out on their next request. The app and its login provider both check it.
Updates keep the list saved in ~/.sigillo/selfhost.json. Pass --allowed-users again to change it, or --allowed-users '' to let anyone in.

A custom domain

To serve the app from your own domain, pass it, or pick it when the command asks:
npx @kldzj/sigillo self-host --domain secrets.acme.com
The domain's zone must be on the same Cloudflare account. Both Workers keep their workers.dev URLs too: self-host uses them, and the login provider only has that one. --skip-domain skips the question.

Without a terminal

For CI or agents, pass everything the command would ask for:
CLOUDFLARE_API_TOKEN=xxx SIGILLO_SELFHOST_PASSPHRASE=xxx npx @kldzj/sigillo self-host --yes \ --google-client-id xxx.apps.googleusercontent.com --google-client-secret xxx \ --allowed-users acme.com

All options

OptionDescription
--name <name>Worker name (default: sigillo); the login provider is <name>-auth
--account <id>Cloudflare account id (skips the account prompt)
--api-token <token>Cloudflare API token
--google-client-id <id>Google OAuth client ID for a new login provider
--google-client-secret <secret>Google OAuth client secret for a new login provider
--allowed-users <list>Email addresses and domains that may sign in, comma-separated; '' lets anyone in
--domain <hostname>Attach a custom domain to the app (the zone must be on your account)
--skip-domainSkip the custom domain prompt
--bundle <path>Deploy a local copy of this version's bundle, checked like a download
--release-url <url>Download this version's bundle from a custom URL, checked like a download
--allow-downgradeDeploy even if the instance runs a newer version
--change-passphraseEncrypt ~/.sigillo/selfhost.json with a new passphrase, then stop. See your deploy file
--reset-passkeys <email>Remove every passkey of this user and sign them out, for a sole admin who lost theirs, then stop. See Lost every passkey
--rotate-keyGive the instance a new encryption key, re-encrypt every stored value with it and retire the old key, then stop. See Rotate the encryption key
--backup [file]Save an encrypted backup of both databases, then stop. See Back up and restore
--restore <file>Restore both databases from a backup into new ones, check their history and switch the workers to them
--yesAccept all defaults, non-interactive

Next steps