Files
openclaw-memory/DEPLOY.md
道童 4374379d3f feat: 龙虾记忆同步系统完整版本
功能特性:
- 文件树展示
- 差异对比
- 双向同步(本地 <-> 数据库)
- 版本历史追踪
- 统计信息展示

核心补丁:
1. 分块读取与流式传输(防止大文件内存飙升)
2. .lobsterignore 机制(排除临时文件)
3. 操作溯源(Audit Log,记录同步历史)

技术栈:
- 后端: Django + DRF + PostgreSQL
- 前端: React + Ant Design
- 部署: Docker + Docker Compose

项目已完整部署,可直接使用 docker-compose up -d 启动
2026-04-05 12:43:24 +00:00

107 lines
1.5 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.
# Lobster Memory Sync
## 部署指南
### 前置条件
- Docker
- Docker Compose
### 快速启动
1. **克隆项目**
```bash
cd /home/node/.openclaw/workspace/daotong/lobster-memory-sync
```
2. **启动服务**
```bash
docker-compose up -d
```
3. **访问应用**
- 前端http://localhost:8086
- 后端 APIhttp://localhost:8087/api/
- PostgreSQLlocalhost:5432
### 开发模式
#### 后端开发
```bash
# 进入后端容器
docker exec -it lobster-backend bash
# 创建迁移
python manage.py makemigrations memory_app
python manage.py migrate
# 创建超级用户
python manage.py createsuperuser
```
#### 前端开发
```bash
# 本地开发(不使用 Docker
cd frontend
npm install
npm start
```
### API 接口文档
#### 扫描文件
```
GET /api/scan/?lobster_id=daotong
```
#### 检查同步状态
```
GET /api/status/?lobster_id=daotong
```
#### 获取文件差异
```
GET /api/diff/?lobster_id=daotong&file_path=MEMORY.md
```
#### 同步到数据库
```
POST /api/sync/db/
{
"lobster_id": "daotong",
"file_path": "MEMORY.md"
}
```
#### 同步到本地
```
POST /api/sync/local/
{
"lobster_id": "daotong",
"file_path": "MEMORY.md"
}
```
### 故障排查
#### 查看日志
```bash
docker-compose logs -f
```
#### 重启服务
```bash
docker-compose restart
```
#### 清理数据
```bash
docker-compose down -v
docker-compose up -d
```
### 技术栈
- **后端**: Django + Django REST Framework + PostgreSQL
- **前端**: React + Ant Design + react-diff-viewer-continued
- **部署**: Docker + Docker Compose