dsh-profile-config-sync 0.6.46 → 0.7.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.en.md +51 -7
- package/README.md +66 -17
- package/client.js +258 -155
- package/docs/CHANGELOG.md +6 -4
- package/docs/REFERENCE.md +39 -3
- package/index.js +1080 -351
- package/package.json +6 -4
- package/release-notes.json +7 -0
- package/runtime/contract.mjs +10 -3
- package/runtime/conversations.mjs +433 -0
- package/runtime/extra-rules.mjs +238 -0
- package/runtime/install-plugin.mjs +279 -0
- package/runtime/install-plugin.ps1 +60 -1
- package/runtime/platform.mjs +198 -5
- package/runtime/porting.mjs +319 -0
- package/runtime/post-exit.mjs +347 -0
- package/runtime/post-exit.ps1 +80 -1
- package/runtime/settings-sources.mjs +46 -0
- package/runtime/sync-engine.mjs +1190 -52
- package/runtime/webdav.mjs +247 -24
- package/runtime/zip.mjs +156 -0
package/README.en.md
CHANGED
|
@@ -32,7 +32,7 @@ Based on [QcWyGm/dsh-config-sync-plugin](https://github.com/QcWyGm/dsh-config-sy
|
|
|
32
32
|
- **Panel health check**: local / cloud badges (cloud re-checked every two minutes), version contract, bundle, dependencies, backup snapshots, last sync, and a to-do list with jump links.
|
|
33
33
|
- **Safety boundaries**: browser profiles and credential stores are blocked at three independent layers (capture, upload, engine); three per-file size tiers (>100 MB skipped at capture, ≥95 MB dropped before commit, 50–95 MB warn only); both sides of a conflict are kept; path-traversal guards.
|
|
34
34
|
- **Pending counts match the executor**: 12 groups on Windows, only the four groups the engine really syncs on macOS/Linux.
|
|
35
|
-
- **Self-update**:
|
|
35
|
+
- **Self-update**: checks the npm registry only (never GitHub) and downloads / installs from the panel.
|
|
36
36
|
|
|
37
37
|
**Four keywords**: **configure** · **back up** · **sync** · **restore**.
|
|
38
38
|
|
|
@@ -44,11 +44,11 @@ Package name **`dsh-profile-config-sync`** (the npm package `dsh-config-sync` is
|
|
|
44
44
|
|
|
45
45
|
| Method | Entry |
|
|
46
46
|
|---|---|
|
|
47
|
-
| npm | `npm i dsh-profile-config-sync` — **
|
|
48
|
-
| Plugin market | Search “Config Backup & Sync” in the client's plugin market
|
|
49
|
-
| Offline tgz | `pnpm add ./dsh-profile-config-sync-0.6.
|
|
47
|
+
| npm | `npm i dsh-profile-config-sync` — **the same version the panel self-update checks**; the `latest` tag points at it |
|
|
48
|
+
| Plugin market | Search “Config Backup & Sync” in the client's plugin market — `market-index.json` registers `source.type: npm`, so the online registry version is what gets installed |
|
|
49
|
+
| Offline tgz | `pnpm add ./dsh-profile-config-sync-0.6.49.tgz` |
|
|
50
50
|
|
|
51
|
-
**Release status**: the latest release is [`v0.6.
|
|
51
|
+
**Release status**: the latest release is [`v0.6.48`](https://github.com/huanyu-a/dsh-profile-config-sync/releases/tag/v0.6.48) (2026-11-28); 0.6.49 (macOS fixes) is verified on a local branch and not published yet; the repository is public and the npm package publishes alongside (`npm i dsh-profile-config-sync`).
|
|
52
52
|
|
|
53
53
|
## HTTP route admission
|
|
54
54
|
|
|
@@ -132,6 +132,47 @@ Details, raw first-push/first-pull output and the five classic pitfalls: [docs/R
|
|
|
132
132
|
- Cloud emptiness is probed with `ls-remote` + a shallow bare fetch (15 s timeout); unreachable means “pull only”.
|
|
133
133
|
- Settings live in `~\.dsh\dsh-config-sync.json` (machine-local, never committed); the SSH key path is stored, but may be left empty for `.ssh\config`.
|
|
134
134
|
|
|
135
|
+
## WebDAV: when a third-party server refuses the connection
|
|
136
|
+
|
|
137
|
+
WebDAV reuses the same repository layout and only swaps the transport (no git, no remote repository). Fill in the URL, account, password and remote folder in the panel's "Cloud repo & transport" card.
|
|
138
|
+
|
|
139
|
+
| Item | Notes |
|
|
140
|
+
|---|---|
|
|
141
|
+
| **User-Agent** | Optional client name (e.g. `Mozilla/5.0`, `davfs2/1.6.1`). Some third-party DAV servers (Synology / Jianguoyun / self-hosted) allow or block by UA — on 403, put the client name they expect. **Blank = no User-Agent header is sent at all** |
|
|
142
|
+
| Allowed UA characters | A single line of visible ASCII: no newlines, no CJK, no tabs, at most 200 characters. An invalid value is rejected with an explicit error instead of being silently stored as empty |
|
|
143
|
+
| URL | The server root (e.g. `https://dav.example.com/dav`); the subfolder goes into "Remote dir" |
|
|
144
|
+
| Authentication | Basic (account + password). The password stays in the machine-local `dsh-config-sync.json`; the panel only shows "set / not set" and never echoes it |
|
|
145
|
+
| Transport safety | Plain `http` is refused by default (credentials in clear text); set `DSH_SYNC_ALLOW_INSECURE=1` to allow it |
|
|
146
|
+
|
|
147
|
+
**When it fails, the reason is now specific** (since 0.6.48 the status code decides the message instead of one vague "cannot connect"):
|
|
148
|
+
|
|
149
|
+
| Symptom | Meaning |
|
|
150
|
+
|---|---|
|
|
151
|
+
| Auth failed (401) | Wrong username or password, or the service wants an app password / token |
|
|
152
|
+
| Forbidden (403) | The account has no access to that folder; it may also be blocked by User-Agent → set the client name it expects |
|
|
153
|
+
| 404 | No such folder under that URL → check that the URL is the server root and the folder is in "Remote dir" |
|
|
154
|
+
| PROPFIND not allowed (405 / 501) | This may not be a standard WebDAV endpoint, or it needs a path prefix |
|
|
155
|
+
| Unreachable / timeout | Check the URL, network and certificate (self-signed certs must be trusted by the system) |
|
|
156
|
+
|
|
157
|
+
"Test" also reports **the User-Agent actually sent**, so you can tell a client filter from another cause.
|
|
158
|
+
|
|
159
|
+
## Feedback (with screenshots and screen recordings)
|
|
160
|
+
|
|
161
|
+
The last panel section, "Feedback": write a title and details → **submitting creates a GitHub Issue** (label `feedback`); every machine sees the same list, and "Resolve" closes it.
|
|
162
|
+
|
|
163
|
+
**Attachments (since 0.6.48)**: screenshots and recordings are the most telling evidence in "the UI looks wrong" or "the sync failed" reports, and until now they could only be described in words. Files can now be attached directly:
|
|
164
|
+
|
|
165
|
+
| Item | Notes |
|
|
166
|
+
|---|---|
|
|
167
|
+
| Accepted types | Images (png / jpg / jpeg / gif / webp / bmp / svg), videos (mp4 / mov / webm), text (log / txt / md / json) |
|
|
168
|
+
| Count and size | Up to 4 files, 20 MB each |
|
|
169
|
+
| Where they live | Uploaded as **release assets of the feedback repo itself** (GitHub's asset interface exists only for releases, not issues) and referenced from the issue body — no third-party image host, readable from any machine, and independent of your local file still existing. The attachments hang on a **draft release** (tag `feedback-assets`), so they never show up on the Releases page |
|
|
170
|
+
| Body reference | Images use Markdown image syntax (shown inline); videos and logs use a plain link (click to download / play) |
|
|
171
|
+
| A token is required | Uploading assets needs a GitHub token. Without one the panel opens the prefilled browser page and **tells you explicitly that the attachments were not uploaded** — ask you to drag them in; they are never dropped silently |
|
|
172
|
+
| No network | Uploaded attachment URLs are kept in the local queue, so "Flush" references them instead of uploading twice |
|
|
173
|
+
|
|
174
|
+
Rejected attachments (wrong type, too large, unreadable) are reported one by one — the panel never pretends everything went along.
|
|
175
|
+
|
|
135
176
|
## Sync scope
|
|
136
177
|
|
|
137
178
|
All **12 groups are checked by default**; each group and each item can be unchecked, and unchecking stops both capture and restore.
|
|
@@ -175,9 +216,12 @@ Details (process detection, lock file, environment cleanup, exit codes): [docs/R
|
|
|
175
216
|
|
|
176
217
|
## Self-update
|
|
177
218
|
|
|
178
|
-
The panel card shows local
|
|
219
|
+
The panel card shows the local version and the version on **npm only — GitHub is never checked**. Status is one of: up to date / update available / downloaded (in `~\.dsh\update-staging\`) / installed pending restart / check failed.
|
|
179
220
|
|
|
180
|
-
|
|
221
|
+
- The version comes from npm's `dist-tags.latest`; the download URL and checksums come from that version's document (`dist.tarball` / `dist.integrity` / `dist.shasum`); release notes come from `version.json` inside the package. The old GitHub manifest sources (`gh-proxy` / `ghfast` / raw / API) are retired.
|
|
222
|
+
- **The checksum comes from the same source as the artifact.** The npm tarball is not the same byte stream as the GitHub release asset — measured: `npm pack` is byte-identical to the registry tarball, but both differ from the `pnpm pack` asset. Verifying an npm download against the packaging-time sha256 can therefore never succeed; the registry's own `integrity` (sha512 SRI) / `shasum` (sha1) is used instead.
|
|
223
|
+
- The registry can be overridden (`updateRegistry` setting, or the `DSH_CONFIG_SYNC_NPM_REGISTRY` env var) — still npm-only, just a different registry.
|
|
224
|
+
- Download and install are separate steps, and installing quits the client, backs up the old directory, overwrites and relaunches once.
|
|
181
225
|
|
|
182
226
|
## Upstream & license
|
|
183
227
|
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](LICENSE)
|
|
8
8
|
[](#同步内容勾选)
|
|
9
9
|
[](#同步内容勾选)
|
|
10
|
-
[](#自检)
|
|
11
11
|
|
|
12
12
|
中文 | [English](README.en.md)
|
|
13
13
|
|
|
@@ -34,7 +34,7 @@ DSH 的配置散在 `~/.dsh` 的十几处:profile、全局提示、Skills、Ag
|
|
|
34
34
|
- **面板体检**:本机 / 云端双徽标(云端每 2 分钟复查)、版本契约、bundle、依赖、备份快照、上次同步、待办跳转。
|
|
35
35
|
- **安全边界**:浏览器剖面与凭据库在抓取、上传、引擎三处独立硬拦;单文件上限三档(>100 MB 抓取即跳过、≥95 MB 提交前剔除、50–95 MB 只警告);冲突两侧留副本;路径遍历防护。
|
|
36
36
|
- **待推送口径跟执行体一致**:Windows 按 12 组统计,macOS / Linux 只统计引擎真会同步的 4 组,不虚报。
|
|
37
|
-
-
|
|
37
|
+
- **自更新**:只查 npm registry(不看 GitHub),面板内检查、下载、安装。
|
|
38
38
|
|
|
39
39
|
**四个关键词**:**配置**(12 组按需抓取)· **备份**(仓库即快照,Git 有历史)· **同步**(一台推、一台拉)· **还原**(铺回本机,可回滚)。
|
|
40
40
|
|
|
@@ -47,7 +47,7 @@ DSH 的配置散在 `~/.dsh` 的十几处:profile、全局提示、Skills、Ag
|
|
|
47
47
|
| [安装](#install) | [从零开始](#quickstart) | [面板](#panel) | [同步内容](#groups) |
|
|
48
48
|
|---|---|---|---|
|
|
49
49
|
| [脚本](#scripts) | [还原备份](#restore) | [插件数据](#plugindata) | [自动同步](#automation) |
|
|
50
|
-
| [仓库 / 云端](#repos) | [工作区与会话](#crossplatform) | [接口](#api) | [来源与版权](#credits) |
|
|
50
|
+
| [仓库 / 云端](#repos) | [WebDAV](#webdav) | [问题反馈](#feedback) | [工作区与会话](#crossplatform) | [接口](#api) | [来源与版权](#credits) |
|
|
51
51
|
|
|
52
52
|
[历史版本细节](docs/HISTORY.md) · [完整实测记录](docs/CHANGELOG.md) · [字段与接口参考](docs/REFERENCE.md)
|
|
53
53
|
|
|
@@ -62,10 +62,10 @@ DSH 的配置散在 `~/.dsh` 的十几处:profile、全局提示、Skills、Ag
|
|
|
62
62
|
| 方式 | 命令 / 入口 |
|
|
63
63
|
|---|---|
|
|
64
64
|
| npm | `npm i dsh-profile-config-sync`(**已发布到与 GitHub Release 相同的版本**,`latest` 标签指的就是它) |
|
|
65
|
-
| 插件市场 | 客户端「插件市场 →
|
|
66
|
-
| 离线 tgz | `pnpm add ./dsh-profile-config-sync-0.6.
|
|
65
|
+
| 插件市场 | 客户端「插件市场 → 发现」搜「配置备份与同步」(`market-index.json` 登记的 `source.type` 是 `npm`,装的就是 registry 上的在线版) |
|
|
66
|
+
| 离线 tgz | `pnpm add ./dsh-profile-config-sync-0.6.49.tgz`(内网机器用这个) |
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
**发布状态**:`v0.6.49`(macOS 全面可用 + 平台分区)已在本机验证并打 tag;npm 上的同名包同步发布(`npm i dsh-profile-config-sync`)。多端测试安装:`pnpm add ./dsh-profile-config-sync-0.6.49.tgz` 或从 npm 安装。
|
|
69
69
|
|
|
70
70
|
要正式发布时(需要有权限的账号,我不会擅自 push):
|
|
71
71
|
|
|
@@ -74,7 +74,7 @@ gh release create v<版本> dsh-profile-config-sync-<版本>.tgz \
|
|
|
74
74
|
--repo huanyu-a/dsh-profile-config-sync --title "v<版本>" --notes-file <发布说明.md>
|
|
75
75
|
# tag 与包名必须是同一个版本号,别像旧文档那样写成 v0.6.39 配 0.6.44 的包
|
|
76
76
|
git tag -a v<版本> -m "v<版本>" && git push origin v<版本>
|
|
77
|
-
# 发布后把仓库根的 version.json
|
|
77
|
+
# 发布后把仓库根的 version.json 更新到新版本并推上去:它随 npm 包一起发布(files 里有它),面板读的是包内那份
|
|
78
78
|
# (version.json 不在 npm 包里,files 字段没有它)
|
|
79
79
|
```
|
|
80
80
|
|
|
@@ -188,7 +188,33 @@ pwsh -File runtime\sync.ps1 pull -RepoRoot <仓库目录> -DshHome <~\.dsh> -A
|
|
|
188
188
|
| 认证 | SSH 填私钥路径;HTTPS 用 Git 凭据管理器,插件不存密码 |
|
|
189
189
|
| 单文件上限 | 三档:源头 >100 MB 抓取时跳过、≥95 MB 提交前剔除、50–95 MB 只警告 |
|
|
190
190
|
|
|
191
|
-
私有库:优先 SSH
|
|
191
|
+
私有库:优先 SSH 地址。插件**自身更新**只查 npm,与本机配置的 Git 远端无关,所以换成私有库也不影响自更新(也不用再为它配令牌)。
|
|
192
|
+
|
|
193
|
+
<a id="webdav"></a>
|
|
194
|
+
|
|
195
|
+
## WebDAV:第三方服务连不上时
|
|
196
|
+
|
|
197
|
+
WebDAV 与 git 共用同一份仓库格式,只换传输层(不依赖 git、不需要远端仓库)。面板「云端仓库与同步方式」卡里填地址、账号、密码与远端目录即可。
|
|
198
|
+
|
|
199
|
+
| 项 | 说明 |
|
|
200
|
+
|---|---|
|
|
201
|
+
| **User-Agent** | 可填客户端名(如 `Mozilla/5.0`、`davfs2/1.6.1`)。部分第三方 DAV(群晖 / 坚果云 / 自建)按 UA 放行或拦截,报 403 时填它要求的那个。**留空 = 完全不发 User-Agent 头** |
|
|
202
|
+
| 允许的 UA 字符 | 单行可见 ASCII,不含换行 / 中文 / 制表符,不超过 200 字符;填了非法值会明确报错,不会静默存成空 |
|
|
203
|
+
| 地址 | 填到根(如 `https://dav.example.com/dav`),子目录单独填在「远端目录」 |
|
|
204
|
+
| 认证 | Basic(账号 + 密码)。密码只存本机 `dsh-config-sync.json`,面板只显示「已设置 / 未设置」,永不明文回显 |
|
|
205
|
+
| 传输安全 | 默认拒绝 http(明文传密码);确需使用请设 `DSH_SYNC_ALLOW_INSECURE=1` |
|
|
206
|
+
|
|
207
|
+
**连不上时看具体原因**(0.6.48 起按状态码分开说,不再一律显示「连不上或认证失败」):
|
|
208
|
+
|
|
209
|
+
| 现象 | 含义 |
|
|
210
|
+
|---|---|
|
|
211
|
+
| 认证失败(401) | 用户名或密码不对,或这个服务要求应用专用密码 / Token |
|
|
212
|
+
| 被拒绝(403) | 账号没有这个目录的权限;也可能被 User-Agent 拦截 → 填上它要求的客户端名 |
|
|
213
|
+
| 404 | 地址下没有这个目录 → 确认地址填到根、目录填在「远端目录」 |
|
|
214
|
+
| 不支持 PROPFIND(405 / 501) | 这可能不是标准 WebDAV 入口,或需要带路径前缀 |
|
|
215
|
+
| 连不上 / 超时 | 检查地址、网络与证书(自签名证书需加入系统信任库) |
|
|
216
|
+
|
|
217
|
+
「测试连接」会同时报出**实际发出去的 User-Agent**,方便确认是服务端按客户端过滤还是别的原因。
|
|
192
218
|
|
|
193
219
|
## 有文件没同步上时
|
|
194
220
|
|
|
@@ -346,6 +372,25 @@ push 失败时会**按真实远端地址归因**:https 走 `ls-remote` 检查
|
|
|
346
372
|
|
|
347
373
|
被拦的路径段:`browser-profiles`、`User Data`、`Login Data`、`Login Data For Account`、`Cookies`、`Web Data`、`Secure Preferences`、`Local State`、`History`、`Top Sites`、`Current Session`、`Current Tabs`。规则只看路径不看体积,所以「插件把剖面放得更深」也拦得住。
|
|
348
374
|
|
|
375
|
+
<a id="feedback"></a>
|
|
376
|
+
|
|
377
|
+
## 问题反馈(带截图与录屏)
|
|
378
|
+
|
|
379
|
+
面板最后一区的「问题反馈」:写标题与详情 → **提交即建 GitHub Issue**(label `feedback`),另一台机器打开面板看到的是同一份列表;点「已解决」就关单。
|
|
380
|
+
|
|
381
|
+
**附件(0.6.48 起)**:截图与录屏是「界面显示不对」「同步报错」这类反馈里最关键的证据,以前只能靠打字描述。现在可以直接选文件:
|
|
382
|
+
|
|
383
|
+
| 项 | 说明 |
|
|
384
|
+
|---|---|
|
|
385
|
+
| 支持的类型 | 图片(png / jpg / jpeg / gif / webp / bmp / svg)、视频(mp4 / mov / webm)、文本(log / txt / md / json) |
|
|
386
|
+
| 数量与体积 | 最多 4 个,单个 ≤ 20 MB |
|
|
387
|
+
| 存放位置 | 传成**反馈仓库自己的 release assets**(GitHub 的 asset 接口只有 release 有,Issue 没有),正文引用它 —— 不借道第三方图床,换机器、别人看都能打开,也不依赖你本机的文件还在。附件挂在一个**草稿 release**(tag `feedback-assets`)上,不会出现在 Releases 页面 |
|
|
388
|
+
| 正文引用 | 图片用 Markdown 图片语法(直接显示),视频与日志用普通链接(点开下载 / 播放) |
|
|
389
|
+
| 需要令牌 | 上传资产要 GitHub 令牌。没有令牌时走「浏览器预填页面」,面板会**明确告诉你附件没上传**,请手动拖进网页 —— 不会静默丢弃 |
|
|
390
|
+
| 网络不通 | 已上传的附件 URL 会存进本机待发队列,点「补发」时直接引用,不重复上传 |
|
|
391
|
+
|
|
392
|
+
被拒的附件(类型不对、超大、损坏)会逐条报出来,不会假装「都带上去了」。
|
|
393
|
+
|
|
349
394
|
<a id="automation"></a>
|
|
350
395
|
|
|
351
396
|
## 自动同步(默认关)
|
|
@@ -363,36 +408,40 @@ push 失败时会**按真实远端地址归因**:https 走 `ls-remote` 检查
|
|
|
363
408
|
|
|
364
409
|
## 插件自更新
|
|
365
410
|
|
|
366
|
-
|
|
411
|
+
面板「插件更新」卡:**只查 npm registry,不看 GitHub**。挂载查一次、之后每 30 分钟复查。
|
|
367
412
|
|
|
368
413
|
| 状态 | 含义 |
|
|
369
414
|
|---|---|
|
|
370
|
-
| 绿色「已是最新」 | 本地版本 ≥
|
|
371
|
-
| 橙色「有新版本」 |
|
|
415
|
+
| 绿色「已是最新」 | 本地版本 ≥ npm 上的 `latest` |
|
|
416
|
+
| 橙色「有新版本」 | npm 上更大,附说明与「下载更新」 |
|
|
372
417
|
| 橙色「已下载,待安装」 | 包在 `~\.dsh\update-staging\`,插件目录一字节没改,点「重启并安装」生效 |
|
|
373
418
|
| 橙色「已安装,待重启」 | 运行中装过但没重启 |
|
|
374
|
-
| 红色「检查失败」 |
|
|
419
|
+
| 红色「检查失败」 | npm 读不到,附「检查更新」列出失败原因 |
|
|
375
420
|
|
|
376
|
-
-
|
|
377
|
-
-
|
|
378
|
-
-
|
|
421
|
+
- **只查 npm**:版本取 `dist-tags.latest`(几十字节),下载地址与校验值取该版本单版本文档的 `dist.tarball` / `dist.integrity` / `dist.shasum`,发布说明取包内 `version.json`。GitHub 的 raw / API / gh-proxy / ghfast 四条清单源已整体退休。
|
|
422
|
+
- **校验值与被校验物同源**:npm 上的 tarball 与 GitHub release 资产**不是同一份字节流**(实测 `npm pack` 与 registry 上的 tarball 逐字节一致,但与 `pnpm pack` 的资产不同)。所以校验用 registry 自己给的 `integrity`(sha512 SRI)/ `shasum`(sha1),不用打包时算的 sha256 —— 后者对 npm 下载必然对不上。
|
|
423
|
+
- **registry 可换镜像**:设置 `updateRegistry` 或环境变量 `DSH_CONFIG_SYNC_NPM_REGISTRY`。换了也仍然只查 npm(只是换了个 registry)。
|
|
424
|
+
- **下载与安装分开**:下载只落 `update-staging` 并校验,宿主不碰插件目录;点安装才退出 → 备份旧目录 → 覆盖 → 自动拉起,全程只重启一次(运行中覆盖会让宿主把面板卸载掉,0.3.4–0.3.6 踩过)。
|
|
379
425
|
|
|
380
426
|
<a id="api"></a>
|
|
381
427
|
|
|
382
428
|
## 接口与路径
|
|
383
429
|
|
|
384
|
-
宿主挂
|
|
430
|
+
宿主挂 13 条 `/config-sync/*` 路由(`status`、`prepare`、`settings`、`auto`、`update`、`scope`、`extra-config`、`conflict`、`roots`、`feedback`、`cache-guard`、`workspace-view`、`webdav`),跨站请求 403。完整请求/响应形状、路径解析顺序、本机私有文件清单见 [docs/REFERENCE.md](docs/REFERENCE.md#api)。
|
|
385
431
|
|
|
386
432
|
**边界**:`capture` 要读 `cordis.patch.yml`,运行时这文件正被应用持有(抓到半截);`apply` 写完 DSH 退出时又会回写覆盖。所以边界固定为——判断该跑什么、把命令写好,退出 DSH 后执行。
|
|
387
433
|
|
|
388
434
|
## 自检
|
|
389
435
|
|
|
390
|
-
`node tools\selftest.mjs
|
|
436
|
+
`node tools\selftest.mjs`(默认在临时目录造隔离 `DSH_HOME` + 夹具,`--in-place` 才连真实 `~/.dsh`;传仓库路径可额外跑仓库就绪分支):假 ctx 拉起宿主半身,打 status、生成脚本、断言 JSON 与落地文件。`node tools\webdav-selftest.mjs`:进程内起一个最小 WebDAV 服务器(真 HTTP / 真 XML / 真落盘,只连 `127.0.0.1`),覆盖逐级 MKCOL、按 sha256 判重、冲突留底、空云端、不可达服务器与明文地址闸门——完全离线,CI 可直接跑。`node tools\clientcheck.mjs` 检查浏览器半身。`npm run verify` 依次跑这三个。都只在源码仓库里跑(安装副本不含 `tools/`)。
|
|
391
437
|
|
|
392
438
|
## 实测记录
|
|
393
439
|
|
|
394
440
|
| 日期 | 版本 | 要点 |
|
|
395
441
|
|---|---|---|
|
|
442
|
+
| 2026-11-28 | 0.6.49 | **macOS 全面可用**(本机切到 macOS 后集中修 Windows 假设):① 客户端根 `isAppRoot` 只认 `<root>/resources`,`.app` bundle 永远认不出 → AppRoot 为空、面板报「定位不到客户端根目录」;改按 `Contents/Resources` 归一。② app / Electron 版本写死 `<root>/resources/app.asar` 与 `<root>/version`;改由 `runtime/platform.mjs` 读(asar 头解析 + Framework 的 Info.plist)。③ 仓库路径只探 `D:/G:/C:`,且 POSIX 上把 `D:\dsh-config` 当相对路径真建目录;改默认 `~/dsh-config` + 按平台校验形状。④ 退出后同步只找 `post-exit.ps1`(macOS 上 spawn powershell 必 ENOENT);新增 `runtime/post-exit.mjs`。⑤ 自更新只找 `install-plugin.ps1`;新增 `runtime/install-plugin.mjs`(sha256/integrity 校验 + 自己解 tarball + 回滚)。⑥ 新机器 pull 缺 `Initialize-RepoIfNeeded` 等价物 →「拉取成功、什么都没落地」;改先 ls-remote 取默认分支再 checkout 跟踪。⑦ capture 不写执行体 → 首次推送后仓库被判「不像仓库」;改与 Windows 版一样把引擎模块写进仓库根。⑧ POSIX 还原脚本裸调 restore;改与 .cmd 对齐(快照信息 → `-DryRun` → 确认 → 真跑,响应带 backup)。⑨ 面板路径占位符 / 执行体名随平台。⑩ 自检改临时隔离 `DSH_HOME`(`--in-place` 才连真机),不再把测试值写进用户配置。⑪ 云端目标卡强制编辑态下 `activeMode` 不跟随下拉框 —— 选 WebDAV 仍显示 Git 字段、保存报「请填写 WebDAV 地址」(用户实测),并停止在 WebDAV 模式下回写 git 设置。⑫ **安全**:私钥名单只有自家文件名,`id_ed25519` / `id_rsa` / `*.ppk` 这类裸名会被原样上传;改按名字 + 内容(PEM / PuTTY 头)双重拦截,上传侧与 capture 共用同一份正则。⑬ 新增 `tools/webdav-selftest.mjs`:进程内最小 WebDAV 服务器,覆盖逐级 MKCOL、sha256 判重、冲突留底、空云端、不可达、明文闸门。⑭ 后台自动拉取(启动 8 秒首检)在 macOS 上也会弹原生框,而那条路径没有请求也没有面板 —— 框被窗口挡住就等于「自动拉取永不发生」;改挂 `status.auto.pullPrompt` + 日志,由面板一键接手,Windows 保持原样。⑮ macOS 上 /var、/tmp 是指向 /private/... 的符号链接,`git rev-parse --show-toplevel` 报真实路径,而引擎按字面量比 —— 仓库放在符号链接目录(/tmp/dsh-config 或链到外置盘)时推送/拉取一进门就报「这个目录不是仓库根」;改成两边 realpath 后再比。⑯ 同步范围卡:非 Windows 只有四组真会同步,范围卡却照样列出十二组可勾 —— 现在按平台带 `supported`,不支持的组禁用并标注「此平台暂不支持」。⑰ 会话记录进 Node 引擎:`--ws-<工作区ID>--` 稳定目录名 + `session-index.json` + 四块数据字节保真;会话日志走 seq 护栏,两台机器同时写同一会话不再互相覆盖出 `seq gap`;默认工作区不参与同步。⑱ 插件数据 / 额外路径也进 Node 引擎:规则(单文件上限 / 排除通配 / 跳过目录 / 安全必需项)收进 `runtime/extra-rules.mjs`,面板与引擎共用一份;顺带修掉「每次 capture 都重写所有文本文件、谎报改动数」。⑲ profile 组补 `cordis.yml`(哪些插件开着)与 `pnpm-workspace.yaml`,入库占位符化、apply 展开成本机路径。⑳「插件设置与工作流」进 Node 引擎(14 个配置文件,清单共用 `runtime/settings-sources.mjs`),易变计数清零;凭据嗅探提到共用模块,名字 + 内容两道门(之前 settings 会把带 apiKey 的配置原样入仓)。㉑ 再补三组:技能市场台账、记忆数据(`<AppRoot>/mnemon`)、本地源码插件(`link:` 目录打包成 `local-plugins/<名字>.zip`,新写的最小 zip 读写只依赖 `node:zlib`;换机解到 `<DshHome>/local-plugins-restore/` 由用户重新 link)。顺带修「源码里出现 apikey 字样就被当凭据」的误判。㉒ 最后一组「工作区资料」进 Node 引擎,但只同步**登记表**(registry-only):仓库里是 `workspace/workspace-registry.json`(id / 标题 / 槽名 / 占位符路径 / 会话 id / 默认工作区),不搬文件树(本机 5 个工作区里有 1.9 GB 的那个);还原按 id 合并且本机优先,另存 `workspace-from-cloud.json` 备查。至此 **12 组全部支持**。㉓ 跨平台拉取护栏:另一套系统传上去的 `profile/*` 与 `prompt/AGENTS.md` 只摊到 `profile-from-cloud/`、`prompt-from-cloud/`,不覆盖本机。㉔ 跨平台时 `settings` 组那份整份工作区登记表也不铺(实测会把本机 5 个工作区换成 19 个 `D:\` 路径)。㉕ 跨平台移植 `runtime/porting.mjs`:路径按「映射表 → 环境变量 → WSL → `C:\Users` → 同名工作区」翻译,`package.json` 本机优先合并、`link:` 目标必须真有 `package.json`、`file:` 缺 tgz 就丢,bundles 同步收敛;工作区登记表翻译后按 id 合并;推送后自动删云端的 `browser-profiles`(Login Data / Cookies)。㉘ 平台分区:`profile/<平台>/`、`prompt/<平台>/AGENTS.md`、`settings/<平台>/dsh-workspaces.json`,读时本平台优先、根目录老位置只读不写 —— 一份仓库给 Windows / macOS / Linux 各用各的。㉙ 共享配置互相覆盖:`skills`/`presets` 按云端镜像(删掉本机多出来的,删前留底);㉚ 全局提示按平台分开(`prompt/<平台>/AGENTS.md`)。㉛ 契约按平台读(`profile/<平台>/host-contract.json` 优先);㉜ 会话 `session.lock` 不同步(推送时清云端历史锁)。验收:`selftest` 466 条 / `webdav-selftest` 26 条 / `webdav-selftest` 24 条 / `clientcheck` 57 条全绿 |
|
|
443
|
+
| 2026-11-28 | 0.6.48 | **修 issue #7 / #8(第三方 WebDAV 连不上)与 #9(反馈带不了截图)**:① WebDAV 卡新增 **User-Agent** 输入项(issue #8)——部分第三方 DAV(群晖 / 坚果云 / 自建)按客户端名放行或拦截,没有这一项就只能看到「连不上」。UA 留空 = **完全不发这个头**(实测:Node 的 `fetch` 永远自带 `node` 这个 UA、无法表达「不发」,所以传输层从 `fetch` 换成 `node:http`/`node:https`,并自己处理重定向与 `Content-Length`;Windows 的 PowerShell 与 macOS/Linux 的 Node 引擎都走同一个 `webdav.mjs`,行为一致)。UA 只接受单行可见 ASCII(≤ 200 字符、不含换行 / 中文 / 制表符),非法值保存时直接报错,不静默存成空。② 连不上时**按状态码分开说原因**(issue #7)——原来一律是「连不上或认证失败(PROPFIND 无响应)」,用户既不知道是密码错、还是服务不支持 PROPFIND、也不知道该改哪一项;现在 401 / 403 / 404 / 405 / 重定向 / 超时 / 证书各有一句话,并给出「该改哪一项」;「测试连接」还会报出**实际发出去的 UA**,方便区分「服务端按客户端过滤」与别的原因。③ **问题反馈支持图片 / 视频 / 日志附件**(issue #9)——走 GitHub 的 release asset 接口传成反馈仓库自己的资产,正文引用它(图片内联、视频与日志给链接),不借道第三方图床,换机器与别人看都能打开;asset 接口只有 release 有(Issue 没有),所以附件挂在草稿 release(tag `feedback-assets`)上,不会出现在 Releases 页面;上限 4 个 / 单个 20 MB、类型白名单;不合格的附件逐条报错,**没有令牌时明确告知「附件没上传、请手动拖进网页」而不是静默丢弃**;建 Issue 失败时已上传的附件 URL 存进待发队列,补发时直接引用不重复上传。④ 顺带把 README 里「宿主挂 7 条路由」的陈旧数字改成实际的 13 条。验收:`tools/selftest.mjs` 374 条断言全绿(含 40 条新增:UA 真发出去 / 留空不发 / 四类非法值被拒 / 401·403·405 原因分得开 / 404 仍算「云端是空的」 / WebDAV 上传→跳过→下载整条通路实测 / 附件白名单与正文引用)、`tools/clientcheck.mjs` 全绿;另有 6 条与本次改动无关的既有失败(需要真实远端与真实客户端安装目录的用例)在改动前后完全一致 |
|
|
444
|
+
| 2026-11-27 | 0.6.47 | **更新只查 npm + 在线安装**:更新检查整体换成读 npm registry(dist-tags 定版本、单版本文档取 dist.tarball / dist.integrity、说明取包内 version.json),GitHub 的 raw / API / gh-proxy / ghfast 四条清单源与「更新清单 / 更新令牌」两项设置一起退休;市场索引 `source.type` 从 git 改成 npm,装的就是在线版。顺带修两个真 bug:① 旧「清单记 pnpm pack 的 sha256、npm 当兜底下载」在校验那步必然失败(实测 npm pack 与 registry 上的 tarball 逐字节一致,但与 pnpm pack 的资产不同),现在校验值取自 registry 自己;② 市场索引 publishTimestamp 写成毫秒而非 Unix 秒,DSH 的 parseMarketIndex 会拒掉整个索引——插件市场里此前根本读不出这个插件。功能代码改动集中在更新链路,同步/还原逻辑未动。验收:64 套隔离夹具共 1064 条断言全绿(不含检查这份 README 的文档对账套件本身;另有 1 条权限断言在 Windows 上标 SKIP,不会假装通过) |
|
|
396
445
|
| 2026-11-27 | 0.6.46 | **徽章数字接回计数**:0.6.41 手工写死的「64 套 · 1065 条」两版没再动,与同页验收声明(1061)打脸;现在 finalize 从 `last-count.json` 直接生成,口径与验收声明一模一样(只算非元套件:64 套 · 1061 条),人手不再参与。功能代码无改动。验收:64 套隔离夹具共 1061 条断言全绿(不含检查这份 README 的文档对账套件本身;另有 1 条权限断言在 Windows 上标 SKIP,不会假装通过) |
|
|
397
446
|
| 2026-11-27 | 0.6.45 | **文档对齐现实**:① 中英 README 去掉「npm 上只到 0.4.1」的陈旧说法(改为「与 GitHub Release 同版本」,`dist-tags.latest` 即它);② 发布命令块改成同版本占位,修掉「v0.6.39 配 0.6.44 的包」的自相矛盾;③ 写清 `version.json` 不在 npm 包里、面板更新检查读的是仓库里那份。功能代码无改动。验收:64 套隔离夹具共 1061 条断言全绿(不含检查这份 README 的文档对账套件本身;另有 1 条权限断言在 Windows 上标 SKIP,不会假装通过) |
|
|
398
447
|
| 2026-11-27 | 0.6.44 | **一致性**:历史字段 `dsh.engines.dsh` 对齐顶层 `>=0.2.2-rc.5`;README 中英去掉写死的 10297,改 `127.0.0.1:<端口>`(以 `DSH_WEB_URL` 为准);审计补 2 条断言。验收:64 套隔离夹具共 1061 条断言全绿(不含检查这份 README 的文档对账套件本身;另有 1 条权限断言在 Windows 上标 SKIP,不会假装通过) |
|