@mrrisega/dsh-remote 0.3.0
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/LICENSE +81 -0
- package/README.md +103 -0
- package/clients/dsh-remote/dsh-bridge.mjs +658 -0
- package/clients/dsh-remote/package.json +11 -0
- package/clients/dsh-remote/src/lifecycle.mjs +3 -0
- package/clients/dsh-remote/test/bridge-gzip.test.mjs +215 -0
- package/clients/dsh-remote/test/lifecycle.test.mjs +7 -0
- package/clients/dsh-remote/test/tunnel-auth.test.mjs +111 -0
- package/docs/self-hosting.md +109 -0
- package/dsh-setup.mjs +616 -0
- package/package.json +37 -0
- package/packages/dsh-remote-ui/README.md +81 -0
- package/packages/dsh-remote-ui/lib/client.js +1173 -0
- package/packages/dsh-remote-ui/lib/index.js +733 -0
- package/packages/dsh-remote-ui/package.json +26 -0
- package/packages/dsh-remote-ui/test/account-info.test.mjs +92 -0
- package/packages/dsh-remote-ui/test/account-switch.test.mjs +80 -0
- package/packages/dsh-remote-ui/test/feedback-proxy.test.mjs +154 -0
- package/packages/dsh-remote-ui/test/register-proxy.test.mjs +52 -0
- package/packages/dsh-remote-ui/test/settings-entry.test.mjs +282 -0
- package/packages/dsh-remote-ui/test/sms-captcha-ui.test.mjs +123 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
PolyForm Noncommercial License 1.0.0
|
|
2
|
+
|
|
3
|
+
<https://polyformproject.org/licenses/noncommercial/1.0.0>
|
|
4
|
+
|
|
5
|
+
Required Notice: Copyright (c) 2026 dsh-remote contributors (https://github.com/mrRisega/dsh-remote)
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Acceptance
|
|
10
|
+
|
|
11
|
+
In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
|
|
12
|
+
|
|
13
|
+
Copyright License
|
|
14
|
+
|
|
15
|
+
The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to Distribution License and make changes or new works based on the software according to Changes and New Works License.
|
|
16
|
+
|
|
17
|
+
Distribution License
|
|
18
|
+
|
|
19
|
+
The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by Changes and New Works License.
|
|
20
|
+
|
|
21
|
+
Notices
|
|
22
|
+
|
|
23
|
+
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with Required Notice: that the licensor provided with the software. For example:
|
|
24
|
+
|
|
25
|
+
Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
26
|
+
|
|
27
|
+
Changes and New Works License
|
|
28
|
+
|
|
29
|
+
The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
|
|
30
|
+
|
|
31
|
+
Patent License
|
|
32
|
+
|
|
33
|
+
The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
|
|
34
|
+
|
|
35
|
+
Noncommercial Purposes
|
|
36
|
+
|
|
37
|
+
Any noncommercial purpose is a permitted purpose.
|
|
38
|
+
|
|
39
|
+
Personal Uses
|
|
40
|
+
|
|
41
|
+
Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
|
|
42
|
+
|
|
43
|
+
Noncommercial Organizations
|
|
44
|
+
|
|
45
|
+
Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
|
|
46
|
+
|
|
47
|
+
Fair Use
|
|
48
|
+
|
|
49
|
+
You may have "fair use" rights for the software under the law. These terms do not limit them.
|
|
50
|
+
|
|
51
|
+
No Other Rights
|
|
52
|
+
|
|
53
|
+
These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
|
|
54
|
+
|
|
55
|
+
Patent Defense
|
|
56
|
+
|
|
57
|
+
If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
58
|
+
|
|
59
|
+
Violations
|
|
60
|
+
|
|
61
|
+
The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
|
|
62
|
+
|
|
63
|
+
No Liability
|
|
64
|
+
|
|
65
|
+
As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.
|
|
66
|
+
|
|
67
|
+
Definitions
|
|
68
|
+
|
|
69
|
+
The licensor is the individual or entity offering these terms, and the software is the software the licensor makes available under these terms.
|
|
70
|
+
|
|
71
|
+
You refers to the individual or entity agreeing to these terms.
|
|
72
|
+
|
|
73
|
+
Your company is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization.
|
|
74
|
+
|
|
75
|
+
Control means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
76
|
+
|
|
77
|
+
Your licenses are all the licenses granted to you for the software under these terms.
|
|
78
|
+
|
|
79
|
+
Use means anything you do with the software requiring one of your licenses.
|
|
80
|
+
|
|
81
|
+
© PolyForm Project Inc.
|
package/README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# dsh-remote
|
|
2
|
+
|
|
3
|
+
在手机浏览器上远程控制电脑端的 DeepSeek Harness(`dsh web`),操作体验与坐在电脑前一致。
|
|
4
|
+
|
|
5
|
+
dsh-remote 是一个轻量的**隧道模式**远程控制方案:电脑端运行一个守护进程(bridge),
|
|
6
|
+
主动连接中继服务器(relay-router)注册为在线设备;手机浏览器打开 PWA 页面,
|
|
7
|
+
登录后选择设备,即可经隧道进入电脑上的 `dsh web`(HTTP / WebSocket 全量透传)。
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
手机浏览器
|
|
11
|
+
└─ /app/ (PWA) 登录 → /_devices 实时设备列表 → 选择设备
|
|
12
|
+
│
|
|
13
|
+
nginx (HTTPS)
|
|
14
|
+
├─ /app/ → 静态 PWA (native.html)
|
|
15
|
+
├─ /_devices /_quota /_login /remote/ /_bridge / → relay-router
|
|
16
|
+
└─ /_bridge → relay-router (WebSocket)
|
|
17
|
+
└→ bridge (电脑端) → 127.0.0.1:3080 (dsh web)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 两个版本
|
|
21
|
+
|
|
22
|
+
| | 开源版(本仓库) | SaaS 云服务版 |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| 服务器 | 你自己部署(任意有公网 IP 的机器) | 由服务商托管 |
|
|
25
|
+
| 账号体系 | 无需账号:访问密钥认证(`/_login` 换本地 JWT) | 手机号 + 短信验证码 |
|
|
26
|
+
| 后台管理 | 无(密钥即实例管理员) | 超管后台(用户/套餐/审计) |
|
|
27
|
+
| 流量配额 | 可选(环境变量覆盖默认值) | 按套餐分层限速限流 |
|
|
28
|
+
| 许可证 | 本仓库(见下文 License) | 商业授权,闭源 |
|
|
29
|
+
|
|
30
|
+
两者可随时切换:电脑端插件面板「连接模式」一键切换,互不影响。
|
|
31
|
+
|
|
32
|
+
## 安装
|
|
33
|
+
|
|
34
|
+
需要 Node.js ≥ 20。电脑端**一条命令**完成安装:自动安装 bridge 与 dsh web 插件、
|
|
35
|
+
写入配置、创建开机自启服务:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx @mrrisega/dsh-remote
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
安装完成后运行下面命令打开设置页,用手机号+密码登录即可(注册在手机端完成,
|
|
42
|
+
登录后 bridge 自动启动):
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx @mrrisega/dsh-remote settings
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
自建模式(自己部署了 relay-router,无需账号体系):
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npx @mrrisega/dsh-remote setup --server wss://<你的域名>:端口 --key <访问密钥>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
其他命令:`settings`(设置页)、`status`(查看状态)、`run`(前台调试)、
|
|
55
|
+
`plugin`(重装/卸载 dsh web 插件)。运行 `npx @mrrisega/dsh-remote --help` 查看完整说明。
|
|
56
|
+
|
|
57
|
+
源码安装(开发 / 自建服务器):`git clone https://github.com/mrRisega/dsh-remote.git`
|
|
58
|
+
并 `npm install`,见下文各组件说明。
|
|
59
|
+
|
|
60
|
+
## 自建部署(开源版)
|
|
61
|
+
|
|
62
|
+
1. 在有公网 HTTPS 入口的服务器上部署 `relay-router`(见 [docs/self-hosting.md](docs/self-hosting.md)):
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
git clone https://github.com/mrRisega/dsh-remote.git && cd dsh-remote
|
|
66
|
+
npm install
|
|
67
|
+
bash deploy/install-open.sh # 生成 open.env(0600)并启动 router
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
或 Docker:`DSH_LOCAL_JWT_SECRET=… DSH_LOCAL_ACCESS_KEYS=… docker compose up -d`
|
|
71
|
+
|
|
72
|
+
2. nginx 反代:参考 [deploy/nginx-13443-remote-router.conf](deploy/nginx-13443-remote-router.conf)
|
|
73
|
+
(`/app/` 静态 PWA、`/_bridge` WebSocket 升级、其余路径转 router)。
|
|
74
|
+
3. 手机打开 `https://<你的域名>/app/`,用访问密钥登录。
|
|
75
|
+
4. 被控电脑执行上面的 `npx … setup --server … --key …`。
|
|
76
|
+
|
|
77
|
+
## 组件
|
|
78
|
+
|
|
79
|
+
| 组件 | 位置 | 说明 |
|
|
80
|
+
|---|---|---|
|
|
81
|
+
| relay-router | `packages/relay-router/` | 中继服务器:bridge 注册表、实时设备列表、HTTP/WS 透明代理、配额 |
|
|
82
|
+
| bridge | `clients/dsh-remote/` | 电脑端守护进程:连 router 注册,把转发帧代理到本地 `dsh web`;心跳自愈 |
|
|
83
|
+
| PWA | `clients/dsh-web/native.html` | 手机端:登录 / 注册 / 设备选择(单文件,零构建) |
|
|
84
|
+
| dsh web 插件 | `packages/dsh-remote-ui/` | 设置页「远程控制」面板:连接模式 / 账号 / bridge 启停 / 反馈 |
|
|
85
|
+
| 部署脚本 | `deploy/` | `install-open.sh` 自建引导、nginx 参考配置、Dockerfile / compose |
|
|
86
|
+
|
|
87
|
+
测试:`npm test`(router 契约 + 插件 + bridge 全部单测与回归)。
|
|
88
|
+
|
|
89
|
+
## 文档
|
|
90
|
+
|
|
91
|
+
- [docs/self-hosting.md](docs/self-hosting.md) — 开源自建完整指南(含安全提示)
|
|
92
|
+
- [CONTRIBUTING.md](CONTRIBUTING.md) — 贡献指南
|
|
93
|
+
- [SECURITY.md](SECURITY.md) — 安全策略与漏洞报告流程
|
|
94
|
+
- [CHANGELOG.md](CHANGELOG.md) — 版本记录
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
本仓库使用 **PolyForm Noncommercial 1.0.0**([LICENSE](LICENSE)):
|
|
99
|
+
个人、研究与非商业用途免费;商业用途(含内部自用与对外服务)需要商业授权,
|
|
100
|
+
见 [COMMERCIAL-LICENSE.md](COMMERCIAL-LICENSE.md)。
|
|
101
|
+
|
|
102
|
+
> 说明:本仓库是**源码公开、非商业许可**的项目,不属于 OSI 意义上的“开源”;
|
|
103
|
+
> 云服务(多用户账号、超管后台)为闭源商业组件,不在本仓库内。
|