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

Rotating the secret key

Rotate the key if it might have leaked, or on a schedule if you prefer.
  1. Generate a new key
    qubit-server gen-secret
  2. Deploy with both keys
    Set QUBIT_SECRET_KEY=<new> and QUBIT_SECRET_KEY_PREVIOUS=<old>. The server reads data sealed under either key, and logs a warning until the rotation is done.
  3. Re-encrypt
    Run the rotation once, with the same environment:
    docker run --rm -v qubit-data:/data \ -e QUBIT_SECRET_KEY=<new> -e QUBIT_SECRET_KEY_PREVIOUS=<old> \ ghcr.io/loopyreviews/qubit-server:<tag> rotate-secret-key
    It re-encrypts every organization's CA key, pending invite, TOTP secret and saved email setting under the new key in one transaction, and prints how many of each. If anything can't be decrypted with the configured keys, it changes nothing and exits with an error.
    With SQLite, run it while the server is stopped or quiet; it takes the write lock briefly.
  4. Drop the old key
    Remove QUBIT_SECRET_KEY_PREVIOUS, restart, and destroy the old key.
Rotating QUBIT_SECRET_KEY changes how the SSH CA keys are stored, not the CA keys themselves. If you think a CA private key leaked, remove that CA from your hosts' TrustedUserCAKeys.