@eduwork/dsh-remote-access 0.1.2 → 0.1.3

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
@@ -1,5 +1,10 @@
1
1
  # 变更记录 / Changelog
2
2
 
3
+ ## 0.1.3 — Unreleased
4
+
5
+ - 兼容声明接纳已验证的 DSH 0.2.2-rc.1 与 Cordis 4.1;保留原有功能、配置及受支持的旧宿主范围。
6
+ - Accept qualified DSH 0.2.2-rc.1 and Cordis 4.1 peers, retaining existing behavior, configuration and supported older hosts.
7
+
3
8
  ## 0.1.2 — 2026-10-26
4
9
 
5
10
  - 修复运行中安装或启用远控插件后,远端无法保存预览版说明确认状态的问题。
package/LICENSE CHANGED
@@ -1,21 +1,130 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 East China Normal University
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+
2
+ 木兰宽松许可证, 第2版
3
+
4
+ 木兰宽松许可证, 第2版
5
+
6
+ 2020年1月 http://license.coscl.org.cn/MulanPSL2
7
+
8
+ 您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束:
9
+
10
+ 0. 定义
11
+
12
+ “软件” 是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。
13
+
14
+ “贡献” 是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。
15
+
16
+ “贡献者” 是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。
17
+
18
+ “法人实体” 是指提交贡献的机构及其“关联实体”。
19
+
20
+ “关联实体” 是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。
21
+
22
+ 1. 授予版权许可
23
+
24
+ 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。
25
+
26
+ 2. 授予专利许可
27
+
28
+ 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。
29
+
30
+ 3. 无商标许可
31
+
32
+ “本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。
33
+
34
+ 4. 分发限制
35
+
36
+ 您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。
37
+
38
+ 5. 免责声明与责任限制
39
+
40
+ “软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。
41
+
42
+ 6. 语言
43
+
44
+ “本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。
45
+
46
+ 条款结束
47
+
48
+ 如何将木兰宽松许可证,第2版,应用到您的软件
49
+
50
+ 如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步:
51
+
52
+ 1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;
53
+
54
+ 2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中;
55
+
56
+ 3, 请将如下声明文本放入每个源文件的头部注释中。
57
+
58
+ Copyright (c) [Year] [name of copyright holder]
59
+ [Software Name] is licensed under Mulan PSL v2.
60
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
61
+ You may obtain a copy of Mulan PSL v2 at:
62
+ http://license.coscl.org.cn/MulanPSL2
63
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
64
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
65
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
66
+ See the Mulan PSL v2 for more details.
67
+
68
+ Mulan Permissive Software License,Version 2
69
+
70
+ Mulan Permissive Software License,Version 2 (Mulan PSL v2)
71
+
72
+ January 2020 http://license.coscl.org.cn/MulanPSL2
73
+
74
+ Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions:
75
+
76
+ 0. Definition
77
+
78
+ Software means the program and related documents which are licensed under this License and comprise all Contribution(s).
79
+
80
+ Contribution means the copyrightable work licensed by a particular Contributor under this License.
81
+
82
+ Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License.
83
+
84
+ Legal Entity means the entity making a Contribution and all its Affiliates.
85
+
86
+ Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity.
87
+
88
+ 1. Grant of Copyright License
89
+
90
+ Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not.
91
+
92
+ 2. Grant of Patent License
93
+
94
+ Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken.
95
+
96
+ 3. No Trademark License
97
+
98
+ No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in section 4.
99
+
100
+ 4. Distribution Restriction
101
+
102
+ You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software.
103
+
104
+ 5. Disclaimer of Warranty and Limitation of Liability
105
+
106
+ THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
107
+
108
+ 6. Language
109
+
110
+ THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL.
111
+
112
+ END OF THE TERMS AND CONDITIONS
113
+
114
+ How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software
115
+
116
+ To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps:
117
+
118
+ i. Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner;
119
+ ii. Create a file named "LICENSE" which contains the whole context of this License in the first directory of your software package;
120
+ iii. Attach the statement to the appropriate annotated syntax at the beginning of each source file.
121
+
122
+ Copyright (c) [Year] [name of copyright holder]
123
+ [Software Name] is licensed under Mulan PSL v2.
124
+ You can use this software according to the terms and conditions of the Mulan PSL v2.
125
+ You may obtain a copy of Mulan PSL v2 at:
126
+ http://license.coscl.org.cn/MulanPSL2
127
+ THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
128
+ EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
129
+ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
130
+ See the Mulan PSL v2 for more details.
package/LICENSE-MIT ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 East China Normal University
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/LICENSING.md ADDED
@@ -0,0 +1,17 @@
1
+ # 许可范围 / Licensing scope
2
+
3
+ 本目录的主许可证为木兰宽松许可证第 2 版(`MulanPSL-2.0`),全文见 [LICENSE](LICENSE)。许可切换以引入本说明的提交为界,面向此后的项目原创贡献;文件、子目录或第三方声明另有规定的,按其独立许可执行。
4
+
5
+ 切换前的 MIT 源码基线见 [@eduwork/dsh-remote-access 历史源码](https://github.com/ECNU/EduWork/tree/a43a4d424c9d25668589dfe94a3871318ce299ff/packages/dsh-remote-access)。该基线中的贡献仍保留原 MIT 授权及权利人,原许可全文保留在 [LICENSE-MIT](LICENSE-MIT)。历史 Git 记录和已有文件声明中的作者归属继续有效;根目录的机构版权声明不表示其他贡献者转让了版权。既有版本及 npm 发布包不因本次切换改变许可。
6
+
7
+ 后续分发如果同时包含木兰许可贡献与历史 MIT 代码,须保留两份许可证及相关声明。因此对应源码模块的 SPDX 表达式为 `MulanPSL-2.0 AND MIT`,表示不同来源代码各自适用的义务,并非所有代码可任选一种许可。历史 MIT 贡献者不会仅因本次切换被视为作出了新的木兰专利授权。
8
+
9
+ 新增原创贡献按木兰许可提交;投稿者应确认自己有权授予其贡献中涉及的版权和专利许可。引入的第三方代码继续保留原许可证、版权及来源,不适用此默认规则。
10
+
11
+ The primary license for this directory is Mulan Permissive Software License v2 (`MulanPSL-2.0`); see [LICENSE](LICENSE). This policy applies to new original project contributions after the commit introducing this notice. More specific file, directory, and third-party notices retain their own terms.
12
+
13
+ The [pre-transition MIT source baseline](https://github.com/ECNU/EduWork/tree/a43a4d424c9d25668589dfe94a3871318ce299ff/packages/dsh-remote-access) retains its original MIT grants and rightsholders; the complete notice is preserved in [LICENSE-MIT](LICENSE-MIT). Attribution in Git history and existing notices remains effective. An institutional copyright notice does not assign other contributors' copyrights. Previously distributed versions and npm archives keep their existing licenses.
14
+
15
+ Distributions combining new Mulan-licensed contributions and historical MIT code must retain both licenses and their notices. The source-module SPDX expression `MulanPSL-2.0 AND MIT` describes these separately licensed portions, not a choice of license for all code. This change does not make historical MIT contributors grant additional patent rights under Mulan.
16
+
17
+ New original contributions are submitted under MulanPSL-2.0 by contributors entitled to grant the relevant copyright and patent rights. Third-party code retains its existing license and provenance. No trademark or artwork permission is inferred from this code-license policy.
package/README.md CHANGED
@@ -17,12 +17,12 @@
17
17
 
18
18
  ```sh
19
19
  RELAY_URL=https://remote.example.edu/ RELAY_ACCESS_KEYS=替换成随机Key \
20
- npx --yes --package=@eduwork/dsh-remote-access@0.1.1 eduwork-remote-relay
20
+ npx --yes --package=@eduwork/dsh-remote-access@0.1.2 eduwork-remote-relay
21
21
  ```
22
22
 
23
23
  `RELAY_URL` 是用户访问中继的公开地址;`RELAY_ACCESS_KEYS` 是发给电脑主人的接入密钥,多个用逗号分隔。中继默认监听 `127.0.0.1:8787`,可用 `HOST`、`PORT` 修改;`<RELAY_URL>healthz` 返回 `ok`,可用于监控。
24
24
 
25
- 完整的 [中继部署指南](docs/DEPLOYMENT.md) 包含 Key 生成、Windows PowerShell 命令、HTTPS/Nginx、路径前缀、systemd 常驻运行、机构登录和 iframe 集成,以及启动后的验证与排错步骤。
25
+ 服务器推荐按 [Docker 部署指南](docs/docker/README.md) 使用 Dockerfile 和 Compose,从 npm 固定版本构建后用 `docker compose up -d --build` 启动。完整的 [中继部署指南](docs/DEPLOYMENT.md) 还包含 Key 生成、Windows PowerShell 命令、HTTPS/Nginx、路径前缀、systemd 常驻运行、机构登录和 iframe 集成,以及验证与排错步骤。
26
26
 
27
27
  中继也可以部署在同域的单独路径,例如 `RELAY_URL=https://example.edu/eduwork-remote/`。反向代理须保留此前缀,电脑上填写同一个完整地址。同域路径不隔离浏览器权限,部署者须确认站点与被配对电脑处于可接受的共同信任范围(见[安全](#安全));作用于整个站点的 Service Worker 还须放过这段路径。
28
28
 
package/README_EN.md CHANGED
@@ -17,12 +17,12 @@ You need Node.js 24.22.1 or later and a reverse proxy that serves HTTPS for the
17
17
 
18
18
  ```sh
19
19
  RELAY_URL=https://remote.example.edu/ RELAY_ACCESS_KEYS=replace-with-a-random-key \
20
- npx --yes --package=@eduwork/dsh-remote-access@0.1.1 eduwork-remote-relay
20
+ npx --yes --package=@eduwork/dsh-remote-access@0.1.2 eduwork-remote-relay
21
21
  ```
22
22
 
23
23
  `RELAY_URL` is the public address users reach the relay at; `RELAY_ACCESS_KEYS` are the comma-separated access keys you give to computer owners. The relay listens on `127.0.0.1:8787` by default; change it with `HOST` and `PORT`. `<RELAY_URL>healthz` answers `ok` for monitoring.
24
24
 
25
- The [relay deployment guide](docs/DEPLOYMENT_EN.md) covers key generation, Windows PowerShell commands, HTTPS/Nginx, path prefixes, persistent systemd operation, organization sign-in, iframe integration, verification and troubleshooting.
25
+ For servers, the [Docker deployment guide](docs/docker/README_EN.md) provides a Dockerfile and Compose setup that builds from a pinned npm version and starts with `docker compose up -d --build`. The [relay deployment guide](docs/DEPLOYMENT_EN.md) also covers key generation, Windows PowerShell commands, HTTPS/Nginx, path prefixes, persistent systemd operation, organization sign-in, iframe integration, verification and troubleshooting.
26
26
 
27
27
  The relay can also share a domain under its own path, such as `RELAY_URL=https://example.edu/eduwork-remote/`. Preserve the prefix in proxy requests and enter the same complete URL on the computer. Paths do not isolate browser privileges: the operator must accept the shared trust boundary between the site's applications and paired computers (see [Security](#security)). A site-wide Service Worker must also leave this path alone.
28
28
 
@@ -1,9 +1,9 @@
1
1
  # 第三方声明
2
2
 
3
- `@eduwork/dsh-remote-access` 使用 MIT 许可证。发布产物打包了下列软件包的代码;构建脚本从实际打包的依赖收集各包的许可证全文,随包放在 `lib/THIRD_PARTY_LICENSES.txt`。精确版本见 `package-lock.json`。
3
+ `@eduwork/dsh-remote-access` 的原创贡献使用木兰 PSL v2,历史 MIT 授权保留,详见[许可范围](LICENSING.md)。发布产物打包了下列软件包的代码;构建脚本从实际打包的依赖收集各包的许可证全文,随包放在 `lib/THIRD_PARTY_LICENSES.txt`。精确版本见 `package-lock.json`。
4
4
 
5
5
  - 宿主插件与网页客户端的加密:`noise-handshake`、`b4a`(Apache-2.0),`sodium-javascript`、`sodium-universal`、`blake2b-wasm`、`siphash24`、`xsalsa20`(MIT),`blake2b`、`chacha20-universal`、`nanoassert`、`sha256-universal`、`sha256-wasm`、`sha512-universal`、`sha512-wasm`(ISC)。
6
6
  - 中继服务:`ws`(MIT)。
7
7
  - 设置页:`zod`、`uqr`(MIT)。
8
8
 
9
- DeepSeek Harness 软件包、`@deepseek-ai/cordis`、`@deepseek-ai/schemastery` 和 React 由宿主提供,作为 peer dependency 出现,不打包进本包,也不表示其作者认可本项目。网页图标取自 EduWork 自有 Logo,随本项目 MIT 许可提供。
9
+ DeepSeek Harness 软件包、`@deepseek-ai/cordis`、`@deepseek-ai/schemastery` 和 React 由宿主提供,作为 peer dependency 出现,不打包进本包,也不表示其作者认可本项目。网页图标取自 EduWork 自有 Logo,按本项目[许可范围](LICENSING.md)中的代码/素材声明使用;代码许可不授予商标权。
@@ -4,9 +4,15 @@
4
4
 
5
5
  中继和桌面插件由同一个 npm 包 `@eduwork/dsh-remote-access` 交付。服务器只需运行包里的 `eduwork-remote-relay`,无需安装 EduWork 桌面客户端、模型服务或数据库。被访问的电脑运行 DSH/EduWork 和远控插件,其他终端通过浏览器访问中继的 HTTPS 地址。
6
6
 
7
+ ## Docker 快速部署
8
+
9
+ 推荐服务器使用 [Docker 部署指南](docker/README.md):提供 Dockerfile、Compose 和脱敏的 `relay.env.example`,镜像从 npm 安装固定的 `0.1.2`,配置好访问地址和认证后用 `docker compose up -d --build` 启动。支持根路径、路径前缀、Key / OIDC 认证和 iframe 集成。HTTPS 由自己的反向代理提供,容器健康检查自动使用配置中的路径前缀。
10
+
11
+ 下面保留直接使用 Node.js 和 systemd 的部署方式,两种方式使用相同的中继配置。
12
+
7
13
  ## 1. 启动服务
8
14
 
9
- 准备 Node.js **24.22.1 或更新的受支持版本**、npm,以及可以转发 WebSocket 的 HTTPS 反向代理。以下命令固定使用 `0.1.1`,升级时明确修改版本号。
15
+ 准备 Node.js **24.22.1 或更新的受支持版本**、npm,以及可以转发 WebSocket 的 HTTPS 反向代理。以下命令固定使用 `0.1.2`,升级时明确修改版本号。
10
16
 
11
17
  先生成接入 Key,保存好并交给需要注册电脑的用户:
12
18
 
@@ -19,7 +25,7 @@ Linux/macOS 前台试运行:
19
25
  ```sh
20
26
  export RELAY_URL='https://remote.example.edu/'
21
27
  export RELAY_ACCESS_KEYS='替换成刚才生成的Key'
22
- npx --yes --package=@eduwork/dsh-remote-access@0.1.1 eduwork-remote-relay
28
+ npx --yes --package=@eduwork/dsh-remote-access@0.1.2 eduwork-remote-relay
23
29
  ```
24
30
 
25
31
  Windows PowerShell:
@@ -27,7 +33,7 @@ Windows PowerShell:
27
33
  ```powershell
28
34
  $env:RELAY_URL = 'https://remote.example.edu/'
29
35
  $env:RELAY_ACCESS_KEYS = '替换成刚才生成的Key'
30
- npx --yes --package=@eduwork/dsh-remote-access@0.1.1 eduwork-remote-relay
36
+ npx --yes --package=@eduwork/dsh-remote-access@0.1.2 eduwork-remote-relay
31
37
  ```
32
38
 
33
39
  默认监听 `127.0.0.1:8787`。`RELAY_URL` 是**用户访问的外部地址**,不是监听地址;TLS 在反向代理终止。前台命令退出就会停止服务,长期运行见第 3 节。只在本机调试时可使用 `http://localhost:8787/`;手机访问应使用具有有效证书的 HTTPS 地址,以便浏览器使用 Service Worker 和加密 API。
@@ -84,7 +90,7 @@ location /eduwork-remote/ {
84
90
  ```sh
85
91
  sudo useradd --system --no-create-home --shell /usr/sbin/nologin eduwork-remote
86
92
  sudo install -d /opt/eduwork-remote /etc/eduwork-remote
87
- sudo npm install --prefix /opt/eduwork-remote --omit=dev --ignore-scripts --save-exact @eduwork/dsh-remote-access@0.1.1
93
+ sudo npm install --prefix /opt/eduwork-remote --omit=dev --ignore-scripts --save-exact @eduwork/dsh-remote-access@0.1.2
88
94
  sudo install -m 600 /dev/null /etc/eduwork-remote/relay.env
89
95
  ```
90
96
 
@@ -131,7 +137,9 @@ curl -fsS https://example.edu/eduwork-remote/healthz
131
137
  curl -I https://example.edu/eduwork-remote/sw.js
132
138
  ```
133
139
 
134
- 前两项应返回 `ok`,第三项应返回 200 和 JavaScript 内容类型。健康检查只说明 HTTP 服务可达;还须在桌面“设置 → 远程访问”填写同一外部地址和 Key,启用后确认“已连接”。随后按[配对步骤](../README.md#添加和移除设备)从另一终端接入,并在本机核对配对码、确认授权。接入 Key 允许电脑使用中继,不能替代这次设备配对。
140
+ 前两项应返回 `ok`,第三项应返回 200 和 JavaScript 内容类型。健康检查只说明 HTTP 服务可达。使用插件 `0.1.2` 时,在桌面“设置 → 远程访问”选择自己的中继,填写同一外部地址和 Key,点“测试连接”,分别核对服务可达性与身份验证结果;尚未开启远控也可以测试。随后开启“允许远程访问”,确认“已连接”;失败时可点“重试”。
141
+
142
+ 点“添加设备”,按[配对步骤](../README.md#添加和移除设备)从另一终端接入,在本机核对配对码、确认授权。接入 Key 允许电脑使用中继,不能替代这次设备配对。
135
143
 
136
144
  ## 5. 机构登录与 iframe(可选)
137
145
 
@@ -145,7 +153,7 @@ RELAY_FRAME_ANCESTORS=self https://portal.example.edu
145
153
 
146
154
  单用机构登录时不设 `RELAY_ACCESS_KEYS`。`issuer` 必须与 Token 的 `iss` 完全一致,client ID 是桌面应用的 OIDC 客户端标识;多个 ID 用逗号分隔。中继从 discovery/JWKS 获取公钥,当前支持 **RS256 ID Token**,校验签名、issuer、audience/authorized party 和有效期;这里不是模型 API Key,也不是拿 access token 充当 ID Token。
147
155
 
148
- 电脑需安装 `@eduwork/dsh-oidc@0.3.1` 或后续兼容版本,并由发行版配置远控插件的 `organization: { relay, oidcProfileId }`。单纯设置服务端的 issuer 不会自动配置桌面登录。中继验证已有身份,不保存 refresh token,也不替用户登录;续期由电脑的 OIDC 插件处理。
156
+ 电脑需安装 `@eduwork/dsh-oidc@0.3.1` 或后续兼容版本,并由发行版配置远控插件的 `organization: { relay, oidcProfileId }`。单纯设置服务端的 issuer 不会自动配置桌面登录。配置完成后,`0.1.2` 的设置页支持使用机构账号、登录及测试连接,也允许用户切换到自己的中继;机构模式下的中继地址由发行版指定。中继验证已有身份,不保存 refresh token,也不替用户登录;续期由电脑的 OIDC 插件处理。
149
157
 
150
158
  `RELAY_FRAME_ANCESTORS` 默认 `none`,禁止 iframe 嵌入。允许同源父页面时填 `self`,其他父页面填完整来源(协议、主机和可选端口,不含路径)。在 shell 中给多个来源加引号:`RELAY_FRAME_ANCESTORS="self https://portal.example.edu"`。父站自己的 CSP 也要允许加载中继,代理不能再给此路径附加冲突的 `X-Frame-Options: DENY` 或 `frame-ancestors 'none'`。
151
159
 
@@ -4,9 +4,15 @@
4
4
 
5
5
  The desktop plugin and relay ship in the same npm package, `@eduwork/dsh-remote-access`. The server runs `eduwork-remote-relay`; it does not need the EduWork desktop app, model services or a database. The accessed computer runs DSH/EduWork and the plugin, while other devices open the relay's HTTPS URL in a browser.
6
6
 
7
+ ## Quick deployment with Docker
8
+
9
+ For servers, use the [Docker deployment guide](docker/README_EN.md): a Dockerfile, Compose setup and sanitized `relay.env.example` install pinned version `0.1.2` from npm. Configure the public URL and authentication, then run `docker compose up -d --build`. Root paths, path prefixes, key / OIDC authentication and iframe integration are supported. Your reverse proxy provides HTTPS; the container health check follows the configured prefix automatically.
10
+
11
+ The direct Node.js and systemd alternatives below use the same relay configuration.
12
+
7
13
  ## 1. Start the service
8
14
 
9
- Use Node.js **24.22.1 or a later supported version**, npm, and an HTTPS reverse proxy supporting WebSockets. These examples pin `0.1.1`; change the version explicitly when upgrading.
15
+ Use Node.js **24.22.1 or a later supported version**, npm, and an HTTPS reverse proxy supporting WebSockets. These examples pin `0.1.2`; change the version explicitly when upgrading.
10
16
 
11
17
  Generate an access key, retain it and give it to the users registering computers:
12
18
 
@@ -19,7 +25,7 @@ Linux/macOS foreground run:
19
25
  ```sh
20
26
  export RELAY_URL='https://remote.example.edu/'
21
27
  export RELAY_ACCESS_KEYS='replace-with-the-generated-key'
22
- npx --yes --package=@eduwork/dsh-remote-access@0.1.1 eduwork-remote-relay
28
+ npx --yes --package=@eduwork/dsh-remote-access@0.1.2 eduwork-remote-relay
23
29
  ```
24
30
 
25
31
  Windows PowerShell:
@@ -27,7 +33,7 @@ Windows PowerShell:
27
33
  ```powershell
28
34
  $env:RELAY_URL = 'https://remote.example.edu/'
29
35
  $env:RELAY_ACCESS_KEYS = 'replace-with-the-generated-key'
30
- npx --yes --package=@eduwork/dsh-remote-access@0.1.1 eduwork-remote-relay
36
+ npx --yes --package=@eduwork/dsh-remote-access@0.1.2 eduwork-remote-relay
31
37
  ```
32
38
 
33
39
  The default listener is `127.0.0.1:8787`. `RELAY_URL` is the **external address users visit**, not the listening address. The proxy terminates TLS. Exiting the foreground command stops the service; see section 3 for persistent operation. Local-only debugging can use `http://localhost:8787/`; phones should use HTTPS with a valid certificate for Service Worker and cryptographic APIs.
@@ -84,7 +90,7 @@ Have a maintainer install the pinned package; run the service as an ordinary sys
84
90
  ```sh
85
91
  sudo useradd --system --no-create-home --shell /usr/sbin/nologin eduwork-remote
86
92
  sudo install -d /opt/eduwork-remote /etc/eduwork-remote
87
- sudo npm install --prefix /opt/eduwork-remote --omit=dev --ignore-scripts --save-exact @eduwork/dsh-remote-access@0.1.1
93
+ sudo npm install --prefix /opt/eduwork-remote --omit=dev --ignore-scripts --save-exact @eduwork/dsh-remote-access@0.1.2
88
94
  sudo install -m 600 /dev/null /etc/eduwork-remote/relay.env
89
95
  ```
90
96
 
@@ -131,7 +137,9 @@ curl -fsS https://example.edu/eduwork-remote/healthz
131
137
  curl -I https://example.edu/eduwork-remote/sw.js
132
138
  ```
133
139
 
134
- The first two return `ok`; the last returns 200 with a JavaScript content type. Health checks establish HTTP reachability only. Enter the same external URL and key under desktop Settings → Remote access, enable it, and check for “Connected”. Follow the [pairing steps](../README_EN.md#add-and-remove-devices) on another device, compare codes and approve on the computer. An access key admits a computer to the relay; it does not replace device pairing.
140
+ The first two return `ok`; the last returns 200 with a JavaScript content type. Health checks establish HTTP reachability only. With plugin `0.1.2`, choose your own relay under desktop Settings → Remote access, enter the same external URL and key, then use “Test connection” to check reachability and identity acceptance separately. Testing also works before remote access is enabled. Enable “Allow remote access” and check for “Connected”; use “Retry” after a connection failure.
141
+
142
+ Select “Add a device” and follow the [pairing steps](../README_EN.md#add-and-remove-devices) on another device, compare codes and approve on the computer. An access key admits a computer to the relay; it does not replace device pairing.
135
143
 
136
144
  ## 5. Organization sign-in and iframe (optional)
137
145
 
@@ -145,7 +153,7 @@ RELAY_FRAME_ANCESTORS=self https://portal.example.edu
145
153
 
146
154
  Omit `RELAY_ACCESS_KEYS` when using organization sign-in alone. The issuer must exactly match the token's `iss`. Client IDs identify desktop applications registered with the issuer; separate multiple IDs with commas. Discovery/JWKS supplies public keys. The relay currently accepts **RS256 ID Tokens** and checks signatures, issuer, audience/authorized party and validity. This is neither a model API key nor an access token used as an ID Token.
147
155
 
148
- The computer needs `@eduwork/dsh-oidc@0.3.1` or a later compatible version, and distribution configuration for `organization: { relay, oidcProfileId }`. Setting an issuer on the server does not configure desktop login. The relay verifies existing identity, stores no refresh token and does not sign users in; the computer's OIDC plugin handles renewal.
156
+ The computer needs `@eduwork/dsh-oidc@0.3.1` or a later compatible version, and distribution configuration for `organization: { relay, oidcProfileId }`. Setting an issuer on the server does not configure desktop login. Once configured, the `0.1.2` settings page supports organization sign-in and connection testing, and lets users switch to their own relay; the distribution selects the relay address for organization mode. The relay verifies existing identity, stores no refresh token and does not sign users in; the computer's OIDC plugin handles renewal.
149
157
 
150
158
  `RELAY_FRAME_ANCESTORS` defaults to `none`, blocking iframe embedding. Use `self` for same-origin parents, or complete origins (scheme, host and optional port, without paths). Quote multiple sources in shell commands: `RELAY_FRAME_ANCESTORS="self https://portal.example.edu"`. The parent's CSP must also permit the relay, and the proxy must not add a conflicting `X-Frame-Options: DENY` or `frame-ancestors 'none'` to this path.
151
159
 
@@ -0,0 +1,4 @@
1
+ # Allowlist the build inputs; never send relay.env or other local files.
2
+ *
3
+ !Dockerfile
4
+ !healthcheck.mjs
@@ -0,0 +1,17 @@
1
+ # syntax=docker/dockerfile:1
2
+ FROM node:24.22.1-alpine@sha256:6a1c190e17215d844926b0677f4bf87273ff7d5e54db06d3b5b5863ab0b09a3d
3
+
4
+ ARG REMOTE_ACCESS_VERSION=0.1.2
5
+ WORKDIR /opt/eduwork-remote
6
+ # Install the published relay at build time; startup never downloads packages.
7
+ RUN npm install --omit=dev --omit=optional --ignore-scripts --no-audit --no-fund \
8
+ --save-exact "@eduwork/dsh-remote-access@${REMOTE_ACCESS_VERSION}" \
9
+ && npm cache clean --force
10
+ COPY healthcheck.mjs ./healthcheck.mjs
11
+
12
+ ENV HOST=0.0.0.0 PORT=8787 NODE_ENV=production
13
+ USER node
14
+ EXPOSE 8787
15
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
16
+ CMD ["node", "/opt/eduwork-remote/healthcheck.mjs"]
17
+ CMD ["node", "/opt/eduwork-remote/node_modules/@eduwork/dsh-remote-access/lib/relay.js"]
@@ -0,0 +1,100 @@
1
+ # Docker 部署中继
2
+
3
+ [English](README_EN.md) · [完整部署指南](../DEPLOYMENT.md)
4
+
5
+ 使用 Docker Engine 和 Compose v2,从 npm 安装固定的 `@eduwork/dsh-remote-access@0.1.2` 并构建本地镜像。服务器不需要安装 Node.js,也不需要复制桌面端文件或插件源码。准备好域名和支持 WebSocket 的 HTTPS 反向代理,按下面步骤即可启动。
6
+
7
+ ## 1. 准备文件和配置
8
+
9
+ 从[仓库中的本目录](https://github.com/ECNU/EduWork/tree/main/packages/dsh-remote-access/docs/docker)取得部署文件,放在同一目录。可在新建的空目录中执行以下命令下载,无需克隆整个仓库(Linux shell):
10
+
11
+ ```sh
12
+ base=https://raw.githubusercontent.com/ECNU/EduWork/main/packages/dsh-remote-access/docs/docker
13
+ for file in Dockerfile compose.yaml healthcheck.mjs relay.env.example .dockerignore .gitignore; do
14
+ curl -fsSLo "$file" "$base/$file" || exit 1
15
+ done
16
+ ```
17
+
18
+ 已有源码的维护者直接进入 `packages/dsh-remote-access/docs/docker`。以下命令均在放置部署文件的目录执行:
19
+
20
+ ```sh
21
+ cp relay.env.example relay.env
22
+ chmod 600 relay.env
23
+ docker run --rm node:24.22.1-alpine node -e "console.log(require('node:crypto').randomBytes(32).toString('base64url'))"
24
+ ```
25
+
26
+ 编辑 `relay.env`,填写实际访问地址和刚生成的 Key:
27
+
28
+ ```dotenv
29
+ RELAY_URL=https://example.edu/eduwork-remote/
30
+ RELAY_ACCESS_KEYS=替换成刚生成的随机Key
31
+ ```
32
+
33
+ 独立域名根路径也可用,例如 `https://remote.example.edu/`。路径前缀直接写进 `RELAY_URL`,以 `/` 结尾;服务和健康检查都会沿用此前缀。Key 仅用来允许电脑接入中继,远控设备仍须在电脑上确认配对。
34
+
35
+ 实际 `relay.env` 不进入 Git 或镜像构建上下文,也不要作为附件公开。镜像构建时安装 npm 包,启动时只读取环境配置,无需再访问 npm。
36
+
37
+ ## 2. 一条命令启动
38
+
39
+ ```sh
40
+ docker compose up -d --build
41
+ docker compose ps
42
+ docker compose logs --tail=100 relay
43
+ ```
44
+
45
+ 容器以普通用户运行,文件系统只读。Compose 将端口绑定在**服务器本机的 `127.0.0.1:8787`**,交给同机反向代理;容器内部的 `HOST=0.0.0.0` 用于接收 Docker 端口转发,不能改成容器内部的 `127.0.0.1`。
46
+
47
+ 在现有 HTTPS 站点上采用[部署指南中的 Nginx 配置](../DEPLOYMENT.md#2-https-与路径前缀):转发到 `http://127.0.0.1:8787`,保留路径前缀和 WebSocket Upgrade。证书在代理处配置。这套 Compose 不会自动申请证书。
48
+
49
+ 如果反向代理也在 Docker 中,应将其接入中继所在的 Docker 网络,使用 `http://relay:8787` 作为上游;代理容器里的 `127.0.0.1` 不是宿主机。按自己的网络拓扑调整,不要直接套用宿主机地址。
50
+
51
+ ## 3. 验证并连接电脑
52
+
53
+ ```sh
54
+ docker compose exec -T relay node /opt/eduwork-remote/healthcheck.mjs
55
+ curl -fsS http://127.0.0.1:8787/eduwork-remote/healthz
56
+ curl -fsS https://example.edu/eduwork-remote/healthz
57
+ ```
58
+
59
+ 健康检查应成功,两个 HTTP 请求应返回 `ok`;根路径部署时去掉命令中的 `/eduwork-remote`。容器健康状态只检查内部 HTTP 服务,外部 HTTPS、WebSocket 和身份认证还需从客户端验证。
60
+
61
+ 电脑安装远控插件 `0.1.2` 后,在“设置 → 远程访问”选择自己的中继,填写同一外部 URL 和 Key,点“测试连接”。它分别检查服务可达性和身份是否通过,未开启远控时也能测试。通过后开启“允许远程访问”,点“添加设备”,扫码或打开链接,在电脑上核对配对码并允许。详见[设备配对](../../README.md#添加和移除设备)。
62
+
63
+ ## 4. 机构登录和网页嵌入
64
+
65
+ 机构可以在 `relay.env` 中改用 OIDC,或与 Key 同时启用:
66
+
67
+ ```dotenv
68
+ RELAY_ACCESS_KEYS=
69
+ RELAY_OIDC_ISSUER=https://sso.example.edu
70
+ RELAY_OIDC_CLIENT_IDS=desktop-client-id
71
+ RELAY_FRAME_ANCESTORS=self https://portal.example.edu
72
+ ```
73
+
74
+ 这些都是占位示例,须替换为自己的机构配置。中继校验 **RS256 ID Token**;不是模型 Key,也不是 access token。桌面还需要兼容的 `dsh-oidc` 和远控插件的 `organization: { relay, oidcProfileId }` 配置,才能在设置页使用机构账号。服务端配置不会自动创建客户端的机构配置。
75
+
76
+ `RELAY_FRAME_ANCESTORS` 只在需要 iframe 时设置;默认禁止嵌入。路径前缀和普通 iframe 不隔离同源权限,同域集成需要接受共同信任边界。完整的 OIDC、代理响应头与 iframe 说明见[部署指南](../DEPLOYMENT.md#5-机构登录与-iframe可选)。
77
+
78
+ ## 5. 修改配置、更新和停止
79
+
80
+ 修改 `relay.env` 后重新创建容器,让新配置生效:
81
+
82
+ ```sh
83
+ docker compose up -d --force-recreate
84
+ ```
85
+
86
+ 升级时把 `REMOTE_ACCESS_VERSION` 设为已经发布、准备采用的确切版本;下面以本版为例。后续在同一 shell 中运行 Compose 命令,或把该变量保存在本机 `.env`,使镜像标签和构建参数保持一致。
87
+
88
+ ```sh
89
+ export REMOTE_ACCESS_VERSION=0.1.2
90
+ docker compose up -d --build
91
+ docker compose exec -T relay node -p "require('@eduwork/dsh-remote-access/package.json').version"
92
+ ```
93
+
94
+ 镜像在本机构建,`docker compose pull` 不能代替重建。回退时指定先前版本,并恢复与之兼容的 `relay.env` 后重新构建。保留部署配置和之前版本号;日志中不要公开 Key 或 Token。
95
+
96
+ ```sh
97
+ docker compose down
98
+ ```
99
+
100
+ 停止或更新中继会断开现有连接,在线电脑和设备会尝试重连。配对信息保存在电脑和浏览器,中继无需挂载数据卷。日志自动轮转;停止中继不删除电脑上的会话或配对信息。
@@ -0,0 +1,100 @@
1
+ # Deploy the relay with Docker
2
+
3
+ [简体中文](README.md) · [Full deployment guide](../DEPLOYMENT_EN.md)
4
+
5
+ Use Docker Engine and Compose v2 to build a local image from the published `@eduwork/dsh-remote-access@0.1.2` npm package. The server needs neither a Node.js installation nor desktop files or plugin source. Prepare a domain and an HTTPS reverse proxy supporting WebSockets, then follow these steps.
6
+
7
+ ## 1. Prepare files and configuration
8
+
9
+ Copy the deployment files from [this directory in the repository](https://github.com/ECNU/EduWork/tree/main/packages/dsh-remote-access/docs/docker) into one directory. To download them without cloning the repository, run this in a new, empty directory using a Linux shell:
10
+
11
+ ```sh
12
+ base=https://raw.githubusercontent.com/ECNU/EduWork/main/packages/dsh-remote-access/docs/docker
13
+ for file in Dockerfile compose.yaml healthcheck.mjs relay.env.example .dockerignore .gitignore; do
14
+ curl -fsSLo "$file" "$base/$file" || exit 1
15
+ done
16
+ ```
17
+
18
+ With an existing checkout, enter `packages/dsh-remote-access/docs/docker`. Run the following commands from the directory containing the deployment files:
19
+
20
+ ```sh
21
+ cp relay.env.example relay.env
22
+ chmod 600 relay.env
23
+ docker run --rm node:24.22.1-alpine node -e "console.log(require('node:crypto').randomBytes(32).toString('base64url'))"
24
+ ```
25
+
26
+ Edit `relay.env`, entering your public URL and the generated key:
27
+
28
+ ```dotenv
29
+ RELAY_URL=https://example.edu/eduwork-remote/
30
+ RELAY_ACCESS_KEYS=replace-with-the-generated-random-key
31
+ ```
32
+
33
+ A dedicated domain root also works, such as `https://remote.example.edu/`. Include any path prefix directly in `RELAY_URL`, ending with `/`; both the service and health check use it. The key admits computers to the relay; remote devices still require pairing approval on the computer.
34
+
35
+ The real `relay.env` is excluded from Git and the image build context. Do not share it as an attachment. The image installs the npm package during its build; startup reads environment configuration without accessing npm.
36
+
37
+ ## 2. Start with one command
38
+
39
+ ```sh
40
+ docker compose up -d --build
41
+ docker compose ps
42
+ docker compose logs --tail=100 relay
43
+ ```
44
+
45
+ The container runs as a non-root user with a read-only filesystem. Compose publishes **`127.0.0.1:8787` on the server**, for a reverse proxy on the same machine. Inside the container, `HOST=0.0.0.0` accepts Docker's port forwarding; do not change it to the container's loopback address.
46
+
47
+ Use the [Nginx configuration in the deployment guide](../DEPLOYMENT_EN.md#2-https-and-a-path-prefix) in your HTTPS site: forward to `http://127.0.0.1:8787`, preserving the prefix and WebSocket Upgrade. Configure certificates at the proxy; this Compose setup does not obtain certificates automatically.
48
+
49
+ If the proxy also runs in Docker, connect it to the relay's Docker network and use `http://relay:8787` as the upstream. A proxy container's `127.0.0.1` does not refer to the host. Adapt the upstream to your network topology.
50
+
51
+ ## 3. Verify and connect a computer
52
+
53
+ ```sh
54
+ docker compose exec -T relay node /opt/eduwork-remote/healthcheck.mjs
55
+ curl -fsS http://127.0.0.1:8787/eduwork-remote/healthz
56
+ curl -fsS https://example.edu/eduwork-remote/healthz
57
+ ```
58
+
59
+ The health check should succeed and both HTTP requests should return `ok`; omit `/eduwork-remote` for root deployments. Container health checks only the internal HTTP service. Verify external HTTPS, WebSockets and authentication from the desktop client as well.
60
+
61
+ With remote access plugin `0.1.2` installed, open Settings → Remote access, select your own relay, enter the same external URL and key, and choose "Test connection". It checks reachability and identity acceptance separately, even before remote access is enabled. Enable "Allow remote access", select "Add a device", scan or open the link, then compare codes and approve on the computer. See [pairing](../../README_EN.md#add-and-remove-devices).
62
+
63
+ ## 4. Organization sign-in and embedding
64
+
65
+ Organizations can configure OIDC in `relay.env`, either alone or alongside keys:
66
+
67
+ ```dotenv
68
+ RELAY_ACCESS_KEYS=
69
+ RELAY_OIDC_ISSUER=https://sso.example.edu
70
+ RELAY_OIDC_CLIENT_IDS=desktop-client-id
71
+ RELAY_FRAME_ANCESTORS=self https://portal.example.edu
72
+ ```
73
+
74
+ Replace these placeholders with your organization's configuration. The relay checks **RS256 ID Tokens**, not model keys or access tokens. The desktop also needs a compatible `dsh-oidc` and remote plugin configuration `organization: { relay, oidcProfileId }` to offer organization sign-in. Server settings do not create the desktop's organization configuration.
75
+
76
+ Set `RELAY_FRAME_ANCESTORS` only when iframe embedding is needed; embedding is blocked by default. Prefixes and ordinary iframes do not isolate same-origin privileges, so sharing an origin requires accepting the shared trust boundary. See the [deployment guide](../DEPLOYMENT_EN.md#5-organization-sign-in-and-iframe-optional) for OIDC, proxy headers and iframe details.
77
+
78
+ ## 5. Configuration changes, upgrades and shutdown
79
+
80
+ After editing `relay.env`, recreate the container to apply the configuration:
81
+
82
+ ```sh
83
+ docker compose up -d --force-recreate
84
+ ```
85
+
86
+ For upgrades, set `REMOTE_ACCESS_VERSION` to the exact published version you intend to deploy; this example uses the current version. Run subsequent Compose commands in the same shell, or save the variable in a local `.env`, keeping the image tag and build argument consistent.
87
+
88
+ ```sh
89
+ export REMOTE_ACCESS_VERSION=0.1.2
90
+ docker compose up -d --build
91
+ docker compose exec -T relay node -p "require('@eduwork/dsh-remote-access/package.json').version"
92
+ ```
93
+
94
+ Images are built locally: `docker compose pull` does not replace rebuilding. To roll back, choose the previous version, restore compatible `relay.env` settings and rebuild. Retain your deployment configuration and previous version number. Do not share keys or tokens in logs.
95
+
96
+ ```sh
97
+ docker compose down
98
+ ```
99
+
100
+ Stopping or upgrading the relay disconnects current connections; online computers and devices attempt to reconnect. Pairing state lives on the computer and browser, so the relay needs no data volume. Logs rotate automatically; stopping the relay does not delete desktop conversations or pairings.
@@ -0,0 +1,26 @@
1
+ name: eduwork-remote
2
+ services:
3
+ relay:
4
+ # This image is built locally from the published npm package.
5
+ image: eduwork-remote-relay:${REMOTE_ACCESS_VERSION:-0.1.2}
6
+ build:
7
+ context: .
8
+ args:
9
+ REMOTE_ACCESS_VERSION: ${REMOTE_ACCESS_VERSION:-0.1.2}
10
+ restart: unless-stopped
11
+ init: true
12
+ env_file: relay.env
13
+ environment:
14
+ HOST: 0.0.0.0
15
+ PORT: "8787"
16
+ # A reverse proxy on this machine terminates HTTPS and forwards WebSockets.
17
+ ports:
18
+ - "127.0.0.1:8787:8787"
19
+ read_only: true
20
+ cap_drop: [ALL]
21
+ security_opt: ["no-new-privileges:true"]
22
+ logging:
23
+ driver: json-file
24
+ options:
25
+ max-size: "10m"
26
+ max-file: "3"
@@ -0,0 +1,15 @@
1
+ // Probe the container listener, keeping the public URL's path prefix.
2
+ // Do not probe the public domain: TLS and proxy checks are separate.
3
+ try {
4
+ const base = new URL(process.env.RELAY_URL);
5
+ const probe = new URL('http://127.0.0.1');
6
+ probe.port = process.env.PORT || '8787';
7
+ probe.pathname = `${base.pathname.replace(/\/?$/, '/')}healthz`;
8
+ const response = await fetch(probe, {
9
+ redirect: 'error',
10
+ signal: AbortSignal.timeout(4000),
11
+ });
12
+ process.exit(response.ok && (await response.text()) === 'ok' ? 0 : 1);
13
+ } catch {
14
+ process.exit(1);
15
+ }
@@ -0,0 +1,16 @@
1
+ # Public HTTPS URL, including any prefix. Use the same URL on the desktop.
2
+ RELAY_URL=https://remote.example.edu/eduwork-remote/
3
+
4
+ # Replace with a random key; multiple keys are comma-separated.
5
+ # For OIDC-only deployments, leave this empty and configure BOTH OIDC values.
6
+ RELAY_ACCESS_KEYS=
7
+
8
+ # Optional organization sign-in; use your issuer and desktop application's ID.
9
+ # RELAY_OIDC_ISSUER=https://sso.example.edu
10
+ # RELAY_OIDC_CLIENT_IDS=desktop-client-id
11
+
12
+ # Optional: the trusted reverse proxy must OVERWRITE this request header.
13
+ # RELAY_CLIENT_IP_HEADER=x-real-ip
14
+
15
+ # Optional iframe parents: self, or complete origins separated by spaces.
16
+ # RELAY_FRAME_ANCESTORS=self https://portal.example.edu
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@eduwork/dsh-remote-access",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "End-to-end encrypted remote access to a DSH host through a self-hosted relay",
5
5
  "type": "module",
6
- "license": "MIT",
6
+ "license": "MulanPSL-2.0 AND MIT",
7
7
  "main": "lib/index.js",
8
8
  "exports": {
9
9
  ".": "./lib/index.js",
@@ -22,7 +22,9 @@
22
22
  "README_EN.md",
23
23
  "LICENSE",
24
24
  "CHANGELOG.md",
25
- "THIRD_PARTY_NOTICES.md"
25
+ "THIRD_PARTY_NOTICES.md",
26
+ "LICENSE-MIT",
27
+ "LICENSING.md"
26
28
  ],
27
29
  "scripts": {
28
30
  "typecheck": "tsc -p tsconfig.json",
@@ -50,17 +52,17 @@
50
52
  },
51
53
  "peerDependencies": {
52
54
  "@deepseek-ai/cordis": "^4.0.5",
53
- "@deepseek-ai/schemastery": ">=3.18.5 <3.19.0",
54
- "@deepseek-ai/dsh-home-paths": ">=0.2.1-rc.2 <0.3.0-0",
55
- "@deepseek-ai/dsh-typert-protocol": ">=0.2.1-rc.2 <0.3.0-0",
56
- "@deepseek-ai/dsh-api-remotes": ">=0.2.1-rc.2 <0.3.0-0",
57
- "@deepseek-ai/dsh-client-locale": ">=0.2.1-rc.2 <0.3.0-0",
58
- "@deepseek-ai/dsh-client-ui-layout": ">=0.2.1-rc.2 <0.3.0-0",
59
- "@deepseek-ai/dsh-client-ui-primitives": ">=0.2.1-rc.2 <0.3.0-0",
60
- "@deepseek-ai/dsh-client-ui-renderer": ">=0.2.1-rc.2 <0.3.0-0",
61
- "@deepseek-ai/dsh-client-ui-session": ">=0.2.1-rc.2 <0.3.0-0",
62
- "@deepseek-ai/dsh-client-ui-settings": ">=0.2.1-rc.2 <0.3.0-0",
63
- "@deepseek-ai/dsh-client-ui-workspace": ">=0.2.1-rc.2 <0.3.0-0",
55
+ "@deepseek-ai/schemastery": ">=3.18.5 <3.19.0 || 3.19.0",
56
+ "@deepseek-ai/dsh-home-paths": ">=0.2.1-rc.2 <0.3.0-0 || 0.2.2-rc.1",
57
+ "@deepseek-ai/dsh-typert-protocol": ">=0.2.1-rc.2 <0.3.0-0 || 0.2.2-rc.1",
58
+ "@deepseek-ai/dsh-api-remotes": ">=0.2.1-rc.2 <0.3.0-0 || 0.2.2-rc.1",
59
+ "@deepseek-ai/dsh-client-locale": ">=0.2.1-rc.2 <0.3.0-0 || 0.2.2-rc.1",
60
+ "@deepseek-ai/dsh-client-ui-layout": ">=0.2.1-rc.2 <0.3.0-0 || 0.2.2-rc.1",
61
+ "@deepseek-ai/dsh-client-ui-primitives": ">=0.2.1-rc.2 <0.3.0-0 || 0.2.2-rc.1",
62
+ "@deepseek-ai/dsh-client-ui-renderer": ">=0.2.1-rc.2 <0.3.0-0 || 0.2.2-rc.1",
63
+ "@deepseek-ai/dsh-client-ui-session": ">=0.2.1-rc.2 <0.3.0-0 || 0.2.2-rc.1",
64
+ "@deepseek-ai/dsh-client-ui-settings": ">=0.2.1-rc.2 <0.3.0-0 || 0.2.2-rc.1",
65
+ "@deepseek-ai/dsh-client-ui-workspace": ">=0.2.1-rc.2 <0.3.0-0 || 0.2.2-rc.1",
64
66
  "react": "^18.2.0",
65
67
  "zod": "^4.4.3"
66
68
  },