Files
pdd_AI/example/docs/git-deploy-centos.md
T
zhangyu 2b55aa5a44 Add native client with image adjustment and AI hybrid intent mode
Switch to WebView2 host with embedded resources, save chat images by order, and support buyer photo replace/delete via rules, dHash matching, and optional model-assisted intent parsing.
2026-11-11 02:19:26 +08:00

100 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Git 部署到 CentOS
## 1. 本地首次推送
在 Windows PowerShell 中进入项目目录:
```powershell
cd D:\code\pdd
git init
git branch -M main
git add .
git status
git commit -m "Initial pdd assistant"
git remote add origin https://github.com/octopuszycn-droid/pdd_AI.git
git push -u origin main
```
`config/shops.json`、`config/mail.json`、`.env` 不会被提交。真实 Token 和邮箱授权码只放服务器本地。
## 2. 服务器克隆
```bash
cd /opt
git clone https://github.com/octopuszycn-droid/pdd_AI.git pdd
cd /opt/pdd
```
## 3. 创建真实配置
```bash
cp config/shops.example.json config/shops.json
cp config/mail.example.json config/mail.json
vi config/shops.json
vi config/mail.json
```
创建 `.env`:
```bash
cat > /opt/pdd/.env <<'EOF'
PDD_ASSISTANT_HOST=0.0.0.0
PDD_ASSISTANT_PORT=3456
PDD_DAILY_PAUSE_TIME=07:50
PDD_CONTROL_TOKEN=replace-with-control-password
COZE_API_TOKEN=replace-with-coze-service-token
PDD_MAIL_AUTH_CODE=replace-with-mail-auth-code
EOF
chmod 600 /opt/pdd/.env
```
## 4. 启动
```bash
npm start
```
后台运行用 systemd:
```bash
cat > /etc/systemd/system/pdd-assistant.service <<'EOF'
[Unit]
Description=PDD Customer Service Reply Assistant
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
WorkingDirectory=/opt/pdd
EnvironmentFile=/opt/pdd/.env
ExecStart=/usr/bin/node /opt/pdd/server/index.js
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now pdd-assistant
```
## 5. 后续更新
本地提交并推送:
```powershell
git add .
git commit -m "Update assistant"
git push
```
服务器拉取并重启:
```bash
cd /opt/pdd
git pull
systemctl restart pdd-assistant
```