Add brave_api_key option and export BRAVE_API_KEY

This commit is contained in:
root
2026-01-28 18:53:15 +02:00
parent d6657d63d3
commit b2fa3d3d71
2 changed files with 15 additions and 1 deletions
+11 -1
View File
@@ -17,6 +17,7 @@ GW_BIND=$(jq -r '.gateway_bind // "loopback"' "$OPTIONS_FILE")
GW_PORT=$(jq -r '.gateway_port // 18789' "$OPTIONS_FILE")
GW_TOKEN=$(jq -r '.gateway_token // empty' "$OPTIONS_FILE")
HA_TOKEN=$(jq -r '.homeassistant_token // empty' "$OPTIONS_FILE")
BRAVE_KEY=$(jq -r '.brave_api_key // empty' "$OPTIONS_FILE")
MT_HOST=$(jq -r '.mikrotik_host // "192.168.88.1"' "$OPTIONS_FILE")
MT_USER=$(jq -r '.mikrotik_ssh_user // "papur"' "$OPTIONS_FILE")
MT_KEY=$(jq -r '.mikrotik_ssh_key_path // "/data/keys/mikrotik_papur_nopw"' "$OPTIONS_FILE")
@@ -98,13 +99,22 @@ else
fi
# ------------------------------------------------------------------------------
# Store HA token (optional) in a local file for later use by the HA skill/tooling.
# Store tokens / export env vars (optional)
# ------------------------------------------------------------------------------
# Home Assistant long-lived token (for local HA API scripts/tools)
if [ -n "$HA_TOKEN" ]; then
umask 077
printf '%s' "$HA_TOKEN" > /config/secrets/homeassistant.token
fi
# Brave Search API key (for clawdbot's web_search tool, which reads BRAVE_API_KEY)
if [ -n "$BRAVE_KEY" ]; then
export BRAVE_API_KEY="$BRAVE_KEY"
umask 077
printf '%s' "$BRAVE_KEY" > /config/secrets/brave_api_key
fi
# Decide Telegram DM access policy.
DM_POLICY="pairing"
ALLOW_FROM_JSON=""