feat: 把估价智能体和部署配置提交到主分支

门户估价对话、会员与智能体账号,以及生产 Docker 部署一直停在工作区,远端主分支还没有这些改动。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
wuzilongandCursor committed 2026-11-23 09:42:44 +08:00
1 parent 6519682885
commit 9c7c80e194
78 files changed
+16614 -345

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
set -euo pipefail
cd "$(dirname "$0")"
if [[ ! -f .env ]]; then
echo "缺少 .env"
exit 1
fi
user="${1:-admin}"
pass="Aa$(openssl rand -hex 12)"
install -d -m 700 secrets
umask 077
printf 'username=%s\npassword=%s\n' "$user" "$pass" > secrets/initial-admin.txt
chmod 600 secrets/initial-admin.txt
ready=0
for _ in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
if docker compose exec -T server python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/api/site/health', timeout=3)" >/dev/null 2>&1; then
ready=1
break
fi
sleep 3
done
if [[ "$ready" != 1 ]]; then
echo "服务还没就绪。初始口令已写在 secrets/initial-admin.txt,稍后重跑会换一套口令。"
exit 1
fi
docker compose run --rm --no-deps --entrypoint python \
-e BOOTSTRAP_ADMIN_USERNAME="$user" \
-e BOOTSTRAP_ADMIN_PASSWORD="$pass" \
server -m app.commands.create_superuser
echo "初始管理员已写入 secrets/initial-admin.txt"