mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 03:07:27 +00:00
docs(secrets): add direct 1password exec example
This commit is contained in:
committed by
Peter Steinberger
parent
f46b9c996f
commit
ea1ccf4896
@@ -152,13 +152,9 @@ Optional per-id errors:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Validated exec integration examples
|
## Exec integration examples
|
||||||
|
|
||||||
The patterns below were validated end-to-end with `openclaw secrets audit --json` and `unresolvedRefCount=0`.
|
### 1Password CLI
|
||||||
|
|
||||||
### Direct Homebrew command path (no wrapper)
|
|
||||||
|
|
||||||
Use this when your command path is a Homebrew symlink (for example `/opt/homebrew/bin/op`):
|
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
@@ -167,7 +163,7 @@ Use this when your command path is a Homebrew symlink (for example `/opt/homebre
|
|||||||
onepassword_openai: {
|
onepassword_openai: {
|
||||||
source: "exec",
|
source: "exec",
|
||||||
command: "/opt/homebrew/bin/op",
|
command: "/opt/homebrew/bin/op",
|
||||||
allowSymlinkCommand: true,
|
allowSymlinkCommand: true, // required for Homebrew symlinked binaries
|
||||||
trustedDirs: ["/opt/homebrew"],
|
trustedDirs: ["/opt/homebrew"],
|
||||||
args: ["read", "op://Personal/OpenClaw QA API Key/password"],
|
args: ["read", "op://Personal/OpenClaw QA API Key/password"],
|
||||||
passEnv: ["HOME"],
|
passEnv: ["HOME"],
|
||||||
@@ -187,65 +183,18 @@ Use this when your command path is a Homebrew symlink (for example `/opt/homebre
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### 1Password (`op`)
|
|
||||||
|
|
||||||
1. Create a wrapper script (non-symlink command path):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cat >/usr/local/libexec/openclaw/op-openai.sh <<'SH'
|
|
||||||
#!/bin/sh
|
|
||||||
exec /opt/homebrew/bin/op read 'op://Personal/OpenClaw QA API Key/password'
|
|
||||||
SH
|
|
||||||
chmod 700 /usr/local/libexec/openclaw/op-openai.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Configure provider + ref:
|
|
||||||
|
|
||||||
```json5
|
|
||||||
{
|
|
||||||
secrets: {
|
|
||||||
providers: {
|
|
||||||
onepassword_openai: {
|
|
||||||
source: "exec",
|
|
||||||
command: "/usr/local/libexec/openclaw/op-openai.sh",
|
|
||||||
passEnv: ["HOME"],
|
|
||||||
jsonOnly: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
models: {
|
|
||||||
providers: {
|
|
||||||
openai: {
|
|
||||||
baseUrl: "https://api.openai.com/v1",
|
|
||||||
models: [{ id: "gpt-5", name: "gpt-5" }],
|
|
||||||
apiKey: { source: "exec", provider: "onepassword_openai", id: "value" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### HashiCorp Vault CLI
|
### HashiCorp Vault CLI
|
||||||
|
|
||||||
1. Wrapper script:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cat >/usr/local/libexec/openclaw/vault-openai.sh <<'SH'
|
|
||||||
#!/bin/sh
|
|
||||||
exec /opt/homebrew/opt/vault/bin/vault kv get -field=OPENAI_API_KEY secret/openclaw
|
|
||||||
SH
|
|
||||||
chmod 700 /usr/local/libexec/openclaw/vault-openai.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Provider + ref:
|
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
secrets: {
|
secrets: {
|
||||||
providers: {
|
providers: {
|
||||||
vault_openai: {
|
vault_openai: {
|
||||||
source: "exec",
|
source: "exec",
|
||||||
command: "/usr/local/libexec/openclaw/vault-openai.sh",
|
command: "/opt/homebrew/bin/vault",
|
||||||
|
allowSymlinkCommand: true, // required for Homebrew symlinked binaries
|
||||||
|
trustedDirs: ["/opt/homebrew"],
|
||||||
|
args: ["kv", "get", "-field=OPENAI_API_KEY", "secret/openclaw"],
|
||||||
passEnv: ["VAULT_ADDR", "VAULT_TOKEN"],
|
passEnv: ["VAULT_ADDR", "VAULT_TOKEN"],
|
||||||
jsonOnly: false,
|
jsonOnly: false,
|
||||||
},
|
},
|
||||||
@@ -265,25 +214,16 @@ chmod 700 /usr/local/libexec/openclaw/vault-openai.sh
|
|||||||
|
|
||||||
### `sops`
|
### `sops`
|
||||||
|
|
||||||
1. Wrapper script:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cat >/usr/local/libexec/openclaw/sops-openai.sh <<'SH'
|
|
||||||
#!/bin/sh
|
|
||||||
exec /opt/homebrew/bin/sops -d --extract '["providers"]["openai"]["apiKey"]' /path/to/secrets.enc.json
|
|
||||||
SH
|
|
||||||
chmod 700 /usr/local/libexec/openclaw/sops-openai.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Provider + ref:
|
|
||||||
|
|
||||||
```json5
|
```json5
|
||||||
{
|
{
|
||||||
secrets: {
|
secrets: {
|
||||||
providers: {
|
providers: {
|
||||||
sops_openai: {
|
sops_openai: {
|
||||||
source: "exec",
|
source: "exec",
|
||||||
command: "/usr/local/libexec/openclaw/sops-openai.sh",
|
command: "/opt/homebrew/bin/sops",
|
||||||
|
allowSymlinkCommand: true, // required for Homebrew symlinked binaries
|
||||||
|
trustedDirs: ["/opt/homebrew"],
|
||||||
|
args: ["-d", "--extract", '["providers"]["openai"]["apiKey"]', "/path/to/secrets.enc.json"],
|
||||||
passEnv: ["SOPS_AGE_KEY_FILE"],
|
passEnv: ["SOPS_AGE_KEY_FILE"],
|
||||||
jsonOnly: false,
|
jsonOnly: false,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user