@xiaoyuyu6420/dsh-backup 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/README.zh.md +7 -1
- package/lib/client.js +87 -34
- package/lib/index.js +794 -75
- package/package.json +5 -1
- package/rescue/rescue.mjs +728 -0
package/README.md
CHANGED
|
@@ -11,8 +11,12 @@ English | [简体中文](README.zh.md)
|
|
|
11
11
|
|
|
12
12
|
Sessions, settings, skills, and plugin config all live in `~/.dsh`. Delete it by accident, break a config, or move to a new machine — with a backup, you get it all back. Credentials never enter an archive; scheduled backups and GitHub sync are supported (details in the [advanced guide](docs/advanced.zh.md), Chinese).
|
|
13
13
|
|
|
14
|
+
Recent additions: **0.9.0** adds a session-log health check with targeted repair (`/backup doctor`), an out-of-process rescue channel (`dsh-rescue` / launcher dropped into the backup dir) that works even when the host won't boot, restore auto-rollback with a result-oriented receipt, and smart backup: pre-upgrade snapshots on host train changes, quarantine of corrupt session logs before they rotate away, and tiered daily/weekly retention. **0.8.0** can edit backup settings right in the panel (destination, retention, exclude patterns) — saved instantly to `settings.yaml`, no restart; stale edits get a conflict warning instead of being silently overwritten. **0.7.x** added credential redaction with a local vault and cross-machine restore.
|
|
15
|
+
|
|
14
16
|
## Install
|
|
15
17
|
|
|
18
|
+
The package is published on [npm](https://www.npmjs.com/package/@xiaoyuyu6420/dsh-backup); install it into a DSH profile with:
|
|
19
|
+
|
|
16
20
|
```sh
|
|
17
21
|
dsh plugin --profile web add @xiaoyuyu6420/dsh-backup
|
|
18
22
|
# or from GitHub:
|
|
@@ -38,10 +42,12 @@ Want it on a schedule? `/backup auto 12` — every 12 hours, keeps going across
|
|
|
38
42
|
| Restore | `/backup restore latest` (`--dry-run` to preview) |
|
|
39
43
|
| List backups | `/backup list` |
|
|
40
44
|
| Verify integrity | `/backup verify [prefix\|all]` |
|
|
45
|
+
| Check & repair session logs | `/backup doctor` (`--repair [prefix\|latest]` to fix from a backup) |
|
|
46
|
+
| **Total failure rescue** | double-click `点我恢复` in the backup dir, or `node rescue.mjs` — a zero-dependency recovery console (web UI) that works even when DSH won't boot |
|
|
41
47
|
| Delete | `/backup delete <prefix\|latest>` |
|
|
42
48
|
| Keep N copies (default 7) | `/backup --keep N` |
|
|
43
49
|
|
|
44
|
-
|
|
50
|
+
There's a visual panel in `dsh web` → Settings → Plugins → Backup: it lists backups, runs verify/restore/delete, and — since 0.8.0 — edits the backup settings (destination, retention, exclude patterns) directly, applied immediately, no restart.
|
|
45
51
|
|
|
46
52
|
## New machine
|
|
47
53
|
|
package/README.zh.md
CHANGED
|
@@ -11,8 +11,12 @@
|
|
|
11
11
|
|
|
12
12
|
会话记录、设置、技能、插件配置全在 `~/.dsh` 一个目录里。误删了、改坏了、换电脑了——有备份就能找回来。密码等敏感文件不进备份包,还支持定时自动备份和 GitHub 云同步(细节见[进阶文档](docs/advanced.zh.md))。
|
|
13
13
|
|
|
14
|
+
最近的更新:**0.9.0** 带来会话日志体检与定点修复(`/backup doctor`)、宿主起不来也能用的进程外救援通道(备份目录里的 dsh-rescue / 双击启动器)、恢复失败自动回滚与结果导向回执,以及智能备份:宿主升级前自动快照、损坏会话先隔离再入档防轮换毁掉好副本、每日/每周分级保留。**0.8.0** 可以在面板里直接改备份设置(备份目录、保留份数、排除模式),保存立即生效、写入 settings.yaml,不用重启;两处同时改会产生冲突提示,不会静默覆盖。**0.7.x** 新增了凭据脱敏(本机 vault)和跨机恢复。
|
|
15
|
+
|
|
14
16
|
## 安装
|
|
15
17
|
|
|
18
|
+
包发布在 [npm](https://www.npmjs.com/package/@xiaoyuyu6420/dsh-backup) 上,装进 DSH profile 用:
|
|
19
|
+
|
|
16
20
|
```sh
|
|
17
21
|
dsh plugin --profile web add @xiaoyuyu6420/dsh-backup
|
|
18
22
|
# 或者从 GitHub 安装:
|
|
@@ -38,10 +42,12 @@ dsh plugin --profile web add github:xiaoyuyu6420/dsh-backup
|
|
|
38
42
|
| 恢复 | `/backup restore latest`(`--dry-run` 先预览) |
|
|
39
43
|
| 列出备份 | `/backup list` |
|
|
40
44
|
| 校验是否完好 | `/backup verify [前缀\|all]` |
|
|
45
|
+
| 会话日志体检/修复 | `/backup doctor`(`--repair [前缀\|latest]` 从备份定点修复) |
|
|
46
|
+
| **彻底损坏自救** | 双击备份目录里的「点我恢复」文件,或 `node rescue.mjs`——零依赖救援网页,DSH 起不来也能恢复 |
|
|
41
47
|
| 删除某份备份 | `/backup delete <前缀\|latest>` |
|
|
42
48
|
| 保留份数(默认 7) | `/backup --keep N` |
|
|
43
49
|
|
|
44
|
-
|
|
50
|
+
不敲命令也行:`dsh web` → 设置 → 插件 → 备份 里有可视化面板——列备份、校验/恢复/删除,0.8.0 起还能直接改备份设置(目录、保留份数、排除模式),立即生效不用重启。
|
|
45
51
|
|
|
46
52
|
## 换新电脑
|
|
47
53
|
|