ssh-net 26.9.11 → 26.9.17
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
CHANGED
|
@@ -3,8 +3,31 @@
|
|
|
3
3
|
本项目版本号与发布节奏仿 mihomo-cli:npm 公共分发,版本即升级动作。
|
|
4
4
|
版本号格式为**年.月.序号**(如 26.9.1)。序号**永不重置、跨月累加**——
|
|
5
5
|
月只是发布时间戳,序号是全局递增计数:26.9.7 之后是 26.9.8,进入 10 月
|
|
6
|
-
首发即 26.10.
|
|
7
|
-
0.x
|
|
6
|
+
首发即 26.10.18(2026-09-29 定,取代此前「序号每月重置」的约定);更早的
|
|
7
|
+
0.x 为过渡期编号。**序号 = 累计发包数**(2026-09-30 定):0.x 四个包
|
|
8
|
+
(0.1.0/0.1.1/0.2.0/0.2.1,registry 上无法 unpublish)+ 26.9.1–12 共 16 个,
|
|
9
|
+
故 26.9.12 之后跳号发 26.9.17(第 17 个包),13–16 永久空缺——序号从此与
|
|
10
|
+
第几个包严格一致,看到版本号即知发布总数
|
|
11
|
+
|
|
12
|
+
## [26.9.17] - 2026-09-30
|
|
13
|
+
|
|
14
|
+
### 变更(版本号对齐:序号=累计发包数,无行为变化)
|
|
15
|
+
|
|
16
|
+
- 26.9.12 之后跳号发 26.9.17:0.x 四个过渡包无法从 registry 撤下
|
|
17
|
+
(granular token 禁 unpublish),改为让序号与累计发包数对齐——
|
|
18
|
+
已发 16 个包,本版为第 17 个。13–16 永久空缺,此后序号即第几个包
|
|
19
|
+
(package.json 与 CHANGELOG 规则段同步)
|
|
20
|
+
|
|
21
|
+
## [26.9.12] - 2026-09-30
|
|
22
|
+
|
|
23
|
+
### 变更(清死代码:移除 -appIcon 自定义图标全链路,无行为变化)
|
|
24
|
+
|
|
25
|
+
- macOS 27 起废弃 `-appIcon`(terminal-notifier 启动时明说 ignored,
|
|
26
|
+
图标永远来自发送者 app bundle)——26.9.11 拷的 ssh-net-notify.png
|
|
27
|
+
在新系统上本就不显示。按「不留死代码」撤除:notify-user 的图标推导
|
|
28
|
+
与 `-appIcon` 参数、install 的图标拷贝(ensureResource)、uninstall
|
|
29
|
+
的图标清理、图标文件与生成脚本(libexec/vendor/、scripts/)。通知
|
|
30
|
+
图标现为 terminal-notifier 自己的终端图标,其余行为不变
|
|
8
31
|
|
|
9
32
|
## [26.9.11] - 2026-09-30
|
|
10
33
|
|
|
@@ -24,15 +47,15 @@
|
|
|
24
47
|
时每 10 分钟白白闪断一次 relay 长连接
|
|
25
48
|
- **线路状态系统通知**:新运行时脚本 `notify-user`。**mac 走 brew 的
|
|
26
49
|
terminal-notifier**(2026-09-30 用户定引入:osascript 发送者图标/点击
|
|
27
|
-
|
|
28
|
-
|
|
50
|
+
行为不可控),图标与点击行为归 terminal-notifier(macOS 27 起废弃
|
|
51
|
+
`-appIcon`,通知图标只能是发送者 app 的);缺 terminal-notifier
|
|
29
52
|
回退 osascript,Linux 走 notify-send;恒 0 不拖主流程。link 线路 mode
|
|
30
53
|
变化时弹出:「与 m4 的直连已就绪」/「经中继连接 m4(直连未就绪)」,
|
|
31
54
|
重估结果不变不刷。**没装/未授权不静默**(用户视角,2026-09-30):
|
|
32
55
|
`ssh-net install` 未装时给 brew 安装指引、已装时顺手 open 一次它的
|
|
33
56
|
.app 触发授权注册;`ssh-net status` 通知行始终说清现状;TN 在但未
|
|
34
57
|
授权时 link 日志留痕。三台 Mac 需 `brew install terminal-notifier`;
|
|
35
|
-
**升级后须重跑 `ssh-net install`**
|
|
58
|
+
**升级后须重跑 `ssh-net install`** 拷新脚本(不 install 也能跑,
|
|
36
59
|
只是没有通知)
|
|
37
60
|
- edge 安装清单同步加 `notify-user`;design §2.3/§6.1、notes(宽限定案、
|
|
38
61
|
macOS 通知授权路径)更新
|
|
@@ -7,7 +7,7 @@ import path from 'node:path';
|
|
|
7
7
|
import { buildForwardArgs } from '../lib/config.mjs';
|
|
8
8
|
import { CALLBACK_PORT } from '../lib/constants.mjs';
|
|
9
9
|
import { syncPlist, writeFileAtomic } from '../lib/manage.mjs';
|
|
10
|
-
import {
|
|
10
|
+
import { ensureRuntime } from '../lib/runtime.mjs';
|
|
11
11
|
import * as launchd from '../lib/launchd.mjs';
|
|
12
12
|
import * as systemd from '../lib/systemd.mjs';
|
|
13
13
|
import {
|
|
@@ -59,9 +59,6 @@ async function installEdge(ctx) {
|
|
|
59
59
|
['peer-up', 'peer-up'], // core 侧信令的接收端(notify-edge 经 ssh 调它)
|
|
60
60
|
['notify-user', 'notify-user'], // link 线路状态通知(mode 变化时调)
|
|
61
61
|
]);
|
|
62
|
-
// 通知自定义图标(terminal-notifier -appIcon 用,notify-user 从 bin/ 平级读);
|
|
63
|
-
// 缺失不影响通知本身(terminal-notifier 回退自带图标)
|
|
64
|
-
ensureResource(ctx, 'vendor/ssh-net-notify.png');
|
|
65
62
|
|
|
66
63
|
// 线路通知组件(用户视角提示,2026-09-30):已装则顺手 open 一次它的
|
|
67
64
|
// .app 触发通知授权注册(terminal-notifier 不主动请求权限,首次发通知
|
|
@@ -31,7 +31,6 @@ function uninstallEdge(ctx) {
|
|
|
31
31
|
rm(ctx.paths.binDir);
|
|
32
32
|
rm(ctx.paths.stateDir);
|
|
33
33
|
rm(ctx.paths.runtimeVersionFile);
|
|
34
|
-
rm(path.join(ctx.paths.sshNetDir, 'ssh-net-notify.png')); // install 拷的通知图标
|
|
35
34
|
rm(path.join(ctx.paths.logsDir, `${label}.log`));
|
|
36
35
|
return '已卸载。最后一步:npm uninstall -g ssh-net';
|
|
37
36
|
}
|
package/libexec/lib/runtime.mjs
CHANGED
|
@@ -53,25 +53,7 @@ export function ensureRuntime(ctx, entries) {
|
|
|
53
53
|
return r;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
/**
|
|
57
|
-
* 拷贝包内资源文件(如图标)到 ~/.ssh/ssh-net/ 根,幂等内容相同不重写。
|
|
58
|
-
* @param {object} ctx
|
|
59
|
-
* @param {string} fileName 相对 libexec/ 的包内路径(目标取 basename 落 sshNetDir 根,
|
|
60
|
-
* 与 notify-user 从 bin/ 平级读的位置一致)
|
|
61
|
-
* @returns {'created'|'updated'|'unchanged'}
|
|
62
|
-
*/
|
|
63
|
-
export function ensureResource(ctx, fileName) {
|
|
64
|
-
const dst = path.join(ctx.paths.sshNetDir, path.basename(fileName));
|
|
65
|
-
const src = packageScriptPath(fileName); // libexec/ 树下统一定位
|
|
66
|
-
const cur = fs.existsSync(dst) ? fs.readFileSync(dst) : null;
|
|
67
|
-
if (cur !== null && cur.equals(fs.readFileSync(src))) return 'unchanged';
|
|
68
|
-
const tmp = `${dst}.tmp-${process.pid}`;
|
|
69
|
-
fs.writeFileSync(tmp, fs.readFileSync(src), { mode: 0o644 });
|
|
70
|
-
fs.renameSync(tmp, dst);
|
|
71
|
-
return cur === null ? 'created' : 'updated';
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/** 刷新版本戳(ensureRuntime/ensureResource 共用) */
|
|
56
|
+
/** 刷新版本戳(ensureRuntime 尾部) */
|
|
75
57
|
function refreshStamp(ctx) {
|
|
76
58
|
const stamp = `${RUNTIME_VERSION}\n`;
|
|
77
59
|
const stampPath = ctx.paths.runtimeVersionFile;
|
package/libexec/notify-user
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
# notify-user:链路状态系统通知。优先 terminal-notifier(2026-09-30 用户定
|
|
3
3
|
# 引入:osascript 的发送者图标/点击行为不可控——点击会打开「脚本编辑器」;
|
|
4
4
|
# Apple Silicon 装 /opt/homebrew/bin、Intel /usr/local/bin,两处都探测,
|
|
5
|
-
# 也可用 SSH_NET_TERMINAL_NOTIFIER
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
5
|
+
# 也可用 SSH_NET_TERMINAL_NOTIFIER 显式指定——值不可执行=禁用并跳过探测)。
|
|
6
|
+
# 通知图标是 terminal-notifier 自己的终端图标:macOS 27 起废弃 -appIcon
|
|
7
|
+
# (图标永远来自发送者 app bundle,2026-09-30 实测 ignored),自定义图标
|
|
8
|
+
# 已无通路,不留死代码。缺它时回退 osascript(mac)/ notify-send(linux)。
|
|
9
|
+
# 通知失败静默、退出码恒 0——感知增强,绝不拖垮主流程(同 notify-edge 信条)。
|
|
10
|
+
# argv: <消息>
|
|
9
11
|
set -u
|
|
10
12
|
LC_ALL=C
|
|
11
13
|
export LC_ALL
|
|
@@ -25,13 +27,9 @@ msg=$1
|
|
|
25
27
|
[ -n "$msg" ] || exit 0
|
|
26
28
|
|
|
27
29
|
if [ -n "$T_N" ]; then
|
|
28
|
-
icon=${SSH_NET_NOTIFY_ICON:-}
|
|
29
|
-
[ -z "$icon" ] && icon="$(cd "$(dirname "$0")" 2>/dev/null && pwd)/../ssh-net-notify.png"
|
|
30
|
-
set -- -title ssh-net -message "$msg"
|
|
31
|
-
[ -f "$icon" ] && set -- "$@" -appIcon "$icon"
|
|
32
30
|
# 失败留痕到 link 日志:terminal-notifier 不主动请求权限,未授权时静默
|
|
33
31
|
# rc=3——用户视角唯一线索在这里(install/status 也有引导)
|
|
34
|
-
if ! out=$("$T_N" "
|
|
32
|
+
if ! out=$("$T_N" -title ssh-net -message "$msg" 2>&1); then
|
|
35
33
|
echo "$(/bin/date '+%F %T') 通知未送达:terminal-notifier 报告「$(printf '%s' "$out" | /usr/bin/head -n 1)」——系统设置→通知→terminal-notifier 允许,或 open 一次它的 .app 触发授权" >&2
|
|
36
34
|
fi
|
|
37
35
|
elif [ -x "$OSASCRIPT" ]; then
|
package/package.json
CHANGED
|
Binary file
|