diff --git a/server/setup/enterprise/SETUP.md b/server/setup/enterprise/SETUP.md new file mode 100644 index 0000000..d6b7a9b --- /dev/null +++ b/server/setup/enterprise/SETUP.md @@ -0,0 +1,87 @@ +# SETUP.md · HLDP原生数据库平台 · 给AI副驾驶读的部署指南 + +> 这不是给人看的文档。这是给Cursor/Copilot/任何AI副驾驶的。 +> 用户说"读SETUP.md部署HLDP" → AI副驾驶按这个指南5分钟部署完成。 + +--- + +## 你的身份 + +你是用户的AI副驾驶。你正在帮用户部署HLDP原生数据库平台。 + +## 部署目标 + +在一台Ubuntu 22.04/24.04服务器上部署: +- SQLite双区数据库(母语区 + 人类区) +- Open WebUI聊天前端(Docker) +- 5个Python Tools(搜索/读取/创建/编辑/记忆写入) +- Gatekeeper SYSLOG客户端(向铸渊上报心跳) + +## 先决条件检查 + +```bash +# 逐一检查 +uname -a # 必须是Linux +nproc # CPU核数(≥2) +free -m # 内存MB(≥3500) +df -BG / # 磁盘GB(≥20) +which python3 # Python 3.10+ +which docker # Docker(如无则安装) +``` + +如缺少Docker: +```bash +curl -fsSL https://get.docker.com | sudo sh +``` + +## 部署步骤 + +### Step 1: 克隆仓库 +```bash +git clone https://guanghulab.com/code/bingshuo/guanghulab.git /opt/guanghu-enterprise +cd /opt/guanghu-enterprise/server/setup/enterprise +``` + +### Step 2: 运行bootstrap +```bash +chmod +x bootstrap.sh +sudo ./bootstrap.sh +``` + +bootstrap.sh 是幂等的——可以重复运行。 + +### Step 3: 验证 +```bash +# 检查Open WebUI +curl -s http://localhost:3000 | head -5 + +# 检查数据库 +sqlite3 /opt/guanghu-enterprise/data/hldp.db "SELECT COUNT(*) FROM pages" + +# 检查Gatekeeper客户端 +systemctl status hldp-gatekeeper-client +``` + +### Step 4: 通知用户 + +部署完成后告诉用户: +1. 打开浏览器访问 `http://SERVER_IP:3000` +2. 首次使用需要配置商业模型API Key(Claude/GPT/DeepSeek) +3. AI助手会读取WELCOME页面 → 让用户给AI起名字 +4. 上传任何文件 → 自动翻译成HLDP母语 + +## 常见问题 + +| 问题 | 解决 | +|------|------| +| Docker拉取慢 | 配置国内镜像源 | +| 端口3000被占 | 修改 WEBUI_PORT 环境变量 | +| bootstrap中途失败 | 直接重新运行,幂等的 | +| Gatekeeper连不上 | 检查43.139.217.141:3910可达性 | + +## 铸渊不会做的事 + +- 不会登录企业服务器 +- 不会读企业服务器上的对话内容 +- 不会控制企业服务器的运行 +- 只收SYSLOG心跳确认活着