ssh-net 26.10.41 → 26.10.42
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/CHANGELOG.md +11 -0
- package/README.md +7 -7
- package/libexec/cli.mjs +2 -2
- package/libexec/commands/install.mjs +4 -4
- package/libexec/commands/{upgrade.mjs → update.mjs} +4 -4
- package/libexec/lib/paths.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,17 @@
|
|
|
7
7
|
GitHub Release(Actions 自动跑测试后 npm publish;跳号与 0.x 的完整
|
|
8
8
|
考据见 git 史)。
|
|
9
9
|
|
|
10
|
+
## [26.10.42] - 2026-10-04
|
|
11
|
+
|
|
12
|
+
### 命令改名:`ssh-net upgrade` → `ssh-net update`
|
|
13
|
+
|
|
14
|
+
- 升级命令改名 `update`,行为完全不变(仍是 npm i -g @latest
|
|
15
|
+
--prefer-online + 新进程 install、ETARGET 重试、版本戳后置校验);
|
|
16
|
+
旧名不保留别名——还在 26.10.41 或更早的机器跑最后一次
|
|
17
|
+
`ssh-net upgrade` 升到本版,之后统一用 `ssh-net update`
|
|
18
|
+
- 同步更新 help、用法报错、README 与 design 的命令名;测试文件
|
|
19
|
+
commands/upgrade 对应改名为 update
|
|
20
|
+
|
|
10
21
|
## [26.10.41] - 2026-10-04
|
|
11
22
|
|
|
12
23
|
### 全仓存量复核:参数校验补齐与失败文案修正
|
package/README.md
CHANGED
|
@@ -93,18 +93,18 @@ cd ~/space/ssh-net && npm link
|
|
|
93
93
|
edge 默认装成零常驻形态,需要本地 SOCKS/VNC 转发口再
|
|
94
94
|
`ssh-net install --with-link`(转发定义在 topology 里)。
|
|
95
95
|
|
|
96
|
-
**升级**:各机跑 `ssh-net
|
|
96
|
+
**升级**:各机跑 `ssh-net update`(= `npm i -g ssh-net@latest
|
|
97
97
|
--prefer-online` 跳过缓存 dist-tags 后由新装的二进制跑 `ssh-net install`
|
|
98
98
|
刷新运行时;ETARGET 传播窗口自动重试一次)。node 机器上以 root 跑
|
|
99
99
|
(非交互 ssh 下 sudo 的 secure_path 不含 fnm,用登录 shell:
|
|
100
|
-
`ssh n007 'sudo -i ssh-net
|
|
101
|
-
|
|
100
|
+
`ssh n007 'sudo -i ssh-net update'`)。开发机(npm link 状态)不要用
|
|
101
|
+
update——重跑 `ssh-net install` 即可;发新版走 GitHub Release,由
|
|
102
102
|
Actions 跑测试后自动发布到 npm。
|
|
103
103
|
|
|
104
|
-
>
|
|
105
|
-
>
|
|
106
|
-
>
|
|
107
|
-
>
|
|
104
|
+
> 改名说明:该命令 26.10.42 起叫 `update`(原名 `upgrade`)。旧版机器
|
|
105
|
+
> 跑一次 `ssh-net upgrade` 升到新版即可;26.10.25 之前的版本两个名字都
|
|
106
|
+
> 没有,先手动跑一次
|
|
107
|
+
> `npm i -g ssh-net@latest --prefer-online && ssh-net install`。
|
|
108
108
|
|
|
109
109
|
**卸载顺序**:先 `ssh-net uninstall`(移除 launchd/systemd 作业、运行时
|
|
110
110
|
脚本与状态),再 `npm uninstall -g ssh-net`;反过来会留下反复重启的注册作业。
|
package/libexec/cli.mjs
CHANGED
|
@@ -19,11 +19,11 @@ import { run as restartRun } from './commands/restart.mjs';
|
|
|
19
19
|
import { run as statusRun } from './commands/status.mjs';
|
|
20
20
|
import { runRegister as registerRun } from './commands/register.mjs';
|
|
21
21
|
import { run as doctorRun } from './commands/doctor.mjs';
|
|
22
|
-
import { run as
|
|
22
|
+
import { run as updateRun } from './commands/update.mjs';
|
|
23
23
|
|
|
24
24
|
const COMMANDS = {
|
|
25
25
|
install: { run: installRun, desc: '按本机角色安装;edge 可带 --with-link/--without-link 管理转发附加件' },
|
|
26
|
-
|
|
26
|
+
update: { run: updateRun, desc: '一键升级(npm i -g @latest + install 按 marker 刷新运行时)' },
|
|
27
27
|
uninstall: { run: uninstallRun, desc: '停用并删除全部作业、运行时与状态(再 npm uninstall -g)' },
|
|
28
28
|
start: { run: startRun, desc: 'edge 开隧道(relay|peer,缺省或 -a=relay+peer)/ core·node 启动' },
|
|
29
29
|
stop: { run: stopRun, desc: 'edge 关隧道(relay|peer,缺省或 -a 全关)/ core·node 停服' },
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
renderEdgeLinkPlist, renderRelayPlist, renderRelayUnit, renderRoutes,
|
|
30
30
|
} from '../lib/render.mjs';
|
|
31
31
|
|
|
32
|
-
/** ensureRuntime 结果的人话摘要('' = 组件零变更)。install/
|
|
32
|
+
/** ensureRuntime 结果的人话摘要('' = 组件零变更)。install/update 后
|
|
33
33
|
* 给用户对账反馈——「组件到底刷没刷」此前从输出里看不出来(结果被丢弃)。 */
|
|
34
34
|
function compNote(results) {
|
|
35
35
|
const LABELS = {
|
|
@@ -56,7 +56,7 @@ async function precheckEdgePorts(ctx, linkOn) {
|
|
|
56
56
|
const forwardPorts = topo.forwards.map((f) => f.listenPort);
|
|
57
57
|
if (linkOn && forwardPorts.length > 0) {
|
|
58
58
|
// 只要 pid 判持口者归属,不跑全域 print-disabled;默认零常驻形态没有
|
|
59
|
-
// link job,这次 print 纯浪费(
|
|
59
|
+
// link job,这次 print 纯浪费(update 内置的无参 install 也走这里)
|
|
60
60
|
const jobPid = launchd.printState(runner, uid, linkLabel(topo.core.alias)).pid;
|
|
61
61
|
const tree = processTree(runner);
|
|
62
62
|
for (const port of forwardPorts) {
|
|
@@ -113,7 +113,7 @@ async function installEdge(ctx, args) {
|
|
|
113
113
|
const label = linkLabel(topo.core.alias);
|
|
114
114
|
const plistPath = paths.plistFile(label);
|
|
115
115
|
|
|
116
|
-
// 显式意图先落/删 marker;无参 install(含
|
|
116
|
+
// 显式意图先落/删 marker;无参 install(含 update 内置)不触碰它
|
|
117
117
|
if (flag === true) {
|
|
118
118
|
fs.mkdirSync(paths.sshNetDir, { recursive: true });
|
|
119
119
|
writeFileAtomic(paths.linkEnabledFile, '1\n', { mode: 0o600 });
|
|
@@ -165,7 +165,7 @@ function installCore(ctx) {
|
|
|
165
165
|
reconcileEdgeFragments(ctx);
|
|
166
166
|
// conf.d/edge-<别名> 不在此写:那是 _register(edge 报名)的产物,见 register.mjs。
|
|
167
167
|
// 已注册的回拨组件在 install 时一并迁移/对账(旧版带机器名实体拷贝 →
|
|
168
|
-
// 软链):否则
|
|
168
|
+
// 软链):否则 update 后 core status 要对每台未联系的 edge 报组件异常,
|
|
169
169
|
// 直到它下次报名才自愈(2026-09-30 补)
|
|
170
170
|
const edges = launchd.edgeAliasesOnDisk(paths.launchAgentsDir);
|
|
171
171
|
// relay 基础形态 + 磁盘在册 edge 的回拨组件(清单与报名/status 体检同源)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// update:一键升级——npm i -g @latest 后重跑 install 刷新运行时。
|
|
2
2
|
// 把消费机「最高频运维动作」的两步纪律(README/CHANGELOG 反复强调的顺序,
|
|
3
3
|
// 以及 ETARGET 传播窗口的 --prefer-online 重试)内置成一条命令,
|
|
4
4
|
// 从根上消掉「npm 升了包却忘重跑 install」的静默版本差。
|
|
@@ -24,9 +24,9 @@ const failWhy = (r) => r.stderr.trim()
|
|
|
24
24
|
|
|
25
25
|
export async function run(ctx, args = []) {
|
|
26
26
|
if (args.length)
|
|
27
|
-
throw new Error('用法:
|
|
27
|
+
throw new Error('用法:update 不带参数');
|
|
28
28
|
if (ctx.role === 'node' && ctx.uid !== 0)
|
|
29
|
-
throw new Error('node 上升级要写 /etc/systemd/system(install 步骤),请以 root 运行(sudo ssh-net
|
|
29
|
+
throw new Error('node 上升级要写 /etc/systemd/system(install 步骤),请以 root 运行(sudo ssh-net update)');
|
|
30
30
|
|
|
31
31
|
// 首跑就带 --prefer-online(notes #10,2026-10-02 落地):npm 默认读本地
|
|
32
32
|
// packument 缓存的 dist-tags,刚发布后 latest 仍旧值时不报 ETARGET 而是
|
|
@@ -43,7 +43,7 @@ export async function run(ctx, args = []) {
|
|
|
43
43
|
r = ctx.runner.run('npm', npmArgs, { timeout: NPM_TIMEOUT });
|
|
44
44
|
if (r.code !== 0)
|
|
45
45
|
throw new Error(
|
|
46
|
-
`安装最新版失败(ETARGET:registry 元数据还没传播过来,常见于刚发布几分钟内)——等几分钟再跑 ssh-net
|
|
46
|
+
`安装最新版失败(ETARGET:registry 元数据还没传播过来,常见于刚发布几分钟内)——等几分钟再跑 ssh-net update,或手动 npm i -g ssh-net@<版本> --prefer-online。npm 输出:${r.stderr.trim()}`,
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
if (r.code !== 0)
|
package/libexec/lib/paths.mjs
CHANGED
|
@@ -70,7 +70,7 @@ export function machinePaths(env = process.env) {
|
|
|
70
70
|
peer: path.join(stateDir, 'PEER_ON'),
|
|
71
71
|
}),
|
|
72
72
|
// link 附加件的持久安装意图(2026-10-02):存在=install 对账 link 实体/
|
|
73
|
-
// plist。放树根不放 state/——
|
|
73
|
+
// plist。放树根不放 state/——update 的无参 install 与任何 state 维护都
|
|
74
74
|
// 不能误伤它;只读存在性
|
|
75
75
|
linkEnabledFile: path.join(sshNetDir, 'link.enabled'),
|
|
76
76
|
// PROBE_FAIL:sn-route 的失败印记(内容 epoch,15s TTL)。文件名是
|