The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
docs: explain encrypted keyring rollout for headless hosts
Steven Enamakelc47525466f40
diff --git a/.env.example b/.env.exampleindex 091caf89d2..da8c0fd733 100644--- a/.env.example+++ b/.env.example@@ -91,10 +91,11 @@ OPENHUMAN_MODEL=# [optional] Workspace directory (default: ~/.openhuman or ~/.openhuman-staging when OPENHUMAN_APP_ENV=staging)# Leave commented out to use the default. Setting to empty string is treated as unset.# OPENHUMAN_WORKSPACE=-# [optional] Master key for the `encrypted_file` keyring used in staging/production,-# as 64 hex characters (`openssl rand -hex 32`). Headless/container deploys have no-# OS keychain to hold it; set exactly one of these two, injected from your secret-# manager. Losing the key orphans every secret encrypted under it.+# [required without an OS keychain] Master key for the `encrypted_file` keyring,+# which is the default unless OPENHUMAN_APP_ENV=dev/development or an explicit+# backend override is set. Use 64 hex characters (`openssl rand -hex 32`).+# Headless/container deploys should set exactly one of these two through a+# secret manager. Losing the key orphans every secret encrypted under it.# OPENHUMAN_KEYRING_MASTER_KEY=# OPENHUMAN_KEYRING_MASTER_KEY_FILE=/run/secrets/openhuman_master_key# [optional] Default: 0.7diff --git a/docs/gitbooks/en/features/cloud-deploy.md b/docs/gitbooks/en/features/cloud-deploy.mdindex 9a6ec34ffc..0c7c6b9dce 100644--- a/docs/gitbooks/en/features/cloud-deploy.md+++ b/docs/gitbooks/en/features/cloud-deploy.md@@ -101,8 +101,8 @@ The desktop app's first-run picker and **Settings > Core connection** both have| `OPENHUMAN_CORE_TOKEN` | yes | Bearer token clients send to `/rpc`. Generate with `openssl rand -hex 32`. **Anyone with this token can drive the core.** || `BACKEND_URL` | yes | Tinyhumans backend the core talks to (`https://api.tinyhumans.ai` for prod). || `OPENHUMAN_APP_ENV` | no | `production` or `staging`. Defaults to `production`. |-| `OPENHUMAN_KEYRING_MASTER_KEY` | no | 64 hex characters (`openssl rand -hex 32`). Master key for the staging/production `encrypted_file` keyring, so a container with no OS keychain can store provider keys encrypted. Inject it from your secret manager like the bearer token; **losing it orphans every stored secret.** |-| `OPENHUMAN_KEYRING_MASTER_KEY_FILE` | no | Path to a file holding the same value, for Docker/Kubernetes secret mounts. Set one of the two, not both. Without either, `encrypted_file` needs an OS keychain. |+| `OPENHUMAN_KEYRING_MASTER_KEY` | yes, if no OS keychain | 64 hex characters (`openssl rand -hex 32`). The `encrypted_file` keyring is now the default even when `OPENHUMAN_APP_ENV` is unset. Inject the key from your secret manager; **losing it orphans every stored secret.** |+| `OPENHUMAN_KEYRING_MASTER_KEY_FILE` | alternative | Path to a file holding the same value, for Docker/Kubernetes secret mounts. Set one of the two, not both. Without either, `encrypted_file` needs an OS keychain. || `OPENHUMAN_CORE_HOST` | no | Defaults to `0.0.0.0` in the container. || `OPENHUMAN_CORE_PORT` | no | Defaults to `7788`. || `RUST_LOG` | no | `info` is fine; `debug` for triage. |@@ -447,7 +447,7 @@ Custom cloud providers (`inference_url` and `api_key`, or an entry in `cloud_pro### Secret storage in containers-In `production` and `staging`, the keyring backend is `encrypted_file`, and its master key is loaded from the OS keychain. A container has no keychain, so the first write that stores a provider key fails with `Failed to encrypt api_key` (`[keyring] set error ... master key unavailable`). Supply the master key from the environment instead: `OPENHUMAN_KEYRING_MASTER_KEY` (64 hex characters) or `OPENHUMAN_KEYRING_MASTER_KEY_FILE` (a secret mount). Both are described in "What you need before you start". On a release older than those variables, set `OPENHUMAN_KEYRING_BACKEND=file`. That keeps secrets in `$OPENHUMAN_WORKSPACE/dev-keychain.json` (plaintext, mode `0600`), so put the workspace volume on encrypted storage and treat the host as the secret boundary.+The keyring backend is `encrypted_file` unless `OPENHUMAN_APP_ENV=dev`/`development` or an explicit backend override selects plaintext. Its master key comes from the OS keychain by default. A container normally has no keychain, so a provider-key write fails with `Failed to encrypt api_key` (`[keyring] set error ... master key unavailable`) until you supply `OPENHUMAN_KEYRING_MASTER_KEY` (64 hex characters) or `OPENHUMAN_KEYRING_MASTER_KEY_FILE` (a secret mount). Keep that key stable across restarts; losing it makes stored secrets unreadable. Older releases without these variables supported `OPENHUMAN_KEYRING_BACKEND=file`, which stored plaintext in `$OPENHUMAN_WORKSPACE/dev-keychain.json` (mode `0600`). On upgrade, the encrypted backend migrates that file, but currently leaves a plaintext `.migrated` copy; remove that copy only after confirming the encrypted data is readable.Mount the key file without group or world write permission. The core rejects group-writable and world-writable files. Read-only group or world access may be accepted for container secret mounts, but any process that can read the file can decrypt the whole keyring. Restrict the mode where the mount is declared:diff --git a/gitbooks/features/cloud-deploy.md b/gitbooks/features/cloud-deploy.mdindex 9a6ec34ffc..0c7c6b9dce 100644--- a/gitbooks/features/cloud-deploy.md+++ b/gitbooks/features/cloud-deploy.md@@ -101,8 +101,8 @@ The desktop app's first-run picker and **Settings > Core connection** both have| `OPENHUMAN_CORE_TOKEN` | yes | Bearer token clients send to `/rpc`. Generate with `openssl rand -hex 32`. **Anyone with this token can drive the core.** || `BACKEND_URL` | yes | Tinyhumans backend the core talks to (`https://api.tinyhumans.ai` for prod). || `OPENHUMAN_APP_ENV` | no | `production` or `staging`. Defaults to `production`. |-| `OPENHUMAN_KEYRING_MASTER_KEY` | no | 64 hex characters (`openssl rand -hex 32`). Master key for the staging/production `encrypted_file` keyring, so a container with no OS keychain can store provider keys encrypted. Inject it from your secret manager like the bearer token; **losing it orphans every stored secret.** |-| `OPENHUMAN_KEYRING_MASTER_KEY_FILE` | no | Path to a file holding the same value, for Docker/Kubernetes secret mounts. Set one of the two, not both. Without either, `encrypted_file` needs an OS keychain. |+| `OPENHUMAN_KEYRING_MASTER_KEY` | yes, if no OS keychain | 64 hex characters (`openssl rand -hex 32`). The `encrypted_file` keyring is now the default even when `OPENHUMAN_APP_ENV` is unset. Inject the key from your secret manager; **losing it orphans every stored secret.** |+| `OPENHUMAN_KEYRING_MASTER_KEY_FILE` | alternative | Path to a file holding the same value, for Docker/Kubernetes secret mounts. Set one of the two, not both. Without either, `encrypted_file` needs an OS keychain. || `OPENHUMAN_CORE_HOST` | no | Defaults to `0.0.0.0` in the container. || `OPENHUMAN_CORE_PORT` | no | Defaults to `7788`. || `RUST_LOG` | no | `info` is fine; `debug` for triage. |@@ -447,7 +447,7 @@ Custom cloud providers (`inference_url` and `api_key`, or an entry in `cloud_pro### Secret storage in containers-In `production` and `staging`, the keyring backend is `encrypted_file`, and its master key is loaded from the OS keychain. A container has no keychain, so the first write that stores a provider key fails with `Failed to encrypt api_key` (`[keyring] set error ... master key unavailable`). Supply the master key from the environment instead: `OPENHUMAN_KEYRING_MASTER_KEY` (64 hex characters) or `OPENHUMAN_KEYRING_MASTER_KEY_FILE` (a secret mount). Both are described in "What you need before you start". On a release older than those variables, set `OPENHUMAN_KEYRING_BACKEND=file`. That keeps secrets in `$OPENHUMAN_WORKSPACE/dev-keychain.json` (plaintext, mode `0600`), so put the workspace volume on encrypted storage and treat the host as the secret boundary.+The keyring backend is `encrypted_file` unless `OPENHUMAN_APP_ENV=dev`/`development` or an explicit backend override selects plaintext. Its master key comes from the OS keychain by default. A container normally has no keychain, so a provider-key write fails with `Failed to encrypt api_key` (`[keyring] set error ... master key unavailable`) until you supply `OPENHUMAN_KEYRING_MASTER_KEY` (64 hex characters) or `OPENHUMAN_KEYRING_MASTER_KEY_FILE` (a secret mount). Keep that key stable across restarts; losing it makes stored secrets unreadable. Older releases without these variables supported `OPENHUMAN_KEYRING_BACKEND=file`, which stored plaintext in `$OPENHUMAN_WORKSPACE/dev-keychain.json` (mode `0600`). On upgrade, the encrypted backend migrates that file, but currently leaves a plaintext `.migrated` copy; remove that copy only after confirming the encrypted data is readable.Mount the key file without group or world write permission. The core rejects group-writable and world-writable files. Read-only group or world access may be accepted for container secret mounts, but any process that can read the file can decrypt the whole keyring. Restrict the mode where the mount is declared: