Files
memind/docs/regression-guards/103-release-0630001-rollback.md
2026-07-01 18:08:06 +08:00

74 lines
2.5 KiB
Markdown
Raw Permalink 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.
# 103 发布 0630001 — 回退说明
**发布编号:** `20260630-012244-66ca0b3`
**Git commit** `66ca0b3`(分支 `0630001`
**发布时间:** 2026-06-30
## 本次内容
- MindSpace「全部页面」:分页、多选、删除、分享/打开/编辑
- 页面删除级联:工作区 HTML/附件清理、可选移除广场帖
- 页面同步去重:并发 list 不再重复创建同一 `public/*.html` 页面
- 预览/发布 HTML 相对下载链接重写;iframe 允许下载
- 批量清页脚本:`scripts/purge-user-pages.mjs`
## 103 自动备份(发布脚本已创建)
| 类型 | 路径(103 上) |
|------|----------------|
| 全量 live 备份 | `/Users/john/Project/backups/memind/memind-full-20260630-012244-66ca0b3-before.tar.gz` |
| 持久目录备份 | `/Users/john/Project/backups/memind/memind-persisted-20260630-012244-66ca0b3-before.tar.gz` |
| 旧源码归档 | `/Users/john/Project/archives/Memind-source-before-20260630-012244-66ca0b3` |
| 当前 live | `/Users/john/Project/Memind`(无源码 runtime |
持久目录(`.env``MindSpace``data``users` 等)在切换时已继承到新 runtime,未丢失。
## 健康验证
```bash
ssh 58.38.22.103 'curl -sf http://127.0.0.1:8081/api/status && echo'
```
发版脚本已在 103 上完成 health check200)。
## 回退到上一版 live(紧急)
**103** 上执行:
```bash
RELEASE_ID=20260630-012244-66ca0b3
APP_DIR=/Users/john/Project/Memind
ARCHIVE=/Users/john/Project/archives/Memind-source-before-${RELEASE_ID}
PORTAL_LABEL=cn.tkmind.memind-portal
LAUNCHD_GUI="gui/$(id -u)"
launchctl bootout "${LAUNCHD_GUI}/${PORTAL_LABEL}" 2>/dev/null || true
lsof -tiTCP:8081 -sTCP:LISTEN | xargs kill -9 2>/dev/null || true
mv "${APP_DIR}" "${APP_DIR}.failed-runtime-${RELEASE_ID}"
mv "${ARCHIVE}" "${APP_DIR}"
launchctl bootstrap "${LAUNCHD_GUI}" "${HOME}/Library/LaunchAgents/${PORTAL_LABEL}.plist"
launchctl kickstart -k "${LAUNCHD_GUI}/${PORTAL_LABEL}"
curl -sf http://127.0.0.1:8081/api/status
```
若 runtime 切换失败,发布脚本 remote 段内置 `trap rollback` 会自动尝试恢复。
## 从全量 tar 恢复(极端情况)
```bash
cd /Users/john/Project
mv Memind "Memind.broken-$(date +%Y%m%d-%H%M%S)"
tar -xzf backups/memind/memind-full-20260630-012244-66ca0b3-before.tar.gz
# 再启动 Portal LaunchAgent
```
## 本地复现 / 再发版
```bash
git checkout 0630001
npm run verify:mindspace-publish-guards:full
bash scripts/release-portal-runtime-prod.sh --yes
```