dsh-remote-mobile 1.9.0 → 1.9.1
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 +13 -0
- package/lib/client.js +2 -2
- package/lib/routes/login-page.js +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.9.1] - 2026-10-17
|
|
9
|
+
|
|
10
|
+
### Fixed (解决 Issue #7 · 修复 /auth 登录页内联脚本语法错误导致局域网密码登录完全失效)
|
|
11
|
+
|
|
12
|
+
- **修复登录页内联脚本模板转义缺陷**:在 1.8.0 引入子路径/网关前缀自适应时,`src/routes/login-page.ts` 内使用 ES6 模板字符串拼接登录页内联 `<script>`,其中第 344/356/365 行的正则字面量写为 `window.location.pathname.replace(/\/auth\/?$/, ...)`。外层模板字符串反引号在求值时将 `\/` 折叠为 `/`,导致下发给客户端浏览器的内联脚本退化为 `replace(//auth/?$, ...)`,被 JS 词法解析器识别为单行注释吞掉后续代码并抛出 `SyntaxError: Unexpected token 'return'`:
|
|
13
|
+
- 内联脚本因此整体中断执行,表单 submit 监听器、`doVerify()`、RSA 密钥提取与 `/api/remote-mobile/verify` 接口调用均未注册,表现为局域网设备输入正确长期密码点击「立即授权连接」无任何反应,输入错误密码也无错误提示并退化为原生 GET 刷新;
|
|
14
|
+
- 现改用 `new RegExp('/auth/?$')` 显式构造正则对象,彻底消除模板字符串与正则字面量转义规则的歧义与折叠风险。
|
|
15
|
+
- **测试覆盖与语法保障**:
|
|
16
|
+
- 在 `test/routes.test.js` 中新增针对中英双语 `/auth` 页面内联 `<script>` 的自动化测试,通过 `new Function(...)` 语法解析并断言无 `SyntaxError`,且严禁出现未转义退化的 `//auth` 注释;
|
|
17
|
+
- 在 `test/compat.test.js` 中新增对所有注入到客户端的 5 个 Snippet 脚本的 `new Function(...)` 语法合法性全量断言。
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
8
21
|
## [1.9.0] - 2026-10-09
|
|
9
22
|
|
|
10
23
|
### Fixed (适配 DSH 0.1.7+ 配置存储变更,修复插件配置无法持久化)
|
package/lib/client.js
CHANGED
|
@@ -3538,8 +3538,8 @@ function StylesCard({ lang, showToast }) {
|
|
|
3538
3538
|
}
|
|
3539
3539
|
|
|
3540
3540
|
// src/client/version.js
|
|
3541
|
-
var PLUGIN_VERSION = "v1.9.
|
|
3542
|
-
var BUILD_TIME = "2026-10-
|
|
3541
|
+
var PLUGIN_VERSION = "v1.9.1";
|
|
3542
|
+
var BUILD_TIME = "2026-10-17 19:11:57";
|
|
3543
3543
|
|
|
3544
3544
|
// src/client/components/MainSection.jsx
|
|
3545
3545
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
package/lib/routes/login-page.js
CHANGED
|
@@ -338,7 +338,7 @@ export function getLoginPageHtml(publicKeyPem, lang = 'zh') {
|
|
|
338
338
|
if (document.baseURI && document.querySelector('base')) {
|
|
339
339
|
return new URL('api/remote-mobile/verify', document.baseURI).toString();
|
|
340
340
|
}
|
|
341
|
-
const pathname = window.location.pathname.replace(
|
|
341
|
+
const pathname = window.location.pathname.replace(new RegExp('/auth/?$'), '/');
|
|
342
342
|
return new URL('api/remote-mobile/verify', window.location.origin + pathname).toString();
|
|
343
343
|
} catch (e) {
|
|
344
344
|
return '/api/remote-mobile/verify';
|
|
@@ -350,7 +350,7 @@ export function getLoginPageHtml(publicKeyPem, lang = 'zh') {
|
|
|
350
350
|
// 预留参数能力:支持通过 ?redirect=/path 携带登录后重定向目标
|
|
351
351
|
const redirectParam = urlParams.get('redirect');
|
|
352
352
|
if (redirectParam && redirectParam.startsWith('/') && !redirectParam.startsWith('//')) {
|
|
353
|
-
const appPrefix = window.location.pathname.replace(
|
|
353
|
+
const appPrefix = window.location.pathname.replace(new RegExp('/auth/?$'), '');
|
|
354
354
|
if (appPrefix && redirectParam.startsWith(appPrefix)) {
|
|
355
355
|
return window.location.origin + redirectParam;
|
|
356
356
|
}
|
|
@@ -359,7 +359,7 @@ export function getLoginPageHtml(publicKeyPem, lang = 'zh') {
|
|
|
359
359
|
if (document.baseURI && document.querySelector('base')) {
|
|
360
360
|
return new URL('./', document.baseURI).toString();
|
|
361
361
|
}
|
|
362
|
-
const appPrefix = window.location.pathname.replace(
|
|
362
|
+
const appPrefix = window.location.pathname.replace(new RegExp('/auth/?$'), '/');
|
|
363
363
|
return window.location.origin + appPrefix;
|
|
364
364
|
} catch (e) {
|
|
365
365
|
return '/';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-remote-mobile",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"description": "DeepSeek Harness 远程与移动端安全网关插件:零修改 DSH 底层代码安全开放局域网与 Tailscale 连接 | DeepSeek Harness (DSH) Remote & Mobile Security Guard: safely opens Tailscale/LAN with zero core modifications, QR scan auth, RSA encryption & brute-force defense.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|