fix(deploy): generate internal tenant key automatically

This commit is contained in:
姚章浩
2026-09-11 13:20:44 +08:00
parent b4b61c0aa5
commit febf99b549
4 changed files with 15 additions and 2 deletions
+2 -1
View File
@@ -26,6 +26,7 @@ install -m 0644 "$source_root"/db/migrations/*.up.sql "$container_dir/migrations
if [[ ! -f "$app_env" ]]; then
umask 077
tenant_suffix="$(python3 -c 'import secrets; print(secrets.token_hex(12))')"
cat > "$app_env" <<'EOF'
DOBOTAI_LISTEN_ADDR=127.0.0.1:8090
DATABASE_URL=
@@ -33,13 +34,13 @@ WEKNORA_BASE_URL=http://127.0.0.1:8080
WEKNORA_API_KEY=
DOBOTAI_INGRESS_TOKEN=
DOBOTAI_ADMIN_TOKEN=
DOBOTAI_TENANT_KEY=dobotai
DOBOTAI_AGENT_BINDINGS=
DOBOTAI_QUICK_AGENT_ID=builtin-quick-answer
DOBOTAI_REASONING_AGENT_ID=builtin-smart-reasoning
DINGTALK_CLIENT_ID=
DINGTALK_CLIENT_SECRET=
EOF
printf 'DOBOTAI_TENANT_KEY=dobotai-%s\n' "$tenant_suffix" >> "$app_env"
chmod 0600 "$app_env"
fi
umask 077