Commit Graph

13 Commits

Author SHA1 Message Date
91dc787f90 auto-save 2026-04-20 00:31 (~2) 2026-04-20 00:31:34 +08:00
01b09bc7ab auto-save 2026-04-20 00:20 (~2) 2026-04-20 00:20:34 +08:00
00fe936342 auto-save 2026-04-19 23:13 (~2) 2026-04-19 23:13:45 +08:00
ec2af8219c auto-save 2026-04-19 22:56 (~2) 2026-04-19 22:56:55 +08:00
7d83838a2e auto-save 2026-04-19 22:51 (~2) 2026-04-19 22:51:12 +08:00
39ee8083c7 feat(admin): Manus-style 管理台 — 文件树 + 活动时间线 + SSE 实时推送
新增:
- src/events.ts: 工具调用事件总线(EventEmitter + 500 条 ring buffer)
- src/admin.ts: /admin/api/* 路由(users/files/file/events/start/stop)
- src/admin-ui.ts: 两张 HTML 页面
  - Dashboard: 所有用户卡片网格,状态彩色徽章
  - 单用户视图: 三栏(文件树|预览|时间线),SSE 实时
- src/index.ts: /admin/ 静态页 + 工具调用 emitEvent 埋点

部署:
- nginx: sandbox.milejoy.com → 127.0.0.1:8700(含 SSE 长连接 off buffer)
- certbot --expand 把 sandbox.milejoy.com 加到现有证书

访问: https://sandbox.milejoy.com/admin/?token=<ADMIN_TOKEN>
ADMIN_TOKEN 在 /etc/lobe-sandbox/orchestrator.env

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 22:38:58 +08:00
cca158da1e auto-save 2026-04-19 22:34 (+2, ~2) 2026-04-19 22:34:43 +08:00
158faeb655 fix(sandbox): sanitize userId → container name(下划线→横杠)
better-auth 生成的 user id 格式是 \`user_xxx\`(带下划线),
Incus 容器名规则只允许 [a-zA-Z0-9-],用下划线会报
"Invalid instance name: Name can only contain alphanumeric and hyphen characters"。

修法:containerName() 用 \`.replace(/[^a-zA-Z0-9-]/g, '-')\` 把所有非法字符替换。
影响:存量 17 个用户全部成功 provisioned 为 sb-user-xxx(横杠版)。

Phase 5 生产上线完成(2026-04-19):
- orchestrator 绑 0.0.0.0:8700 + iptables 放行 172.17/172.18 网段
- LobeChat .env 加 SANDBOX_BACKEND_URL=http://172.18.0.1:8700 + SECRET
- feat/self-hosted-sandbox 分支 push Gitea,VPS 上 docker build → lobechat-custom:sandbox
- 重 tag :latest 并 docker compose up -d --force-recreate lobe
- 17 个存量用户 backfill 沙箱全成功,池子占 3.7GB(CoW)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 21:59:10 +08:00
98e8486bcf auto-save 2026-04-19 21:39 (+1, ~2) 2026-04-19 21:39:57 +08:00
7df50e0dc3 phase 5 prep: backfill-users.ts + deployment runbook in .memory
- scripts/backfill-users.ts: 扫 PG users 表,对每人幂等调 orchestrator POST /users
- orchestrator/package.json: 加 postgres 依赖
- .memory/project.md: Phase 3/4 完成状态,Phase 5 上线 checklist

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 21:17:01 +08:00
cbf8125afd auto-save 2026-04-19 21:06 (+6, ~4) 2026-04-19 21:06:57 +08:00
1b8a216fbd auto-save 2026-04-19 21:01 (+3, ~2) 2026-04-19 21:01:27 +08:00
8b26a2155a auto-save 2026-04-19 13:31 (+1, ~1) 2026-04-19 13:33:05 +08:00