fix(deploy): generate internal tenant key automatically
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user