Files
mnote/recycle/20260522-convex-runtime-retirement/infra/convex/README.md
T
lix-2026 42fb58310c chore: retire remaining convex infrastructure
- move self-hosted Convex infra and root placeholder into recycle

- update architecture docs to remove active infra/convex deployment guidance

- extend local-first Convex guard to block retired infra regressions
2026-05-22 19:31:20 +08:00

57 lines
2.3 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.
# Convex 自托管(Windows 本机)
本目录用于在本机通过 Docker Compose 启动 Convex backend + dashboard,并使用 backend 自身的持久化卷存储(包含数据库与文件存储)。
在 local-first 方案下,这套 Convex 自托管环境只定位为历史数据导出、显式 cloud source / compat 和可选 sync replica 运行底座;默认 auth、授权、分享、同步状态、AI policy、ACP/Hermes runtime session 等控制面已由 Rust SQLite control-plane 承接。页面正文、默认附件和本地 AI 会话全文不再以它作为早期产品默认数据真相。
## 当前 functions 边界
- 仓库根 `convex/` 已退役并软删除到 `recycle/20260522-convex-runtime-retirement/convex/`;它只作为审计、迁移对照或历史恢复素材,不再是 active deploy source。
- `recycle/wolai-frontend/convex/` 是退役前端随带的历史实现,不允许作为当前部署 fallback。
- `scripts/run-convex-deploy.js` 已随根 functions 源码软删除到 `recycle/20260522-convex-runtime-retirement/scripts/run-convex-deploy.js`。如需重新部署 Convex functions,必须先明确新的 cloud/compat 部署边界,不应直接恢复旧根 `convex/` 作为默认控制面。
## 启动
1. 确保仓库根目录 `.env.all` 存在(全局唯一 env 文件)。
2. 在本目录执行:
```bash
docker compose up -d
```
## 生成 Dashboard / CLI admin key
在本目录执行:
```bash
docker compose exec backend ./generate_admin_key.sh
```
## 访问地址(默认)
- Dashboard`http://localhost:6791`
- Backend`http://127.0.0.1:3210`
- HTTP Actions`http://127.0.0.1:3211`
- 文件存储:由 Convex 管理(Dashboard 的 Files 页面可查看)
## 快速验证(可选)
### 1) 验证默认启动不依赖 Convex functions 源码
当前默认 hot 启动链路不应要求仓库根存在 `convex/`
```bash
test ! -d convex
npm run desktop:hot
```
### 2) 验证固定开发用户(阶段 3)
启动前端后访问:`http://127.0.0.1:3000/api/dev/whoami`
### 3) 验证异步任务骨架(阶段 5)
启动前端后:
- `POST http://127.0.0.1:3000/api/dev/jobs/demo`body 可选:`{ "ms": 800 }`)创建 demo job
- `GET http://127.0.0.1:3000/api/dev/jobs/demo?id=<jobId>` 查询状态(queued/running/succeeded/failed