@xiaoyuyu6420/dsh-backup 0.13.0 → 0.13.2

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.en.md CHANGED
@@ -5,6 +5,7 @@
5
5
  [![Downloads](https://img.shields.io/npm/dw/@xiaoyuyu6420/dsh-backup)](https://www.npmjs.com/package/@xiaoyuyu6420/dsh-backup)
6
6
  [![Publish to npm](https://github.com/xiaoyuyu6420/dsh-backup/actions/workflows/publish.yml/badge.svg)](https://github.com/xiaoyuyu6420/dsh-backup/actions/workflows/publish.yml)
7
7
  [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
8
+ [![Stars](https://img.shields.io/github/stars/xiaoyuyu6420/dsh-backup?style=flat&color=f5c518)](https://github.com/xiaoyuyu6420/dsh-backup/stargazers)
8
9
  [![Listed on DSH Directory](https://dsh.directory/badges/listed.svg)](https://dsh.directory/plugins/xiaoyuyu6420/dsh-backup)
9
10
 
10
11
  English | [简体中文](README.md)
@@ -47,7 +48,7 @@ Prefer clicking? There's a visual panel in `dsh web` → Settings → Plugins
47
48
 
48
49
  ## Install
49
50
 
50
- Requires macOS / Linux / Windows 10+ (ships `tar`) and DSH `0.1.1-rc.2`+ (the 0.1.1 / 0.1.2 / 0.1.5 trains are all tested; verified up to `0.1.5-rc.2`).
51
+ Requires macOS / Linux / Windows 10+ (ships `tar`) and DSH `0.1.1-rc.2`+ (the 0.1.1 / 0.1.2 / 0.1.5 / 0.1.6 / 0.1.7 trains are all tested; the 0.2.0 train is adapted and pending release — see the [compatibility matrix](docs/compatibility.md) for the current status).
51
52
 
52
53
  ```sh
53
54
  dsh plugin --profile web add @xiaoyuyu6420/dsh-backup
@@ -137,6 +138,7 @@ Tried it? Tell us what broke, what's missing, what you liked — it directly sha
137
138
  <details>
138
139
  <summary>Recent releases</summary>
139
140
 
141
+ - **0.13.1** — Two panel fixes, both from user reports: ① **the panel tab silently disappears on host 0.1.6+** (#94, @jackovibe): since 0.1.6 the host requires a `create()` lazy factory on strict codecs in client Remote contributions (older hosts only read `schema`); without it `$mount` throws during validation with only a console log, so the tab is never registered. Fix: `strictCodec()` now provides both `schema` and `create()` sharing one zod instance; `$mount` waits declaratively for the `remote` service (0.1.6 settles client modules by dependency graph); and a new `BackupTabFallback` **degraded tab** shows a visible hint plus command pointers if the mount ever fails — no more silent disappearance. peers/engines gain `^0.1.6-alpha.1 || ^0.1.7-alpha.1` (verified on real hosts 0.1.6-alpha.2 / 0.1.7-alpha.2 / 0.1.7-rc.1 / 0.1.7-rc.2). ② **the "GitHub Token" save button errored** (#97, @CheeseTJ): the client `panel` proxy never re-exported `setGithubToken` (that RPC landed in the host half in 0.12.0 and the omission lay dormant while no UI called it). Fix: wire it up, plus a new smoke-client assertion that the panel surface must mirror the contribution descriptors one-for-one.
140
142
  - **0.13.0** — Update awareness + one-command self-update: ① `/backup check-update` and a new "Plugin updates" card in the panel — checks the npm registry for a newer version (8s timeout, degrades silently offline, never blocks the plugin); when a newer version exists an "Update to x.y.z" button appears; the `updateCheck` setting (default off) silently checks on panel open. ② `/backup update [--profile <name>]` — takes a `dsh-pre-upgrade-` snapshot automatically before updating (roll back with `/backup restore`), then runs the official `dsh plugin --profile <name> update` (pnpm semantics; the plugin never rewrites its own dependency files), and tells you to restart dsh web afterwards. Note: the host settles the plugin Loader tree at startup and plugins are pnpm dependencies of the profile, so true hot-swap (no restart) is not possible in the current host architecture — one-command update + restart is the best form it can take.
141
143
  - **0.12.2** — Fix a Windows data-safety hazard (#88, thanks @Liuyeyuyangy0 for the outstanding report): when `DSH_HOME` sits directly under a drive root (e.g. `D:\dsh_data`), the string-slice parent computation degrades to the bare drive letter `D:`, and `tar -C D:` fails on both bsdtar and GNU tar — worse, tar creates the `-f` target before writing, leaving a 29-byte empty shell that the panel lists as a normal backup (no `.sha256`/`.meta.json`; silently zero usable backups, and the restore / doctor repair / rescue channels are hit by the same bug). All 7 tar `-C` call sites (backup, typed & full restore, doctor point-repair, rescue snapshot/restore/repair) now receive a separator-completed parent; `paths()` normalizes trailing slashes off `DSH_HOME` like `HOME` (a trailing slash used to empty the tar positional and produce 0-byte archives); failed tar runs now delete the empty shell before rethrowing, so failures are visible. Smoke gains scenario 28 (four path-layout assertions + a trailing-slash real-backup e2e). Archive format, settings and RPC unchanged.
142
144
  - **0.12.1** — Fix client bundle leaking top-level `var module` / `var exports` as globals (#85, thanks @geyonder): the CJS shim now lives inside the `__ModuleLoader__.load` factory body instead of creating `window.module`, which made Monaco's AMD loader (dsh-vscode-mode and friends) misdetect a Node environment and break sibling plugins on the same page. Client smoke suite gains a classic-script global-leak regression assertion (`vm.runInContext`). Client-half only; node-side behavior and archive format unchanged.
@@ -163,6 +165,10 @@ Retention policy, credential redaction internals, GitHub sync, restore safeguard
163
165
  - [@mlosun](https://github.com/mlosun) — the thorough reproduction and root cause report in #2
164
166
  - [@Choi-Peng](https://github.com/Choi-Peng) — triage help pointing affected users to the fix in #5
165
167
 
168
+ ## Support this project
169
+
170
+ If dsh-backup has been useful: ⭐ [a star](https://github.com/xiaoyuyu6420/dsh-backup) is the simplest way to say thanks — and it helps other DSH users find it. Questions or ideas? Drop them in the [feedback thread](https://github.com/xiaoyuyu6420/dsh-backup/discussions/32).
171
+
166
172
  ## License
167
173
 
168
174
  MIT
package/README.md CHANGED
@@ -5,6 +5,7 @@
5
5
  [![Downloads](https://img.shields.io/npm/dw/@xiaoyuyu6420/dsh-backup)](https://www.npmjs.com/package/@xiaoyuyu6420/dsh-backup)
6
6
  [![Publish to npm](https://github.com/xiaoyuyu6420/dsh-backup/actions/workflows/publish.yml/badge.svg)](https://github.com/xiaoyuyu6420/dsh-backup/actions/workflows/publish.yml)
7
7
  [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
8
+ [![Stars](https://img.shields.io/github/stars/xiaoyuyu6420/dsh-backup?style=flat&color=f5c518)](https://github.com/xiaoyuyu6420/dsh-backup/stargazers)
8
9
  [![Listed on DSH Directory](https://dsh.directory/badges/listed.svg)](https://dsh.directory/plugins/xiaoyuyu6420/dsh-backup)
9
10
 
10
11
  [English](README.en.md) | 简体中文
@@ -43,11 +44,13 @@ sha256: 8f9ae6322ef782d21554981cf4547220d5bb3e64d7964a883317415ad54e3cbb
43
44
  | 「备份悄悄坏了没人知道」 | 每份归档带 sha256,`/backup verify all` 随时体检;每日/每周分级保留,留得住有用的历史 |
44
45
  | 「我会忘记备份」 | `/backup auto 12`——每 12 小时自动跑,重启不中断,旧副本自动轮换(默认保留 7 份) |
45
46
 
47
+ **遇到具体报错?** 按症状与报错原文查的排错手册:[故障排查](docs/troubleshooting.zh.md)(会话打不开、29 字节空包、面板消失、Token 按钮报错、换机迁移……各条的版本与修法都写明)。
48
+
46
49
  ![备份设置](docs/assets/panel-settings.png)
47
50
 
48
51
  ## 安装
49
52
 
50
- 要求:macOS / Linux / Windows 10+(自带 `tar`),DSH `0.1.1-rc.2`+(0.1.1 / 0.1.2 / 0.1.5 列车均已实测,最新验证至 `0.1.5-rc.2`)。
53
+ 要求:macOS / Linux / Windows 10+(自带 `tar`),DSH `0.1.1-rc.2`+(0.1.1 / 0.1.2 / 0.1.5 / 0.1.6 / 0.1.7 列车均已实测,0.2.0 列车已适配待发版;当前兼容状态见 [兼容性矩阵](docs/compatibility.md))。
51
54
 
52
55
  ```sh
53
56
  dsh plugin --profile web add @xiaoyuyu6420/dsh-backup
@@ -137,6 +140,7 @@ dsh plugin --profile web add github:xiaoyuyu6420/dsh-backup
137
140
  <details>
138
141
  <summary>最近的版本</summary>
139
142
 
143
+ - **0.13.1** —— 修复两个面板问题(均感谢用户报告):① **0.1.6+ 宿主上面板标签静默消失**(#94,@jackovibe):宿主 0.1.6 起要求客户端 Remote 贡献的 strict codec 带 `create()` 惰性工厂(旧版只读 `schema`),缺失时 `$mount` 在校验阶段抛错且只有 console 日志——标签页因此永不注册。修法:`strictCodec()` 同时提供 `schema` 与 `create()`,两代宿主共用同一 zod 实例;`$mount` 改为声明式等待 `remote` 服务就绪(0.1.6 客户端模块按依赖图结算);并新增 `BackupTabFallback` **降级标签页**——万一挂载失败会在面板位置给出可见提示与命令指路,不再静默消失。peers/engines 追加 `^0.1.6-alpha.1 || ^0.1.7-alpha.1`(0.1.6-alpha.2 / 0.1.7-alpha.2 / 0.1.7-rc.1 / 0.1.7-rc.2 实机验证通过)。② **「GitHub Token」保存按钮报错**(#97,@CheeseTJ):客户端 `panel` 代理漏接了 `setGithubToken`(该 RPC 0.12.0 加入宿主半时即漏,因当时面板无入口而潜伏两版)。修法:补接该行,并给 smoke-client 加「panel 面必须与贡献 descriptors 一一对应」的防漏断言。
140
144
  - **0.13.0** —— 更新感知 + 一键更新(#A+B):① `/backup check-update` 与面板「插件更新」卡——查 npm 最新版(8s 超时、断网静默降级,绝不阻断运行),发现新版即出现「更新到 x.y.z」按钮;设置项 `updateCheck`(默认关)开启后打开面板自动静默检查一次(本插件不联网上报,检查只读 registry)。② `/backup update [--profile 名]` 一键更新——更新前自动留 `dsh-pre-upgrade-` 升级前快照(失败可 `/backup restore` 回滚),再走官方 `dsh plugin --profile <名> update`(pnpm 语义,插件不自己覆写依赖文件),完成提示重启 dsh web 生效。说明:宿主在启动时结算插件 Loader 树、插件是 profile 的 pnpm 依赖,**运行中热替换(不重启生效)在宿主现行架构下不可行**——一键更新 + 重启是此架构下的最佳形态。
141
145
  - **0.12.2** —— 修复 Windows 数据安全隐患(#88,感谢 @Liuyeyuyangy0 出色的报告):`DSH_HOME` 位于盘符根目录(如 `D:\dsh_data`)时,求父目录的字符串截取退化成裸盘符 `D:`,`tar -C D:` 在 bsdtar/GNU tar 下必然失败——而 tar 失败前已创建归档文件,留下 29 字节空壳被面板当正常备份列出(无 `.sha256`/`.meta.json`,静默零可用备份;恢复、doctor 修复、rescue 救援通道同样中招)。备份/恢复/修复/救援共 7 处 tar `-C` 统一改传补过分隔符的父目录;`paths()` 对 `DSH_HOME` 补上与 HOME 一致的尾斜杠归一化(尾斜杠曾让 tar 位置参数变空串、产出 0 字节坏包);tar 失败路径删除空壳归档再抛错,失败不再静默。smoke 新增场景 28(四种路径布局断言 + 尾斜杠真实备份 e2e)。归档格式、设置项、RPC 均不变。
142
146
  - **0.12.1** —— 修复 client bundle 顶层 `var module` / `var exports` 泄漏为全局变量(#85,感谢 @geyonder 报告):CJS shim 移入 `__ModuleLoader__.load` factory 体内,不再创建 `window.module`——此前会把 Monaco 的 AMD loader(dsh-vscode-mode 等)误判成 Node 环境并破坏同页插件。冒烟测试新增经典脚本全局泄漏回归断言(`vm.runInContext`)。纯 client 半区修复,node 侧行为与归档格式不变。
@@ -163,6 +167,10 @@ dsh plugin --profile web add github:xiaoyuyu6420/dsh-backup
163
167
  - [@mlosun](https://github.com/mlosun) —— #2 中详尽的复现与根因报告
164
168
  - [@Choi-Peng](https://github.com/Choi-Peng) —— #5 中协助把受影响用户指引到修复版本
165
169
 
170
+ ## 支持这个项目
171
+
172
+ 如果 dsh-backup 帮到了你:⭐ [给个 Star](https://github.com/xiaoyuyu6420/dsh-backup) 是最直接的鼓励,也能让更多 DSH 用户找到它。遇到问题或有想法,欢迎到[反馈帖](https://github.com/xiaoyuyu6420/dsh-backup/discussions/32)留言。
173
+
166
174
  ## 许可证
167
175
 
168
176
  MIT