ssh-net 26.11.67 → 26.11.69
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 +35 -0
- package/README.md +22 -13
- package/docs/changelog/2026-09.md +363 -0
- package/docs/design.md +464 -0
- package/docs/development.md +48 -0
- package/docs/notes.md +617 -0
- package/docs/releasing.md +47 -0
- package/libexec/commands/install.mjs +43 -30
- package/libexec/commands/register.mjs +31 -26
- package/libexec/commands/start.mjs +27 -8
- package/libexec/commands/status.mjs +37 -5
- package/libexec/commands/stop.mjs +17 -8
- package/libexec/commands/uninstall.mjs +18 -11
- package/libexec/lib/constants.mjs +8 -0
- package/libexec/lib/jobs.mjs +25 -2
- package/libexec/lib/manage.mjs +26 -0
- package/libexec/lib/manifest.mjs +2 -1
- package/libexec/lib/paths.mjs +1 -1
- package/libexec/lib/probe.mjs +11 -1
- package/libexec/lib/render.mjs +43 -13
- package/libexec/lib/systemd.mjs +17 -19
- package/libexec/sn-route +27 -25
- package/libexec/sn-wake +52 -0
- package/package.json +2 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# 发布
|
|
2
|
+
|
|
3
|
+
用户要求发布,或修改版本、分发与发布 CI 时阅读本文。用户说「发布」时,默认
|
|
4
|
+
完成全流程:提交本次改动、合回并推送 main、发 GitHub Release、升级在线机器,
|
|
5
|
+
不是在本地运行 `npm publish`
|
|
6
|
+
|
|
7
|
+
## 是否发版
|
|
8
|
+
|
|
9
|
+
- 只有 `libexec/` 有改动才发版
|
|
10
|
+
- 纯文档、测试或 CI 改动只提交、不发版;下次发版时把积累的这类改动按
|
|
11
|
+
CHANGELOG 顶部规则写进新版本条目,不维护 `[Unreleased]` 区
|
|
12
|
+
|
|
13
|
+
## 准备与提交
|
|
14
|
+
|
|
15
|
+
1. 运行 `node --test` 并等待完整结果,再用 `npm pack --dry-run` 核对发布内容
|
|
16
|
+
2. 用 `npm view ssh-net versions --json --registry=https://registry.npmjs.org` 核对已发布版本清单,按 CHANGELOG 顶部的编号规则更新 `package.json`。在 CHANGELOG 顶部按词表写入带日期的新版本条目,再检查是否需要归档
|
|
17
|
+
3. 按仓库约定提交并推送 main
|
|
18
|
+
4. 等 push CI 成功;publish 的 macOS 测试不能替代 Ubuntu CI
|
|
19
|
+
|
|
20
|
+
## CHANGELOG 归档
|
|
21
|
+
|
|
22
|
+
CHANGELOG.md 只保留**当前月与上一个完整月**的版本,更早的整月内容在
|
|
23
|
+
`docs/changelog/YYYY-MM.md`。归档由跨月发版驱动,不按月强制切:
|
|
24
|
+
|
|
25
|
+
- 写入新月条目后,若主文件出现三个不同月份的条目,把最老一个月的条目
|
|
26
|
+
原样移入对应月度文件;月度文件不存在就新建,文件头注明月份和版本号
|
|
27
|
+
范围,没有内容的月份不建空文件
|
|
28
|
+
|
|
29
|
+
## GitHub Release 与 npm publish
|
|
30
|
+
|
|
31
|
+
发布任务在 macOS 上跑一次 `npm test`,随后用 `npm publish --ignore-scripts` 跳过重复测试。本地直接发布时仍由 `prepublishOnly` 运行测试
|
|
32
|
+
|
|
33
|
+
1. 创建带 `v` 前缀的 annotated tag,指向发布提交,先推 tag,再运行
|
|
34
|
+
`gh release create`;本机 git 配置拒绝轻量 tag,无 tag 仓库直接
|
|
35
|
+
`create --target` 曾返回 422
|
|
36
|
+
2. 等待已启动的 `publish` 任务依次完成。同一版本在 npm 已存在时会跳过发包。macOS runner 缺少系统 `timeout` 时会先安装 Homebrew `coreutils`。如果发包前失败,且已在 main 修正 CI 环境,运行 `gh workflow run publish.yml --ref main`,会按最新 GitHub Release 的原标签重新测试和发布
|
|
37
|
+
3. 不补历史 Release,避免旧版后发布反超 latest;理由见 notes「update 与发布」
|
|
38
|
+
|
|
39
|
+
## 发布后的在线机器升级
|
|
40
|
+
|
|
41
|
+
按 [README「升级」](../README.md#升级) 的显式版本规则逐台运行 update;registry
|
|
42
|
+
传播、ETARGET 与旧 latest 的处理和理由见 notes「update 与发布」
|
|
43
|
+
|
|
44
|
+
- 五台工作机逐台核对 `ssh-net --version` 与 `ssh-net status`
|
|
45
|
+
- npm link 开发机不用 update,只重跑 `ssh-net install`
|
|
46
|
+
- relay 不安装本工具
|
|
47
|
+
- 不可达机器明确列出,不阻塞在线机器,不猜过期地址
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
// install 对账本机组件。edge
|
|
1
|
+
// install 对账本机组件。edge 注册本地转发与系统唤醒任务,是否启动由开关决定;
|
|
2
2
|
// core/node 恢复中继服务,core 到 edge 的回拨任务仍在首次报名时才创建
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import {
|
|
6
6
|
CALLBACK_PORT, TERMINAL_NOTIFIER_PATHS, OSASCRIPT_PATH,
|
|
7
7
|
} from '../lib/constants.mjs';
|
|
8
|
-
import { removeJobs, syncPlist } from '../lib/manage.mjs';
|
|
8
|
+
import { acquireSshLock, removeJobs, syncPlist } from '../lib/manage.mjs';
|
|
9
9
|
import { syncConfFile } from '../lib/conf.mjs';
|
|
10
10
|
import { ensureRuntime } from '../lib/runtime.mjs';
|
|
11
|
-
import { edgeLinkJob, coreRelayJob, nodeRelayJob } from '../lib/jobs.mjs';
|
|
11
|
+
import { edgeLinkJob, edgeWakeJob, coreRelayJob, nodeRelayJob } from '../lib/jobs.mjs';
|
|
12
12
|
import { requireNodeHome } from '../lib/identity.mjs';
|
|
13
13
|
import * as launchd from '../lib/launchd.mjs';
|
|
14
14
|
import * as systemd from '../lib/systemd.mjs';
|
|
15
15
|
import {
|
|
16
|
-
forwardListenerPids, hasRouteTimeout, lsofListen, v6ListenerScope, peerProbeOk,
|
|
16
|
+
forwardListenerPids, hasRouteTimeout, hasSleepwatcher, lsofListen, v6ListenerScope, peerProbeOk,
|
|
17
17
|
} from '../lib/probe.mjs';
|
|
18
18
|
import { isExecutableFile, readDirOrEmpty, removeObsoleteNames } from '../lib/fsutil.mjs';
|
|
19
19
|
import { packageScriptPath } from '../lib/paths.mjs';
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
SN_PROBE, RESIDENT_SCRIPTS, edgeRuntimePlan, coreNodeRuntimePlan,
|
|
22
22
|
} from '../lib/manifest.mjs';
|
|
23
23
|
import {
|
|
24
|
-
edgeLabel, linkLabel, linkLinkName, relayLabel, relayLinkName, renderEdgeHost, renderRoutes,
|
|
24
|
+
edgeLabel, linkLabel, linkLinkName, relayLabel, relayLinkName, wakeLabel, renderEdgeHost, renderRoutes,
|
|
25
25
|
} from '../lib/render.mjs';
|
|
26
26
|
|
|
27
27
|
/** 只有常驻脚本本身发生变化,才提示要等进程重连 */
|
|
@@ -38,9 +38,9 @@ function notesPart(...notes) {
|
|
|
38
38
|
return parts.length ? `(${parts.join(';')})` : '';
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
function deploymentNote(r, task, config) {
|
|
41
|
+
function deploymentNote(r, task, config, restartedNote = `${config}已更新,可能断开当前连接`) {
|
|
42
42
|
if (!r.changed) return '';
|
|
43
|
-
return r.restarted ?
|
|
43
|
+
return r.restarted ? restartedNote : `${task}已同步`;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
function coreNodeInstallMsg(ctx, comp, entryChanged, result, removed) {
|
|
@@ -56,8 +56,8 @@ function coreNodeInstallMsg(ctx, comp, entryChanged, result, removed) {
|
|
|
56
56
|
return `安装完成${note},中继通道已开启(${relayLine})`;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
/**
|
|
60
|
-
async function
|
|
59
|
+
/** 转发端口被别的程序占用时,在写任何产物前退出:link 的 ssh 绑不上口,装了也起不来 */
|
|
60
|
+
async function assertForwardPortsFree({ runner, uid, topo }, labels) {
|
|
61
61
|
const jobPids = () => new Set(labels.map((label) => launchd.printState(runner, uid, label).pid));
|
|
62
62
|
let owned = jobPids();
|
|
63
63
|
for (const { listenPort: port } of topo.forwards) {
|
|
@@ -70,18 +70,22 @@ async function precheckEdgePorts({ runner, uid, topo }, labels) {
|
|
|
70
70
|
throw new Error(`端口 ${port} 被别的程序占用(pid ${foreign.join(',')}):\n${lsofListen(runner, port)}`);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
+
}
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
/**
|
|
76
|
+
* 回拨端口被占时的提示('\n' 起头的独立行),没被占为 ''。它不影响安装产物,
|
|
77
|
+
* 开盖后旧回拨的残留监听又要等 sshd 保活回收,所以只提示,不挡 install 和 update
|
|
78
|
+
*/
|
|
79
|
+
async function callbackPortNote(runner) {
|
|
80
|
+
// 只看覆盖 [::1] 的 IPv6 监听;同号的纯 IPv4 监听可以共存。
|
|
75
81
|
// 用包内探针读 SSH 标识,不能让磁盘上待修复的探针堵住 install
|
|
76
82
|
const listeners = lsofListen(runner, CALLBACK_PORT);
|
|
77
83
|
const scope = v6ListenerScope(listeners, CALLBACK_PORT);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
);
|
|
84
|
-
}
|
|
84
|
+
const why = scope === 'wildcard' ? 'IPv6 通配监听占用了回拨地址 [::1]'
|
|
85
|
+
: scope === 'loopback' && !(await peerProbeOk(runner, path.dirname(packageScriptPath(SN_PROBE))))
|
|
86
|
+
? '有程序在监听但没有响应(多半是断线残留,sshd 保活会回收;持续出现就是被别的程序占用)'
|
|
87
|
+
: '';
|
|
88
|
+
return why ? `\n提示:端口 ${CALLBACK_PORT} ${why},core 的回拨暂时绑不上这个口:\n${listeners}` : '';
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
/** 通知依赖提示('\n' 前缀的独立行;terminal-notifier 齐备返回 '')。 */
|
|
@@ -108,9 +112,12 @@ function removeObsoleteFiles(dir, prefix, keep) {
|
|
|
108
112
|
async function installEdge(ctx) {
|
|
109
113
|
const { topo, paths } = ctx;
|
|
110
114
|
const link = edgeLinkJob(ctx);
|
|
115
|
+
const wake = edgeWakeJob(ctx);
|
|
111
116
|
const diskLabels = launchd.labelsOnDisk(paths.launchAgentsDir, linkLabel(''));
|
|
112
117
|
const obsolete = diskLabels.filter((label) => label !== link?.label);
|
|
113
|
-
|
|
118
|
+
const wakeObsolete = launchd.labelsOnDisk(paths.launchAgentsDir, wakeLabel(''))
|
|
119
|
+
.filter((label) => label !== wake.label);
|
|
120
|
+
await assertForwardPortsFree(ctx, link ? [link.label, ...obsolete] : []);
|
|
114
121
|
const comp = syncRuntime(ctx, edgeRuntimePlan(topo));
|
|
115
122
|
// link 可能在 bootstrap 内立即连接;新旧任务各自启动前都要读到配套的 routes
|
|
116
123
|
let routesChanged = false;
|
|
@@ -130,14 +137,21 @@ async function installEdge(ctx) {
|
|
|
130
137
|
removeJobs(ctx, obsolete);
|
|
131
138
|
routes.apply();
|
|
132
139
|
}
|
|
140
|
+
const wakeResult = syncPlist(ctx, wake, wakeObsolete);
|
|
141
|
+
if (wakeResult.lintError) throw new Error(`系统唤醒 plist 校验失败:${wakeResult.lintError}`);
|
|
142
|
+
const wakeNote = deploymentNote(
|
|
143
|
+
wakeResult, '系统唤醒任务', '系统唤醒配置', '系统唤醒配置已更新,任务已重启',
|
|
144
|
+
);
|
|
133
145
|
removeObsoleteFiles(paths.binDir, linkLinkName(''), [linkLinkName(topo.core.alias)]);
|
|
134
146
|
fs.rmSync(paths.legacyLinkEnabledFile, { force: true });
|
|
135
147
|
|
|
136
|
-
const note = notesPart(comp, linkNote,
|
|
148
|
+
const note = notesPart(comp, linkNote, wakeNote,
|
|
149
|
+
obsolete.length ? '旧转发任务已移除' : '',
|
|
150
|
+
wakeObsolete.length ? '旧系统唤醒任务已移除' : '',
|
|
137
151
|
routesChanged ? 'ssh 配置片段已更新' : '');
|
|
138
152
|
const base = note ? `安装完成${note}` : '已安装,配置无需改动';
|
|
139
153
|
const startNote = ctx.state.isOn('relay') ? '' : '\n当前为关闭状态;开启自动选路和 IPv6 直连:ssh-net start';
|
|
140
|
-
return `${base}${startNote}${localNotifyDepNote()}`;
|
|
154
|
+
return `${base}${startNote}${await callbackPortNote(ctx.runner)}${localNotifyDepNote()}`;
|
|
141
155
|
}
|
|
142
156
|
|
|
143
157
|
/** core/node 按 topology 写各 edge 的入口,并移除已经不在 topology 里的旧片段 */
|
|
@@ -187,18 +201,17 @@ function installNode(ctx, home) {
|
|
|
187
201
|
/** @param {object} ctx @param {string[]} [args] */
|
|
188
202
|
export async function run(ctx, args = []) {
|
|
189
203
|
if (args.length) throw new Error('用法:ssh-net install 不带参数');
|
|
190
|
-
|
|
191
|
-
if (!['
|
|
204
|
+
// 不认识的角色直接报错,不能落进 edge 分支去动它的任务
|
|
205
|
+
if (!['core', 'node', 'edge'].includes(ctx.role)) throw new Error(`未知角色:${ctx.role}`);
|
|
192
206
|
if (ctx.role === 'edge' && !hasRouteTimeout(ctx.env))
|
|
193
207
|
throw new Error('缺少可执行的 timeout,未安装 edge 组件。请在这台机器上运行 brew install coreutils,再重跑 ssh-net install');
|
|
208
|
+
if (ctx.role === 'edge' && !hasSleepwatcher(ctx.env))
|
|
209
|
+
throw new Error('缺少可执行的 sleepwatcher,未安装 edge 组件。请在这台机器上运行 brew install sleepwatcher,再重跑 ssh-net install');
|
|
194
210
|
const home = ctx.role === 'node' ? requireNodeHome(ctx, 'install') : null;
|
|
195
|
-
//
|
|
196
|
-
const fd =
|
|
211
|
+
// 回滚按命令开头记下的旧状态还原;安装、core 报名和 mac 卸载共用同一把锁
|
|
212
|
+
const fd = acquireSshLock(ctx);
|
|
197
213
|
try {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
if (lock.code !== 0) throw new Error(`无法取得安装锁:${lock.error?.message || lock.stderr.trim() || '有其他安装正在运行,请稍后重试'}`);
|
|
202
|
-
return ctx.role === 'node' ? installNode(ctx, home) : await installEdge(ctx);
|
|
203
|
-
} finally { fs.closeSync(fd); }
|
|
214
|
+
if (ctx.role === 'node') return installNode(ctx, home);
|
|
215
|
+
return ctx.role === 'core' ? installCore(ctx) : await installEdge(ctx);
|
|
216
|
+
} finally { if (fd !== null) fs.closeSync(fd); }
|
|
204
217
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// core 侧报名 RPC:edge 的 sn-route 经 relay 调用,登记最近地址并建/唤回拨。
|
|
2
|
-
// 人工 start peer 也复用 sn-route,edge
|
|
2
|
+
// 人工 start peer 与系统唤醒 hook 也复用 sn-route,edge 侧不另维护报名实现。
|
|
3
3
|
// install 与报名都会刷新运行时脚本;job 参数由报名重新渲染。
|
|
4
|
+
import fs from 'node:fs';
|
|
4
5
|
import { explainV6Error } from '../lib/ipv6.mjs';
|
|
5
6
|
import * as launchd from '../lib/launchd.mjs';
|
|
6
|
-
import { syncPlist } from '../lib/manage.mjs';
|
|
7
|
+
import { acquireSshLock, syncPlist } from '../lib/manage.mjs';
|
|
7
8
|
import { ensureRuntime } from '../lib/runtime.mjs';
|
|
8
9
|
import { readFileOrNull } from '../lib/fsutil.mjs';
|
|
9
10
|
import { edgeCallbacksPlan } from '../lib/manifest.mjs';
|
|
@@ -11,8 +12,8 @@ import { edgeLabel, renderUplinkEdgePlist } from '../lib/render.mjs';
|
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* 内部 RPC `ssh-net _register <别名> <v6>`,由 edge 的报名 ssh 经 relay
|
|
14
|
-
*
|
|
15
|
-
*
|
|
15
|
+
* 远程触发。报名来源是普通 SSH、人工 start peer 或系统唤醒;任何报名都无条件
|
|
16
|
+
* enable+kickstart、回拨立即重拨、重试额度随进程重启重置。
|
|
16
17
|
*
|
|
17
18
|
* 报名即两处同写:state/edges/<别名>(uplink-edge 每次拨号现读)与
|
|
18
19
|
* state/addr/<别名>(`ssh <别名>` 入口 Include 的地址行;内网直连时由 rc
|
|
@@ -35,28 +36,32 @@ export function runRegister(ctx, args = []) {
|
|
|
35
36
|
const v6Err = explainV6Error(v6);
|
|
36
37
|
if (v6Err) throw new Error(`v6 校验失败(${alias}):${v6Err}`);
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
// 两台 edge 可同时报名;短等正常报名收尾,仍受 sn-route 的报名总时限约束
|
|
40
|
+
const fd = acquireSshLock(ctx, 1);
|
|
41
|
+
try {
|
|
42
|
+
const label = edgeLabel(alias);
|
|
43
|
+
const plistPath = ctx.paths.plistFile(label);
|
|
44
|
+
const content = renderUplinkEdgePlist({
|
|
45
|
+
binDir: ctx.paths.binDir, edgeAlias: alias, user: edge.user,
|
|
46
|
+
logsDir: ctx.paths.logsDir,
|
|
47
|
+
});
|
|
48
|
+
const plan = edgeCallbacksPlan([alias]);
|
|
49
|
+
ensureRuntime(ctx, plan.entities, plan.links);
|
|
50
|
+
ctx.state.writeEdgeV6(alias, v6);
|
|
51
|
+
ctx.state.writeEdgeAddr(alias, v6);
|
|
48
52
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
// 未注册(首次报名)或 plist 与 topology 渲染不符(user 等变了):
|
|
54
|
+
// 重新部署,syncPlist 的 bootstrap 即首发
|
|
55
|
+
const st = launchd.inspect(ctx.runner, ctx.uid, label);
|
|
56
|
+
if (!st.registered || readFileOrNull(plistPath) !== content) {
|
|
57
|
+
const r = syncPlist(ctx, { label, plistPath, content });
|
|
58
|
+
if (r.lintError) throw new Error(`uplink-edge plist 校验失败:${r.lintError}`);
|
|
59
|
+
return st.registered ? `已更新登记 ${alias}` : `已登记 ${alias}`;
|
|
60
|
+
}
|
|
57
61
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
// 已注册:休眠中要先 enable 清 override,enabled 时幂等;kickstart -k 杀旧起新
|
|
63
|
+
const r = launchd.kickstartEnabled(ctx.runner, ctx.uid, label);
|
|
64
|
+
if (r.code !== 0) throw new Error(`kickstart 失败:${r.stderr.trim()}`);
|
|
65
|
+
return st.disabled ? `已唤醒 ${alias}` : `已开始拨号 ${alias}`;
|
|
66
|
+
} finally { if (fd !== null) fs.closeSync(fd); }
|
|
62
67
|
}
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
import fs from 'node:fs';
|
|
5
5
|
import path from 'node:path';
|
|
6
6
|
import * as systemd from '../lib/systemd.mjs';
|
|
7
|
-
import { ensureLoaded } from '../lib/manage.mjs';
|
|
7
|
+
import { acquireSshLock, ensureLoaded } from '../lib/manage.mjs';
|
|
8
8
|
import { SWITCH_NAMES } from '../lib/state.mjs';
|
|
9
|
-
import { SN_ROUTE } from '../lib/manifest.mjs';
|
|
10
|
-
import { edgeLinkJob } from '../lib/jobs.mjs';
|
|
9
|
+
import { SN_ROUTE, SN_WAKE } from '../lib/manifest.mjs';
|
|
10
|
+
import { edgeLinkJob, edgeWakeJob } from '../lib/jobs.mjs';
|
|
11
|
+
import { hasSleepwatcher } from '../lib/probe.mjs';
|
|
11
12
|
import { relayLabel, relayUnitName, snRouteArgv } from '../lib/render.mjs';
|
|
12
13
|
|
|
13
14
|
function parseEdgeTarget(args) {
|
|
@@ -51,17 +52,25 @@ function startCore(ctx) {
|
|
|
51
52
|
return '中继通道已开启';
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
|
|
55
|
+
function runUnlocked(ctx, args = []) {
|
|
55
56
|
if (ctx.role === 'edge') {
|
|
56
57
|
const target = parseEdgeTarget(args);
|
|
57
58
|
const peerWasOn = target === 'relay' && ctx.state.isOn('peer');
|
|
59
|
+
const needsWake = target === 'peer' || peerWasOn;
|
|
58
60
|
if (!fs.existsSync(ctx.paths.binScript(SN_ROUTE)) || !fs.existsSync(ctx.paths.routesFile))
|
|
59
61
|
throw new Error('未安装完整(缺 sn-route 或选路配置)——先跑 ssh-net install');
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
if (!
|
|
63
|
-
|
|
62
|
+
const wake = edgeWakeJob(ctx);
|
|
63
|
+
if (needsWake) {
|
|
64
|
+
if (!hasSleepwatcher(ctx.env))
|
|
65
|
+
throw new Error('缺少可执行的 sleepwatcher,无法开启系统唤醒恢复——运行 brew install sleepwatcher');
|
|
66
|
+
if (!fs.existsSync(ctx.paths.binScript(SN_WAKE)))
|
|
67
|
+
throw new Error('缺系统唤醒脚本——先跑 ssh-net install');
|
|
68
|
+
if (!fs.existsSync(wake.plistPath)) throw new Error('缺系统唤醒任务——先跑 ssh-net install');
|
|
64
69
|
}
|
|
70
|
+
const link = edgeLinkJob(ctx);
|
|
71
|
+
if (link && !fs.existsSync(link.plistPath)) throw new Error('缺本地转发任务——先跑 ssh-net install');
|
|
72
|
+
if (link) ensureLoaded(ctx, link);
|
|
73
|
+
if (needsWake) ensureLoaded(ctx, wake);
|
|
65
74
|
if (target === 'peer') return startEdgePeer(ctx);
|
|
66
75
|
ctx.state.setOn(['relay']);
|
|
67
76
|
const peerNote = peerWasOn
|
|
@@ -84,3 +93,13 @@ export function run(ctx, args = []) {
|
|
|
84
93
|
}
|
|
85
94
|
throw new Error(`未知角色:${ctx.role}`);
|
|
86
95
|
}
|
|
96
|
+
|
|
97
|
+
export function run(ctx, args = []) {
|
|
98
|
+
if (ctx.role === 'node' || (ctx.platform ?? process.platform) === 'linux')
|
|
99
|
+
return runUnlocked(ctx, args);
|
|
100
|
+
// start 可能在卸载的 bootout 后重新 bootstrap;共用锁,避免留下无 plist 的注册任务
|
|
101
|
+
const fd = acquireSshLock(ctx);
|
|
102
|
+
try {
|
|
103
|
+
return runUnlocked(ctx, args);
|
|
104
|
+
} finally { if (fd !== null) fs.closeSync(fd); }
|
|
105
|
+
}
|
|
@@ -8,16 +8,16 @@ import { auditScript, auditLink } from '../lib/runtime.mjs';
|
|
|
8
8
|
import { packageScriptPath } from '../lib/paths.mjs';
|
|
9
9
|
import * as launchd from '../lib/launchd.mjs';
|
|
10
10
|
import * as systemd from '../lib/systemd.mjs';
|
|
11
|
-
import { peerProbeOk, tcpOpen, classifyV6Probe, forwardListenerPids, hasRouteTimeout } from '../lib/probe.mjs';
|
|
11
|
+
import { peerProbeOk, tcpOpen, classifyV6Probe, forwardListenerPids, hasRouteTimeout, hasSleepwatcher } from '../lib/probe.mjs';
|
|
12
12
|
import { readFileOrNull } from '../lib/fsutil.mjs';
|
|
13
13
|
import { LAN_ADDR_RE } from '../lib/constants.mjs';
|
|
14
14
|
import {
|
|
15
15
|
SN_ROUTE, SN_IPV6, UPLINK_EDGE,
|
|
16
16
|
edgeRuntimePlan, coreNodeRuntimePlan, edgeCallbacksPlan,
|
|
17
17
|
} from '../lib/manifest.mjs';
|
|
18
|
-
import { edgeLinkJob, coreRelayJob, nodeRelayJob } from '../lib/jobs.mjs';
|
|
18
|
+
import { edgeLinkJob, edgeWakeJob, coreRelayJob, nodeRelayJob } from '../lib/jobs.mjs';
|
|
19
19
|
import {
|
|
20
|
-
edgeLabel, linkLabel, relayLabel, relayLinkName, renderEdgeHost, renderRoutes, coreViaRelayArgs, probeSshOpts,
|
|
20
|
+
edgeLabel, linkLabel, relayLabel, relayLinkName, wakeLabel, renderEdgeHost, renderRoutes, coreViaRelayArgs, probeSshOpts,
|
|
21
21
|
} from '../lib/render.mjs';
|
|
22
22
|
|
|
23
23
|
/**
|
|
@@ -163,6 +163,29 @@ async function collectEdge(ctx, probe) {
|
|
|
163
163
|
initialJob = launchd.inspect(ctx.runner, ctx.uid, link.label);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
const wake = edgeWakeJob(ctx);
|
|
167
|
+
const wakeOnDisk = launchd.labelsOnDisk(paths.launchAgentsDir, wakeLabel(''));
|
|
168
|
+
if (wakeOnDisk.some((label) => label !== wake.label))
|
|
169
|
+
issues.push('有旧的系统唤醒任务——跑一次 ssh-net install 清理');
|
|
170
|
+
let wakeJob = null;
|
|
171
|
+
if (entityAudits.some((a) => a.audit !== 'missing') || wakeOnDisk.includes(wake.label)) {
|
|
172
|
+
const issue = configFileIssue(wake.plistPath, wake.content, '系统唤醒配置', '需要更新');
|
|
173
|
+
if (issue) issues.push(issue);
|
|
174
|
+
wakeJob = launchd.inspect(ctx.runner, ctx.uid, wake.label);
|
|
175
|
+
if (!hasSleepwatcher(ctx.env))
|
|
176
|
+
issues.push('缺少可执行的 sleepwatcher——运行 brew install sleepwatcher');
|
|
177
|
+
}
|
|
178
|
+
if (wakeJob) {
|
|
179
|
+
if (switches.peer) {
|
|
180
|
+
if (!wakeJob.registered || wakeJob.disabled)
|
|
181
|
+
issues.push(`系统唤醒任务${wakeJob.registered ? '已禁用' : '未注册'}——跑一次 ssh-net install 修复`);
|
|
182
|
+
else if (!wakeJob.running)
|
|
183
|
+
issues.push('系统唤醒任务未在运行——先 stop peer 再 start peer,或跑 ssh-net install 修复');
|
|
184
|
+
} else if (wakeJob.running) {
|
|
185
|
+
issues.push('peer 已关但系统唤醒任务仍在运行——再跑一次 ssh-net stop peer');
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
166
189
|
// routes 被手删/过期会让 ssh 静默退回 lan 直连,是故障。sn-route 没装时
|
|
167
190
|
// 上面已报「尚未安装」,不重复
|
|
168
191
|
if (entityAudits.some((a) => a.name === SN_ROUTE && a.audit === 'ok')) {
|
|
@@ -217,7 +240,7 @@ async function collectEdge(ctx, probe) {
|
|
|
217
240
|
|
|
218
241
|
return {
|
|
219
242
|
role: 'edge', alias: ctx.self.alias, switches, probed: probe, relayReady, peerReady,
|
|
220
|
-
job, forwardViews,
|
|
243
|
+
job, forwardViews, wakeJob,
|
|
221
244
|
coreAlias: topo.core.alias, relayAlias: topo.relay.alias,
|
|
222
245
|
v6, v6ProbeOk, issues,
|
|
223
246
|
};
|
|
@@ -296,10 +319,18 @@ async function collectNode(ctx, probe) {
|
|
|
296
319
|
if (configIssue) issues.push(configIssue);
|
|
297
320
|
if (systemd.hasPendingUpdate(deployment.unitPath)) issues.push('中继服务更新尚未完成——跑一次 ssh-net install 完成更新');
|
|
298
321
|
const unit = deployment.unitName;
|
|
299
|
-
const active = systemd.
|
|
322
|
+
const { activeState: active, fileState } = systemd.unitSnapshot(ctx.runner, unit);
|
|
300
323
|
const relayPort = probe ? await relayPortListening(ctx, ctx.self.relayPort) : null;
|
|
301
324
|
if (active !== 'active')
|
|
302
325
|
issues.push(`系统服务 ${unit} 状态 ${active}——systemctl status ${unit} 查看`);
|
|
326
|
+
else if (fileState !== 'enabled') {
|
|
327
|
+
const repair = ['disabled', 'enabled-runtime'].includes(fileState)
|
|
328
|
+
? 'ssh-net start 可重新启用'
|
|
329
|
+
: fileState.includes('masked')
|
|
330
|
+
? '先用 systemctl unmask 取消屏蔽,再用 ssh-net start 恢复'
|
|
331
|
+
: '检查 unit 文件与 systemctl enable 状态';
|
|
332
|
+
issues.push(`系统服务 ${unit} 仍在运行,但开机自启为 ${fileState || 'unknown'}——${repair}`);
|
|
333
|
+
}
|
|
303
334
|
if (relayPort && !relayPort.listening)
|
|
304
335
|
issues.push(relayPortIssue(topo.relay.alias, ctx.self.relayPort, relayPort));
|
|
305
336
|
|
|
@@ -375,6 +406,7 @@ function renderEdgeLines(s, lines) {
|
|
|
375
406
|
}
|
|
376
407
|
}
|
|
377
408
|
if (s.job) lines.push(` 本地转发(link):后台任务${s.job.running ? '运行中' : '未运行'}`);
|
|
409
|
+
if (s.wakeJob) lines.push(` 系统唤醒(wake):后台任务${s.wakeJob.running ? '运行中' : '未运行'}`);
|
|
378
410
|
}
|
|
379
411
|
|
|
380
412
|
function edgeTaskState(e) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
// stop:只按磁盘上的 ssh-net 任务操作,不读 topology。peer
|
|
2
|
-
//
|
|
3
|
-
//
|
|
1
|
+
// stop:只按磁盘上的 ssh-net 任务操作,不读 topology。peer 删开关并停 wake,
|
|
2
|
+
// 不闪断 link 或已有回拨;relay/缺省/-a/--all 级联清两开关,并按 wake → link →
|
|
3
|
+
// relay 停止。core 的 uplink-edge 不在停止范围内(人工全清用 uninstall)。
|
|
4
4
|
import * as launchd from '../lib/launchd.mjs';
|
|
5
5
|
import * as systemd from '../lib/systemd.mjs';
|
|
6
6
|
import { reapEdgeLink } from '../lib/jobctl.mjs';
|
|
7
7
|
import { requireNodeHome } from '../lib/identity.mjs';
|
|
8
8
|
import { SWITCH_NAMES } from '../lib/state.mjs';
|
|
9
|
-
import { linkLabel, relayLabel, relayLinkName } from '../lib/render.mjs';
|
|
9
|
+
import { linkLabel, relayLabel, relayLinkName, wakeLabel } from '../lib/render.mjs';
|
|
10
10
|
|
|
11
11
|
function parseTarget(args) {
|
|
12
12
|
if (args.length === 0 || args.length === 1 && ['-a', '--all'].includes(args[0]))
|
|
@@ -15,7 +15,7 @@ function parseTarget(args) {
|
|
|
15
15
|
throw new Error('用法:stop [-a|--all|relay|peer](不带参数或 -a=全部关闭)');
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
function
|
|
18
|
+
function stopBootoutJob(ctx, label) {
|
|
19
19
|
const d = launchd.disable(ctx.runner, ctx.uid, label);
|
|
20
20
|
if (d.code !== 0) throw new Error(`disable 失败(${label}):${d.stderr.trim()}`);
|
|
21
21
|
const bo = launchd.bootout(ctx.runner, ctx.uid, label);
|
|
@@ -30,6 +30,13 @@ function reapLinkOrThrow(ctx, label) {
|
|
|
30
30
|
throw new Error(`${label} 发 TERM 后仍在运行。手工排查:launchctl print gui/${ctx.uid}/${label}`);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
function stopWakeJobs(ctx) {
|
|
34
|
+
if ((ctx.platform ?? process.platform) === 'linux') return 0;
|
|
35
|
+
const labels = launchd.labelsOnDisk(ctx.paths.launchAgentsDir, wakeLabel(''));
|
|
36
|
+
for (const label of labels) stopBootoutJob(ctx, label);
|
|
37
|
+
return labels.length;
|
|
38
|
+
}
|
|
39
|
+
|
|
33
40
|
/** 停止磁盘发现的全部 link/relay 任务;改名前的残留也一并覆盖。 */
|
|
34
41
|
function stopJobs(ctx) {
|
|
35
42
|
if ((ctx.platform ?? process.platform) === 'linux') {
|
|
@@ -42,11 +49,12 @@ function stopJobs(ctx) {
|
|
|
42
49
|
}
|
|
43
50
|
|
|
44
51
|
ctx.state.removeOn(['relay', 'peer']);
|
|
52
|
+
const wakes = stopWakeJobs(ctx);
|
|
45
53
|
const links = launchd.labelsOnDisk(ctx.paths.launchAgentsDir, linkLabel(''));
|
|
46
54
|
const relays = launchd.labelsOnDisk(ctx.paths.launchAgentsDir, relayLabel(''));
|
|
47
55
|
for (const label of links) reapLinkOrThrow(ctx, label);
|
|
48
|
-
for (const label of relays)
|
|
49
|
-
return `已停止 ${links.length} 个本地转发任务和 ${relays.length}
|
|
56
|
+
for (const label of relays) stopBootoutJob(ctx, label);
|
|
57
|
+
return `已停止 ${links.length} 个本地转发任务和 ${relays.length} 个中继任务、${wakes} 个系统唤醒任务`;
|
|
50
58
|
}
|
|
51
59
|
|
|
52
60
|
export function run(ctx, args = []) {
|
|
@@ -54,7 +62,8 @@ export function run(ctx, args = []) {
|
|
|
54
62
|
if ((ctx.platform ?? process.platform) === 'linux' && ctx.uid === 0) requireNodeHome(ctx, 'stop');
|
|
55
63
|
if (target === 'peer') {
|
|
56
64
|
ctx.state.removeOn(['peer']);
|
|
57
|
-
|
|
65
|
+
stopWakeJobs(ctx);
|
|
66
|
+
return 'peer 已关闭:不再主动恢复 IPv6 直连,系统唤醒恢复已关闭;现有直连断开前仍可供新 ssh 使用,断开后走中继';
|
|
58
67
|
}
|
|
59
68
|
return `relay 和 peer 已一并关闭;${stopJobs(ctx)}`;
|
|
60
69
|
}
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
// plist/unit、运行时脚本、状态与日志;topology 改名前的残留由 glob 覆盖。
|
|
4
4
|
import fs from 'node:fs';
|
|
5
5
|
import path from 'node:path';
|
|
6
|
-
import { removeJobs } from '../lib/manage.mjs';
|
|
6
|
+
import { acquireSshLock, removeJobs } from '../lib/manage.mjs';
|
|
7
7
|
import { requireNodeHome } from '../lib/identity.mjs';
|
|
8
8
|
import * as launchd from '../lib/launchd.mjs';
|
|
9
9
|
import * as systemd from '../lib/systemd.mjs';
|
|
10
10
|
import {
|
|
11
|
-
linkLabel, relayLabel, relayLinkName, edgeLabel,
|
|
11
|
+
linkLabel, relayLabel, relayLinkName, edgeLabel, wakeLabel,
|
|
12
12
|
} from '../lib/render.mjs';
|
|
13
13
|
import { readDirOrEmpty } from '../lib/fsutil.mjs';
|
|
14
14
|
|
|
@@ -46,13 +46,20 @@ export function run(ctx, args = []) {
|
|
|
46
46
|
return '已卸载。最后一步:npm uninstall -g ssh-net';
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
// 快照与删除必须和 core 报名互斥,否则新回拨会在快照后注册、再被删掉运行时
|
|
50
|
+
const fd = acquireSshLock(ctx);
|
|
51
|
+
try {
|
|
52
|
+
// 先撤销恢复开关并收束 wake,避免卸载其他任务期间唤醒事件又发起报名
|
|
53
|
+
ctx.state.removeOn(['relay', 'peer']);
|
|
54
|
+
const labels = new Set([
|
|
55
|
+
...launchd.labelsOnDisk(ctx.paths.launchAgentsDir, wakeLabel('')),
|
|
56
|
+
...launchd.labelsOnDisk(ctx.paths.launchAgentsDir, linkLabel('')),
|
|
57
|
+
...launchd.labelsOnDisk(ctx.paths.launchAgentsDir, relayLabel('')),
|
|
58
|
+
...launchd.labelsOnDisk(ctx.paths.launchAgentsDir, edgeLabel('')),
|
|
59
|
+
]);
|
|
60
|
+
removeJobs(ctx, labels);
|
|
61
|
+
removeArtifacts(ctx);
|
|
62
|
+
removeSshNetLogs(ctx);
|
|
63
|
+
return '已卸载。最后一步:npm uninstall -g ssh-net';
|
|
64
|
+
} finally { if (fd !== null) fs.closeSync(fd); }
|
|
58
65
|
}
|
|
@@ -8,6 +8,14 @@ export const CALLBACK_PORT = 10022;
|
|
|
8
8
|
// edge 报名优先用系统 timeout,其次用两种默认 Homebrew 安装位置,不依赖交互 shell 的 PATH
|
|
9
9
|
export const TIMEOUT_SEARCH_PATH = '/usr/bin:/opt/homebrew/opt/coreutils/libexec/gnubin:/usr/local/opt/coreutils/libexec/gnubin';
|
|
10
10
|
|
|
11
|
+
// edge 系统唤醒监听:优先 Homebrew 默认位置;渲染、install、start、status 共用
|
|
12
|
+
export const SLEEPWATCHER_PATHS = [
|
|
13
|
+
'/opt/homebrew/bin/sleepwatcher',
|
|
14
|
+
'/usr/local/bin/sleepwatcher',
|
|
15
|
+
'/opt/homebrew/sbin/sleepwatcher',
|
|
16
|
+
'/usr/local/sbin/sleepwatcher',
|
|
17
|
+
];
|
|
18
|
+
|
|
11
19
|
// 回连桌面通知后端(sn-route 的 peer_ready 优先 terminal-notifier、缺它走
|
|
12
20
|
// osascript)。install 的可选依赖提示与 sn-route 的实际探测共用这组默认
|
|
13
21
|
// 路径;shell 读不到本文件,一致性靠 constants.test 锚
|
package/libexec/lib/jobs.mjs
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { renderForwardArgs } from './config.mjs';
|
|
5
5
|
import { nodeAccountHome } from './identity.mjs';
|
|
6
|
+
import { sleepwatcherPath } from './probe.mjs';
|
|
6
7
|
import {
|
|
7
|
-
linkLabel, relayLabel, relayUnitName,
|
|
8
|
-
renderEdgeLinkPlist, renderRelayPlist, renderRelayUnit,
|
|
8
|
+
linkLabel, relayLabel, relayUnitName, wakeLabel,
|
|
9
|
+
renderEdgeLinkPlist, renderRelayPlist, renderRelayUnit, renderWakePlist, snRouteArgv,
|
|
9
10
|
} from './render.mjs';
|
|
10
11
|
|
|
11
12
|
/** 有转发端口才需要 LaunchAgent。启动只用任务路径,安装和体检才读取 plist 内容 */
|
|
@@ -29,6 +30,28 @@ export function edgeLinkJob({ topo, paths, hostTable }) {
|
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
32
|
|
|
33
|
+
/** edge 系统唤醒恢复任务:与 forward 无关,由 PEER_ON 控制。 */
|
|
34
|
+
export function edgeWakeJob(ctx) {
|
|
35
|
+
const { topo, paths, self, env } = ctx;
|
|
36
|
+
const label = wakeLabel(topo.core.alias);
|
|
37
|
+
const pathStateFile = paths.switchFiles.peer;
|
|
38
|
+
return {
|
|
39
|
+
label,
|
|
40
|
+
plistPath: paths.plistFile(label),
|
|
41
|
+
pathStateFile,
|
|
42
|
+
get content() {
|
|
43
|
+
return renderWakePlist({
|
|
44
|
+
sleepwatcherPath: sleepwatcherPath(env),
|
|
45
|
+
binDir: paths.binDir,
|
|
46
|
+
coreAlias: topo.core.alias,
|
|
47
|
+
routeArgs: snRouteArgv(topo, self.alias),
|
|
48
|
+
peerOnFile: pathStateFile,
|
|
49
|
+
logsDir: paths.logsDir,
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
32
55
|
/** core 中继 LaunchAgent。 */
|
|
33
56
|
export function coreRelayJob(ctx) {
|
|
34
57
|
const { topo, paths } = ctx;
|
package/libexec/lib/manage.mjs
CHANGED
|
@@ -6,6 +6,32 @@ import * as launchd from './launchd.mjs';
|
|
|
6
6
|
import path from 'node:path';
|
|
7
7
|
import { readFileOrNull, removeObsoleteNames, withTempFile, writeFileAtomic } from './fsutil.mjs';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* 取得本账户 .ssh 目录的排他锁,调用方持有返回的 fd 直至操作结束。
|
|
11
|
+
* install、core 报名和 mac start/uninstall 共用,避免回滚或删除产物时互相交错。
|
|
12
|
+
* 没有 .ssh 说明没有可互斥的本地产物,供空 HOME 的卸载保持幂等。
|
|
13
|
+
* @param {object} ctx
|
|
14
|
+
* @param {number} [waitSeconds] 正常报名之间短等;安装、启动和卸载默认不等待
|
|
15
|
+
* @returns {number|null} 调用方负责 close;null 表示无需锁
|
|
16
|
+
*/
|
|
17
|
+
export function acquireSshLock(ctx, waitSeconds = 0) {
|
|
18
|
+
if (!fs.existsSync(ctx.paths.sshDir)) return null;
|
|
19
|
+
const fd = fs.openSync(ctx.paths.sshDir, 'r');
|
|
20
|
+
try {
|
|
21
|
+
const mac = (ctx.platform ?? process.platform) === 'darwin';
|
|
22
|
+
const args = mac ? ['-s', '-t', String(waitSeconds), '3']
|
|
23
|
+
: waitSeconds ? ['-w', String(waitSeconds), '3'] : ['-n', '3'];
|
|
24
|
+
const lock = ctx.runner.run(mac ? 'lockf' : 'flock', args,
|
|
25
|
+
{ stdio: ['ignore', 'pipe', 'pipe', fd] });
|
|
26
|
+
if (lock.code !== 0)
|
|
27
|
+
throw new Error(`无法取得安装锁:${lock.error?.message || lock.stderr.trim() || '有其他安装、报名或卸载正在运行,请稍后重试'}`);
|
|
28
|
+
return fd;
|
|
29
|
+
} catch (err) {
|
|
30
|
+
fs.closeSync(fd);
|
|
31
|
+
throw err;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
9
35
|
/**
|
|
10
36
|
* install 与 start 共用的任务恢复逻辑。带 PathState 的任务由 launchd 按文件状态启动
|
|
11
37
|
* @param {object} ctx
|
package/libexec/lib/manifest.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import { edgeLinkName, linkLinkName, relayLinkName } from './render.mjs';
|
|
|
5
5
|
export const SN_PROBE = 'sn-probe';
|
|
6
6
|
export const SN_ROUTE = 'sn-route';
|
|
7
7
|
export const SN_IPV6 = 'sn-ipv6';
|
|
8
|
+
export const SN_WAKE = 'sn-wake';
|
|
8
9
|
export const SN_REGISTER_LAN = 'sn-register-lan';
|
|
9
10
|
const LINK_CORE = 'ssh-net-link-core';
|
|
10
11
|
const UPLINK_RELAY = 'ssh-net-uplink-relay';
|
|
@@ -15,7 +16,7 @@ export const RESIDENT_SCRIPTS = Object.freeze([LINK_CORE, UPLINK_RELAY, UPLINK_E
|
|
|
15
16
|
/** @param {import('./config.mjs').Topology} topo */
|
|
16
17
|
export function edgeRuntimePlan(topo) {
|
|
17
18
|
return {
|
|
18
|
-
entities: [SN_PROBE, SN_ROUTE, SN_IPV6, LINK_CORE],
|
|
19
|
+
entities: [SN_PROBE, SN_ROUTE, SN_IPV6, SN_WAKE, LINK_CORE],
|
|
19
20
|
links: [[linkLinkName(topo.core.alias), LINK_CORE]],
|
|
20
21
|
};
|
|
21
22
|
}
|