

























@@ -151,11 +151,11 @@ The Docker setup uses three config files on the host. The container never stores
151151152152### Config Files
153153154-| File | Purpose | Examples |
155-| --------------------------- | ------------------------------------------------ | ------------------------------------------------------------------- |
156-| `<project>/.env` | **Docker infra** — image, ports, gateway token | `OPENCLAW_GATEWAY_TOKEN`, `OPENCLAW_IMAGE`, `OPENCLAW_GATEWAY_PORT` |
157-| `~/.openclaw/.env` | **Secrets** — API keys and bot tokens | `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `TELEGRAM_BOT_TOKEN` |
158-| `~/.openclaw/openclaw.json` | **Behavior config** — models, channels, policies | Model selection, WhatsApp allowlists, agent settings |
154+| File | Purpose | Examples |
155+| --------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------- |
156+| `<project>/.env` | **Docker infra** — image, ports, gateway token | `OPENCLAW_GATEWAY_TOKEN`, `OPENCLAW_IMAGE`, `OPENCLAW_GATEWAY_PORT`, `OPENCLAW_AUTH_PROFILE_SECRET_DIR` |
157+| `~/.openclaw/.env` | **Secrets** — API keys and bot tokens | `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `TELEGRAM_BOT_TOKEN` |
158+| `~/.openclaw/openclaw.json` | **Behavior config** — models, channels, policies | Model selection, WhatsApp allowlists, agent settings |
159159160160**Do NOT** put API keys or bot tokens in `openclaw.json`. Use `~/.openclaw/.env` for all secrets.
161161@@ -165,6 +165,7 @@ The Docker setup uses three config files on the host. The container never stores
165165166166- Builds the `openclaw:local` image from `Dockerfile`
167167- Creates `<project>/.env` from `.env.example` with a generated gateway token
168+- Creates the auth-profile secret key directory
168169- Sets up `~/.openclaw` directories if they don't exist
169170170171```bash
@@ -192,12 +193,14 @@ The `Dockerfile` supports two optional build args:
192193volumes:
193194 - ${OPENCLAW_CONFIG_DIR}:/home/node/.openclaw
194195 - ${OPENCLAW_WORKSPACE_DIR}:/home/node/.openclaw/workspace
196+ - ${OPENCLAW_AUTH_PROFILE_SECRET_DIR}:/home/node/.config/openclaw
195197```
196198197199This means:
198200199201- `~/.openclaw/.env` is available inside the container at `/home/node/.openclaw/.env` — OpenClaw loads it automatically as the global env fallback
200202- `~/.openclaw/openclaw.json` is available at `/home/node/.openclaw/openclaw.json` — the gateway watches it and hot-reloads most changes
203+- `~/.openclaw-auth-profile-secrets` is available at `/home/node/.config/openclaw` — OpenClaw stores the auth-profile encryption key there
201204- Downloadable plugin packages and install records live under the mounted OpenClaw home
202205- No need to add API keys to `docker-compose.yml` or configure anything inside the container
203206- Keys survive `clawdock-update`, `clawdock-rebuild`, and `clawdock-clean` because they live on the host
@@ -221,6 +224,7 @@ OPENCLAW_GATEWAY_PORT=18789
221224OPENCLAW_BRIDGE_PORT=18790
222225OPENCLAW_GATEWAY_BIND=lan
223226OPENCLAW_GATEWAY_TOKEN=<generated-by-docker-setup>
227+OPENCLAW_AUTH_PROFILE_SECRET_DIR=/Users/you/.openclaw-auth-profile-secrets
224228OPENCLAW_IMAGE=openclaw:local
225229```
226230此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。