Files
carlandCursor 0136c15274 Initial commit: Plane 自部署与 gptproto AI 集成
包含本地/远程部署脚本、AI Agent 服务、Dashboard 与 QA 验证。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 11:37:41 +08:00

7.5 KiB
Raw Permalink Blame History

Plane(GitHub 自部署)+ gptproto AI 集成方案

创建:2026-04-28 | 部署目标:先本地 Docker 验证 → 通过后再上 YOUR_SERVER_IP 团队规模:内部


Context

用户希望团队用上"Asana AI 同款"项目管理体验,但坚持:

  1. 数据主权 — 项目/任务/文档不能落第三方 SaaS。
  2. AI 能力 — 复用已用熟的 gptproto.com 聚合 API(OpenAI 兼容)。
  3. 来源可信 — Plane 必须从 GitHub 官方仓库 makeplane/plane 下载部署,不要 curl | bash。

本文档重点回答两个用户最关心的问题:有没有后门?数据隐私如何? 然后给出可执行的本地→远程两阶段方案。


一、Plane 后门与隐私评估(核心)

1.1 项目可信度基线

维度 结论
仓库 github.com/makeplane/plane
License AGPL-3.0(开源 + 强 Copyleft)
最新稳定版 v1.3.0(2026-04-06)
安全响应 security@plane.so,3 工作日

结论:开源 + AGPL + 持续维护 + 官方安全渠道,不存在隐藏后门的合理动机(任何二次分发的代码都必须开源)。

1.2 默认遥测(真实风险点)

项 默认 流向 关闭
Plausible Analytics ✅ 启用 自部署 → Plausible 云 god-mode → General → Telemetry off
上报字段 实例 ID、工作区/项目/issue 计数、管理员邮箱(不含业务内容) 同上 同上
Sentry ❌ — 不主动配置即可
PostHog/GA/Mixpanel/Segment ❌ — —

强制对策:部署完成第一件事进 /god-mode 关 Telemetry,并在出口防火墙加 deny *.plausible.io 兜底。

1.3 已知 CVE(v1.3.0 已全修)

  • CVE-2026-30244(中)— 未授权枚举工作区成员邮箱
  • CVE-2026-39374(中)— 普通成员可改任意 issue 日期
  • CVE-2026-27949(低)— 错误响应泄露邮箱到 URL
  • 其它已修:SSRF、description_html stored XSS

对策:部署 v1.3.0 或更高(不要拉 master);订阅 github.com/makeplane/plane/security/advisories RSS。

1.3.1 实测发现:API Token 明文存储(非哈希)

2026-04-28 本地验证发现:

  • users.password 用 PBKDF2 哈希存储(88 字符,前缀 pbkdf2_sha256$...)— ✅ 标准实践
  • api_tokens.token 明文存储(42 字符,前缀 plane_...)— ⚠️ 任何 DB 读权限者可枚举所有用户的 API token

对策:

  • Postgres 数据卷不暴露到 host(override.yml ports: !override [] 已做)
  • 备份必须加密:pg_dump | gpg --encrypt -r ...
  • 生产 SSH 严格授权
  • 怀疑泄露立即在 Plane Settings → API Tokens 删除并重建

1.4 数据隐私边界

[本机] PostgreSQL / Redis / MinIO            ← 100% 自有
[必经外发] gptproto.com(仅当主动调 AI 时;内容 = prompt + Plane 拉到的 issue 数据)
[默认外发] Plausible(关掉)
[可选外发] Sentry(不配置)

调 gptproto 是用户主动选择 AI 功能时的预期行为,不是后门。AI Agent 层应记录哪些字段被外发以备审计。

1.5 供应链安全("从 GitHub 下载"的正确姿势)

❌ 不要:curl -fsSL .../install.sh | bash ✅ 应该:

RELEASE=v1.3.0
git clone --branch $RELEASE --depth 1 https://github.com/makeplane/plane.git src
sha256sum src/deploy/selfhost/docker-compose.yml  # 与 GitHub Release 公布对比
# docker-compose 镜像锁 tag + digest,不用 :latest

