dsh-mobile-plugin 0.5.152 → 0.5.153
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// 2026-12-01:自定义入口是 shebang 脚本时不再追加 --workdir,尊重脚本自带的 workdir(feedback 2179:6212)。
|
|
1
2
|
// 2026-11-29:所有 CLI 调用显式带 --workdir,普通用户不再落到客户端默认的 /etc/zeronews。
|
|
2
3
|
// 2026-11-28:补 downloadClientTo:换代时把新版下到 <bin>.next,旁边在跑的那份原样不动。
|
|
3
4
|
// ZeroNews 客户端获取层:自带 → 系统 PATH → 缓存 → 官方地址下载,四平台固定路径。
|
|
@@ -57,8 +58,27 @@ function workDirOf(binary) {
|
|
|
57
58
|
return path.dirname(String(binary || ''));
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* 自定义入口可能是包装脚本(DSHM_ZERONEWS_BIN 指过去的那份),脚本自己 exec 真客户端时已带
|
|
63
|
+
* --workdir;插件再追加一项,客户端按最后一项解析就会去错目录读不到 config.yml。
|
|
64
|
+
* 只读文件头两个字节判断 #!;读不到 / 读失败都当普通二进制,保持既有行为。
|
|
65
|
+
*/
|
|
66
|
+
function isShebangScript(binary) {
|
|
67
|
+
let fd;
|
|
68
|
+
try {
|
|
69
|
+
fd = fs.openSync(binary, 'r');
|
|
70
|
+
const head = Buffer.alloc(2);
|
|
71
|
+
return fs.readSync(fd, head, 0, 2, 0) === 2 && head[0] === 0x23 && head[1] === 0x21;
|
|
72
|
+
} catch {
|
|
73
|
+
return false;
|
|
74
|
+
} finally {
|
|
75
|
+
if (fd !== undefined) { try { fs.closeSync(fd); } catch { /* 关不掉也不影响判断 */ } }
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** 给一条 CLI 参数追加上 --workdir,所有子命令统一走这里,别漏;脚本入口自带 workdir 时不追加。 */
|
|
61
80
|
function withWorkDir(args, binary) {
|
|
81
|
+
if (isShebangScript(binary)) return [...args];
|
|
62
82
|
return [...args, '--workdir', workDirOf(binary)];
|
|
63
83
|
}
|
|
64
84
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mobile-plugin",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.153",
|
|
4
4
|
"description": "Mobile API (/api/mobile/v1) and relay client for the DSH mobile app — desktop profile build (dsh 0.2.x, peers resolved by the host)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"icon": "./icon.png",
|
|
@@ -117,22 +117,22 @@
|
|
|
117
117
|
"yaml": "2.9.1"
|
|
118
118
|
},
|
|
119
119
|
"dshMobileReleaseNotes": {
|
|
120
|
-
"version": "0.5.
|
|
120
|
+
"version": "0.5.153",
|
|
121
121
|
"kinds": [
|
|
122
122
|
"fix"
|
|
123
123
|
],
|
|
124
124
|
"notes": {
|
|
125
|
-
"zh-Hans": "-
|
|
126
|
-
"zh-Hant": "-
|
|
127
|
-
"en": "-
|
|
128
|
-
"ja": "-
|
|
129
|
-
"ko": "-
|
|
130
|
-
"de": "-
|
|
131
|
-
"es": "-
|
|
132
|
-
"fr": "-
|
|
133
|
-
"pt": "-
|
|
134
|
-
"ru": "-
|
|
135
|
-
"tr": "-
|
|
125
|
+
"zh-Hans": "- 修复 Cloudflare 账号命名隧道启动失败:点「连接」不再报「启动失败:file 不能为空」,配好域名和凭据后隧道能正常起来。\n- 修复用自定义脚本启动 ZeroNews 时线路连不上:插件不再覆盖脚本自带的工作目录,按脚本自己的配置读取,隧道可以正常连接。",
|
|
126
|
+
"zh-Hant": "- 修復 Cloudflare 帳號命名隧道啟動失敗:點「連線」不再報「啟動失敗:file 不能為空」,配好網域和憑證後隧道能正常啟動。\n- 修復用自訂腳本啟動 ZeroNews 時線路連不上:外掛不再覆蓋腳本自帶的工作目錄,按腳本自己的設定讀取,隧道可以正常連線。",
|
|
127
|
+
"en": "- Fixed Cloudflare named tunnels (your own account) failing to start: tapping Connect no longer reports \"launch failed: file cannot be empty\". With a domain and credentials configured, the tunnel now starts normally.\n- Fixed ZeroNews routes failing when launched through a custom script: the plugin no longer overrides the working directory that the script sets itself, so it reads its own config and the tunnel connects normally.",
|
|
128
|
+
"ja": "- Cloudflare のアカウント命名トンネルが起動しない問題を修正:「接続」をタップしても「起動失敗:file が空」と出なくなり、ドメインと認証情報を設定すればトンネルが正常に起動します。\n- カスタムスクリプトで ZeroNews を起動したときに経路がつながらない問題を修正:プラグインがスクリプト自身の作業ディレクトリを上書きしなくなり、スクリプト自身の設定を読み込んでトンネルが正常に接続します。",
|
|
129
|
+
"ko": "- Cloudflare 계정 명명 터널이 시작되지 않던 문제를 수정했습니다. \"연결\"을 눌러도 \"시작 실패: file이 비어 있음\" 오류가 더 이상 나지 않으며, 도메인과 인증 정보를 설정하면 터널이 정상적으로 시작됩니다.\n- 사용자 지정 스크립트로 ZeroNews를 시작할 때 경로가 연결되지 않던 문제를 수정했습니다. 플러그인이 스크립트 자체의 작업 디렉터리를 덮어쓰지 않아 자체 설정을 읽어 터널이 정상적으로 연결됩니다.",
|
|
130
|
+
"de": "- Behoben: Cloudflare-Namens-Tunnel (eigenes Konto) ließen sich nicht starten. \"Verbinden\" meldet nicht mehr \"Start fehlgeschlagen: file ist leer\"; mit konfigurierter Domain und Zugangsdaten startet der Tunnel jetzt normal.\n- Behoben: ZeroNews-Routen funktionierten bei Start über ein benutzerdefiniertes Skript nicht. Das Plugin überschreibt das vom Skript selbst gesetzte Arbeitsverzeichnis nicht mehr, liest dessen eigene Konfiguration und der Tunnel verbindet sich wieder normal.",
|
|
131
|
+
"es": "- Corregido: los túneles con nombre de Cloudflare (cuenta propia) no arrancaban. Al pulsar \"Conectar\" ya no aparece \"error al iniciar: file está vacío\"; con el dominio y las credenciales configurados, el túnel arranca con normalidad.\n- Corregido: las rutas de ZeroNews no se conectaban al iniciarse con un script personalizado. El plugin ya no sobrescribe el directorio de trabajo que el script define por sí mismo, lee su propia configuración y el túnel se conecta con normalidad.",
|
|
132
|
+
"fr": "- Corrigé : les tunnels nommés Cloudflare (compte personnel) ne démarraient pas. Le bouton « Connecter » n'affiche plus « échec du démarrage : file est vide » ; une fois le domaine et les identifiants configurés, le tunnel démarre normalement.\n- Corrigé : les routes ZeroNews ne se connectaient pas lors d'un lancement par un script personnalisé. Le plugin n'écrase plus le répertoire de travail défini par le script lui-même, lit sa propre configuration et le tunnel se connecte normalement.",
|
|
133
|
+
"pt": "- Corrigido: os túneis nomeados da Cloudflare (conta própria) não iniciavam. Ao tocar em \"Conectar\", não aparece mais \"falha ao iniciar: file está vazia\"; com o domínio e as credenciais configurados, o túnel inicia normalmente.\n- Corrigido: as rotas do ZeroNews não conectavam ao ser iniciadas por um script personalizado. O plugin não substitui mais o diretório de trabalho definido pelo próprio script, lê a configuração do script e o túnel conecta normalmente.",
|
|
134
|
+
"ru": "- Исправлено: именованные туннели Cloudflare (собственной учётной записи) не запускались. При нажатии «Подключить» больше не появляется ошибка «не удалось запустить: file пуст»; с настроенным доменом и учётными данными туннель запускается нормально.\n- Исправлено: маршруты ZeroNews не подключались при запуске через пользовательский сценарий. Плагин больше не перезаписывает рабочую директорию, заданную самим сценарием, читает его собственную конфигурацию, и туннель подключается нормально.",
|
|
135
|
+
"tr": "- Düzeltildi: Cloudflare adlı tüneller (kendi hesabınız) başlatılamıyordu. \"Bağlan\"a dokunduğunuzda artık \"başlatma hatası: file boş\" mesajı çıkmıyor; alan adı ve kimlik bilgileri ayarlandığında tünel normal şekilde başlıyor.\n- Düzeltildi: ZeroNews rotaları özel bir betikle başlatıldığında bağlanmıyordu. Eklenti artık betiğin kendi çalışma dizinini üzerine yazmıyor, betiğin kendi yapılandırmasını okuyor ve tünel normal şekilde bağlanıyor."
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
}
|