二、部署架构

浏览器 → Nginx(80) → Plane Web (Next.js,3000)
                  → Plane API (Django,8000)
                  → Plane Worker (Celery)
                              ↓
              PostgreSQL(5432) / Redis(6379) / MinIO(9000)
                              ↑
              AI Agent (FastAPI,8100) → gptproto.com/v1

容器全部 restart: unless-stopped;数据卷 /opt/plane/data/{postgres,redis,minio}。


三、实施阶段

Stage A:本地 Docker 验证(mac,本周) ★ 当前阶段

目标:所有功能在 mac 本地跑通,AI Agent 测试全绿,证明方案可行后再上生产。

端口策略(避开 mac 占用):

  • Plane Web: http://localhost:8090(不占 80)
  • Plane API: localhost:8000(在 nginx 后)
  • AI Agent: localhost:8100
  • Postgres / Redis / MinIO 不暴露到 host,只在 docker 网络内

目录布局:

plane-gptproto-integration/
├── docs/PLAN.md                    ← 本文档
├── deploy/
│   ├── local/                      ← Stage A:本地 mac 验证
│   │   ├── pull-plane.sh           ← git clone v1.3.0
│   │   ├── docker-compose.override.yml  ← 端口映射 + 加 plane-ai 服务
│   │   ├── .env.template
│   │   └── README.md               ← 本地启动步骤
│   └── remote/                     ← Stage B:上线 YOUR_SERVER_IP
│       ├── install.sh              ← 远程一键部署(手动 ssh 跑)
│       ├── .env.template
│       └── README.md
├── ai-agent/                       ← FastAPI AI Agent(TDD)
│   ├── ai_agent/main.py
│   ├── tests/                      ← pytest(先写、先 fail)
│   ├── requirements.txt
│   └── Dockerfile
├── qa/                             ← QA 验证
│   ├── verify-local.sh             ← 健康/遥测/AI 端点全检
│   └── checklist.md
└── AGENTS.md                       ← worker 共享上下文

Stage B:上 YOUR_SERVER_IP(验证通过后)

复用 deploy/remote/install.sh,主要差异:

  • 真实域名 + Let's Encrypt
  • 防火墙 ufw 仅放行 80/443/22
  • 数据卷映射到 /opt/plane/data/
  • Postgres 每日 cron 备份

四、AI Agent 端点设计(TDD)

端点 输入 输出 测试要点
POST /healthz — {"status":"ok"} 最简单,先写
POST /ai/create-issue {prompt, project_id, workspace_slug} Plane issue JSON mock gptproto + mock plane API
POST /ai/summarize {issues:[...]} {summary: "..."} mock gptproto
POST /ai/search {query, workspace_slug} {results, ai_summary} mock 双 API

TDD 规则:每个端点先写 tests/test_<endpoint>.py,运行 pytest 确认 RED(失败原因正确),再写 main.py 实现,运行 pytest 看 GREEN。不允许跳过 RED 步骤。


五、QA 验证清单(Stage A)

项 命令 通过标准
容器全启 docker compose ps 全 Up (healthy)
Web 可访 curl -I http://localhost:8090 200
Telemetry 关 god-mode → General toggle = off
遥测真不外发 tcpdump -i any host plausible.io 0 包
镜像版本锁死 docker compose images 无 :latest
AI healthz curl :8100/healthz {"status":"ok"}
AI 单测 pytest ai-agent/tests/ -v 全 PASS
数据持久化 docker compose down && up -d issue 仍在
.env 600 权限 ls -l .env -rw-------

六、风险与对策

风险 概率 影响 对策
Plane 新 CVE 中 中 订阅 advisories;月度 patch
Docker Hub 镜像被替换 低 高 内网 Harbor 缓存 digest
Plausible 升级回写默认 低 中 防火墙 deny 兜底;升级后 tcpdump 复验
gptproto API 不稳 中 中 AI 端点降级返回"暂不可用"
gptproto 训练 prompt 中 中 敏感 issue 标记不调 AI
API Key 泄露 低 高 .env 600 + 定期轮换 + 不进 git