|
|
@@ -1,82 +1,123 @@
|
|
|
1
|
+
|
|
|
2
|
+# 关于此分支
|
|
|
3
|
+
|
|
|
4
|
+
|
|
|
5
|
+
|
|
|
6
|
+[](https://github.com/lejianwen/rustdesk-server/actions/workflows/build.yaml)
|
|
|
7
|
+
|
|
|
8
|
+- 解决当客户端登录了`Api`账号时链接超时的问题
|
|
|
9
|
+- s6镜像添加了`Api`支持,`Api`开源地址 https://github.com/lejianwen/rustdesk-api
|
|
|
10
|
+
|
|
|
11
|
+## docker镜像地址
|
|
|
12
|
+
|
|
|
13
|
+- s6 镜像 [lejianwen/rustdesk-server-s6](https://hub.docker.com/r/lejianwen/rustdesk-server-s6)
|
|
|
14
|
+
|
|
|
15
|
+```yaml
|
|
|
16
|
+ networks:
|
|
|
17
|
+ rustdesk-net:
|
|
|
18
|
+ external: false
|
|
|
19
|
+ services:
|
|
|
20
|
+ rustdesk:
|
|
|
21
|
+ ports:
|
|
|
22
|
+ - 21114:21114
|
|
|
23
|
+ - 21115:21115
|
|
|
24
|
+ - 21116:21116
|
|
|
25
|
+ - 21116:21116/udp
|
|
|
26
|
+ - 21117:21117
|
|
|
27
|
+ - 21118:21118
|
|
|
28
|
+ - 21119:21119
|
|
|
29
|
+ image: lejianwen/rustdesk-server-s6:latest
|
|
|
30
|
+ environment:
|
|
|
31
|
+ - RELAY=<relay_server[:port]>
|
|
|
32
|
+ - ENCRYPTED_ONLY=1
|
|
|
33
|
+ - TZ=Asia/Shanghai
|
|
|
34
|
+ - RUSTDESK_API_RUSTDESK_ID_SERVER=<id_server[:21116]>
|
|
|
35
|
+ - RUSTDESK_API_RUSTDESK_RELAY_SERVER=<relay_server[:21117]>
|
|
|
36
|
+ - RUSTDESK_API_RUSTDESK_API_SERVER=http://<api_server[:21114]>
|
|
|
37
|
+ volumes:
|
|
|
38
|
+ - /data/rustdesk/server:/data
|
|
|
39
|
+ - /data/rustdesk/api:/app/data #将数据库挂载
|
|
|
40
|
+ - /data/rustdesk/server:/app/conf/data #挂载key文件到api容器,可以不用使用 RUSTDESK_API_RUSTDESK_KEY
|
|
|
41
|
+ networks:
|
|
|
42
|
+ - rustdesk-net
|
|
|
43
|
+ restart: unless-stopped
|
|
|
44
|
+
|
|
|
45
|
+```
|
|
|
46
|
+
|
|
|
47
|
+- 普通镜像 [lejianwen/rustdesk-server](https://hub.docker.com/r/lejianwen/rustdesk-server)
|
|
|
48
|
+
|
|
|
49
|
+
|
|
|
50
|
+
|
|
1
|
51
|
<p align="center">
|
|
2
|
|
- <a href="#how-to-build-manually">Manually</a> •
|
|
3
|
|
- <a href="#docker-images">Docker</a> •
|
|
4
|
|
- <a href="#s6-overlay-based-images">S6-overlay</a> •
|
|
5
|
|
- <a href="#how-to-create-a-keypair">Keypair</a> •
|
|
6
|
|
- <a href="#deb-packages">Debian</a> •
|
|
7
|
|
- <a href="#env-variables">Variables</a><br>
|
|
8
|
|
- [<a href="README-DE.md">Deutsch</a>] | [<a href="README-NL.md">Nederlands</a>] | [<a href="README-TW.md">繁體中文</a>] | [<a href="README-ZH.md">简体中文</a>]<br>
|
|
|
52
|
+ <a href="#如何自行构建">自行构建</a> •
|
|
|
53
|
+ <a href="#Docker-镜像">Docker</a> •
|
|
|
54
|
+ <a href="#基于-S6-overlay-的镜像">S6-overlay</a> •
|
|
|
55
|
+ <a href="#如何创建密钥">密钥</a> •
|
|
|
56
|
+ <a href="#deb-套件">Debian</a> •
|
|
|
57
|
+ <a href="#ENV-环境参数">环境参数</a><br>
|
|
|
58
|
+ [<a href="README-EN.md">English</a>] | [<a href="README-DE.md">Deutsch</a>] | [<a href="README-NL.md">Nederlands</a>] | [<a href="README-TW.md">繁体中文</a>]<br>
|
|
9
|
59
|
</p>
|
|
10
|
60
|
|
|
11
|
61
|
# RustDesk Server Program
|
|
12
|
62
|
|
|
13
|
|
-[](https://github.com/rustdesk/rustdesk-server/actions/workflows/build.yaml)
|
|
14
|
63
|
|
|
15
|
|
-[**Download**](https://github.com/rustdesk/rustdesk-server/releases)
|
|
16
|
64
|
|
|
17
|
|
-[**Manual**](https://rustdesk.com/docs/en/self-host/)
|
|
|
65
|
+[**下载**](https://github.com/lejianwen/rustdesk-server/releases)
|
|
18
|
66
|
|
|
19
|
|
-[**FAQ**](https://github.com/rustdesk/rustdesk/wiki/FAQ)
|
|
|
67
|
+[**说明文件**](https://rustdesk.com/docs/zh-cn/self-host/)
|
|
20
|
68
|
|
|
21
|
|
-Self-host your own RustDesk server, it is free and open source.
|
|
|
69
|
+自行搭建属于你的RustDesk服务器,所有的一切都是免费且开源的
|
|
22
|
70
|
|
|
23
|
|
-## How to build manually
|
|
|
71
|
+## 如何自行构建
|
|
24
|
72
|
|
|
25
|
73
|
```bash
|
|
26
|
74
|
cargo build --release
|
|
27
|
75
|
```
|
|
28
|
76
|
|
|
29
|
|
-Three executables will be generated in target/release.
|
|
30
|
|
-
|
|
31
|
|
-- hbbs - RustDesk ID/Rendezvous server
|
|
32
|
|
-- hbbr - RustDesk relay server
|
|
33
|
|
-- rustdesk-utils - RustDesk CLI utilities
|
|
|
77
|
+执行后会在target/release目录下生成三个对应平台的可执行程序
|
|
34
|
78
|
|
|
35
|
|
-You can find updated binaries on the [Releases](https://github.com/rustdesk/rustdesk-server/releases) page.
|
|
|
79
|
+- hbbs - RustDesk ID/会和服务器
|
|
|
80
|
+- hbbr - RustDesk 中继服务器
|
|
|
81
|
+- rustdesk-utils - RustDesk 命令行工具
|
|
36
|
82
|
|
|
37
|
|
-If you want extra features, [RustDesk Server Pro](https://rustdesk.com/pricing.html) might suit you better.
|
|
|
83
|
+您可以在 [releases](https://github.com/lejianwen/rustdesk-server/releases) 页面中找到最新的服务端软件。
|
|
38
|
84
|
|
|
39
|
|
-If you want to develop your own server, [rustdesk-server-demo](https://github.com/rustdesk/rustdesk-server-demo) might be a better and simpler start for you than this repo.
|
|
|
85
|
+如果您需要额外的功能支持,[RustDesk 专业版服务器](https://rustdesk.com/pricing.html) 获取更适合您。
|
|
40
|
86
|
|
|
41
|
|
-## Docker images
|
|
|
87
|
+如果您想开发自己的服务器,[rustdesk-server-demo](https://github.com/rustdesk/rustdesk-server-demo) 应该会比直接使用这个仓库更简单快捷。
|
|
42
|
88
|
|
|
43
|
|
-Docker images are automatically generated and published to [Docker Hub](https://hub.docker.com/r/rustdesk) and [GitHub Container Registry](https://github.com/rustdesk?tab=packages&repo_name=rustdesk-server) on every GitHub release. We have 2 kind of images.
|
|
|
89
|
+## Docker 镜像
|
|
44
|
90
|
|
|
45
|
|
-### Classic image
|
|
|
91
|
+Docker镜像会在每次 GitHub 发布新的release版本时自动构建。我们提供两种类型的镜像。
|
|
46
|
92
|
|
|
47
|
|
-These images are built from scratch with two main binaries (`hbbs` and `hbbr`). They're available on [Docker Hub](https://hub.docker.com/r/rustdesk/rustdesk-server/) and [GitHub Container Registry](https://github.com/rustdesk/rustdesk-server/pkgs/container/rustdesk-server) with these architectures:
|
|
|
93
|
+### Classic 传统镜像
|
|
48
|
94
|
|
|
49
|
|
-* amd64
|
|
50
|
|
-* arm64v8
|
|
51
|
|
-* armv7
|
|
|
95
|
+这个类型的镜像是基于 `ubuntu-20.04` 进行构建,镜像仅包含两个主要的可执行程序(`hbbr` 和 `hbbs`)。它们可以通过以下tag在 [Docker Hub](https://hub.docker.com/r/lejianwen/rustdesk-server/) 上获得:
|
|
52
|
96
|
|
|
53
|
|
-You could use `latest` tag or major version tag `1` with supported architectures:
|
|
|
97
|
+| 架构 | image:tag |
|
|
|
98
|
+|---------| ----------------------------------------- |
|
|
|
99
|
+| amd64 | `lejianwen/rustdesk-server:latest` |
|
|
|
100
|
+| arm64v8 | `lejianwen/rustdesk-server:latest-arm64v8` |
|
|
54
|
101
|
|
|
55
|
|
-| Version | image:tag |
|
|
56
|
|
-| ------------- | --------------------------------- |
|
|
57
|
|
-| latest | `rustdesk/rustdesk-server:latest` |
|
|
58
|
|
-| Major version | `rustdesk/rustdesk-server:1` |
|
|
59
|
|
-
|
|
60
|
|
-
|
|
61
|
|
-You can start these images directly with `docker run` with these commands:
|
|
|
102
|
+您可以使用以下命令,直接通过 ``docker run`` 來启动这些镜像:
|
|
62
|
103
|
|
|
63
|
104
|
```bash
|
|
64
|
|
-docker run --name hbbs --net=host -v "$PWD/data:/root" -d rustdesk/rustdesk-server:latest hbbs -r <relay-server-ip[:port]>
|
|
65
|
|
-docker run --name hbbr --net=host -v "$PWD/data:/root" -d rustdesk/rustdesk-server:latest hbbr
|
|
|
105
|
+docker run --name hbbs --net=host -v "$PWD/data:/root" -d lejianwen/rustdesk-server:latest hbbs -r <relay-server-ip[:port]>
|
|
|
106
|
+docker run --name hbbr --net=host -v "$PWD/data:/root" -d lejianwen/rustdesk-server:latest hbbr
|
|
66
|
107
|
```
|
|
67
|
108
|
|
|
68
|
|
-or without `--net=host`, but P2P direct connection can not work.
|
|
|
109
|
+或不使用 `--net=host` 参数启动, 但这样 P2P 直连功能将无法工作。
|
|
69
|
110
|
|
|
70
|
|
-For systems using SELinux, replacing `/root` by `/root:z` is required for the containers to run correctly. Alternatively, SELinux container separation can be disabled completely adding the option `--security-opt label=disable`.
|
|
|
111
|
+对于使用了 SELinux 的系统,您需要将 ``/root`` 替换为 ``/root:z``,以保证容器的正常运行。或者,也可以通过添加参数 ``--security-opt label=disable`` 来完全禁用 SELinux 容器隔离。
|
|
71
|
112
|
|
|
72
|
113
|
```bash
|
|
73
|
|
-docker run --name hbbs -p 21115:21115 -p 21116:21116 -p 21116:21116/udp -p 21118:21118 -v "$PWD/data:/root" -d rustdesk/rustdesk-server:latest hbbs -r <relay-server-ip[:port]>
|
|
74
|
|
-docker run --name hbbr -p 21117:21117 -p 21119:21119 -v "$PWD/data:/root" -d rustdesk/rustdesk-server:latest hbbr
|
|
|
114
|
+docker run --name hbbs -p 21115:21115 -p 21116:21116 -p 21116:21116/udp -p 21118:21118 -v "$PWD/data:/root" -d lejianwen/rustdesk-server:latest hbbs -r <relay-server-ip[:port]>
|
|
|
115
|
+docker run --name hbbr -p 21117:21117 -p 21119:21119 -v "$PWD/data:/root" -d lejianwen/rustdesk-server:latest hbbr
|
|
75
|
116
|
```
|
|
76
|
117
|
|
|
77
|
|
-The `relay-server-ip` parameter is the IP address (or dns name) of the server running these containers. The **optional** `port` parameter has to be used if you use a port different than **21117** for `hbbr`.
|
|
|
118
|
+`relay-server-ip` 参数是运行这些容器的服务器的 IP 地址(或 DNS 名称)。如果你不想使用 **21117** 作为 `hbbr` 的服务端口,可使用可选参数 `port` 进行指定。
|
|
78
|
119
|
|
|
79
|
|
-You can also use docker-compose, using this configuration as a template:
|
|
|
120
|
+您也可以使用 docker-compose 进行构建,以下为配置示例:
|
|
80
|
121
|
|
|
81
|
122
|
```yaml
|
|
82
|
123
|
version: '3'
|
|
|
@@ -93,7 +134,7 @@ services:
|
|
93
|
134
|
- 21116:21116
|
|
94
|
135
|
- 21116:21116/udp
|
|
95
|
136
|
- 21118:21118
|
|
96
|
|
- image: rustdesk/rustdesk-server:latest
|
|
|
137
|
+ image: lejianwen/rustdesk-server:latest
|
|
97
|
138
|
command: hbbs -r rustdesk.example.com:21117
|
|
98
|
139
|
volumes:
|
|
99
|
140
|
- ./data:/root
|
|
|
@@ -108,7 +149,7 @@ services:
|
|
108
|
149
|
ports:
|
|
109
|
150
|
- 21117:21117
|
|
110
|
151
|
- 21119:21119
|
|
111
|
|
- image: rustdesk/rustdesk-server:latest
|
|
|
152
|
+ image: lejianwen/rustdesk-server:latest
|
|
112
|
153
|
command: hbbr
|
|
113
|
154
|
volumes:
|
|
114
|
155
|
- ./data:/root
|
|
|
@@ -117,45 +158,48 @@ services:
|
|
117
|
158
|
restart: unless-stopped
|
|
118
|
159
|
```
|
|
119
|
160
|
|
|
120
|
|
-Edit line 16 to point to your relay server (the one listening on port 21117). You can also edit the volume lines (line 18 and line 33) if you need.
|
|
121
|
|
-
|
|
122
|
|
-(docker-compose credit goes to @lukebarone and @QuiGonLeong)
|
|
123
|
|
-
|
|
124
|
|
-> [!NOTE]
|
|
125
|
|
-> The rustdesk/rustdesk-server:latest in China may be replaced with the latest version number on Docker Hub, such as `rustdesk-server:1.1.10-3`. Otherwise, the old version may be pulled due to image acceleration.
|
|
|
161
|
+编辑第16行来指定你的中继服务器 (默认端口监听在 21117 的那一个)。 如果需要的话,您也可以编辑 volume 信息 (第 18 和 33 行)。
|
|
126
|
162
|
|
|
127
|
|
-> [!NOTE]
|
|
128
|
|
-> If you are experiencing issues pulling from Docker Hub, try pulling from the [GitHub Container Registry](https://github.com/rustdesk/rustdesk-server/pkgs/container/rustdesk-server) instead.
|
|
|
163
|
+(感谢 @lukebarone 和 @QuiGonLeong 协助提供的 docker-compose 配置示例)
|
|
129
|
164
|
|
|
130
|
|
-## S6-overlay based images
|
|
|
165
|
+## 基于 S6-overlay 的镜像
|
|
131
|
166
|
|
|
132
|
|
-These images are build against `busybox:stable` with the addition of the binaries (both `hbbs` and `hbbr`) and [S6-overlay](https://github.com/just-containers/s6-overlay). They're available on [Docker hub](https://hub.docker.com/r/rustdesk/rustdesk-server-s6/) and [GitHub Container Registry](https://github.com/rustdesk/rustdesk-server/pkgs/container/rustdesk-server) with these architectures:
|
|
|
167
|
+> 这些镜像是针对 `busybox:stable` 构建的,并添加了可执行程序(hbbr 和 hbbs)以及 [S6-overlay](https://github.com/just-containers/s6-overlay)。 它们可以使用以下tag在 [Docker hub](https://hub.docker.com/r/lejianwen/rustdesk-server-s6/) 上获取:
|
|
133
|
168
|
|
|
134
|
|
-* amd64
|
|
135
|
|
-* i386
|
|
136
|
|
-* arm64v8
|
|
137
|
|
-* armv7
|
|
138
|
169
|
|
|
139
|
|
-You could use `latest` tag or major version tag `1` with supported architectures:
|
|
|
170
|
+| 架構 | version | image:tag |
|
|
|
171
|
+| --------- | ------- | -------------------------------------------- |
|
|
|
172
|
+| multiarch | latest | `lejianwen/rustdesk-server-s6:latest` |
|
|
|
173
|
+| amd64 | latest | `lejianwen/rustdesk-server-s6:latest-amd64` |
|
|
|
174
|
+| i386 | latest | `lejianwen/rustdesk-server-s6:latest-i386` |
|
|
|
175
|
+| arm64v8 | latest | `lejianwen/rustdesk-server-s6:latest-arm64v8` |
|
|
|
176
|
+| armv7 | latest | `lejianwen/rustdesk-server-s6:latest-armv7` |
|
|
|
177
|
+| multiarch | 2 | `lejianwen/rustdesk-server-s6:2` |
|
|
|
178
|
+| amd64 | 2 | `lejianwen/rustdesk-server-s6:2-amd64` |
|
|
|
179
|
+| i386 | 2 | `lejianwen/rustdesk-server-s6:2-i386` |
|
|
|
180
|
+| arm64v8 | 2 | `lejianwen/rustdesk-server-s6:2-arm64v8` |
|
|
|
181
|
+| armv7 | 2 | `lejianwen/rustdesk-server-s6:2-armv7` |
|
|
|
182
|
+| multiarch | 2.0.0 | `lejianwen/rustdesk-server-s6:2.0.0` |
|
|
|
183
|
+| amd64 | 2.0.0 | `lejianwen/rustdesk-server-s6:2.0.0-amd64` |
|
|
|
184
|
+| i386 | 2.0.0 | `lejianwen/rustdesk-server-s6:2.0.0-i386` |
|
|
|
185
|
+| arm64v8 | 2.0.0 | `lejianwen/rustdesk-server-s6:2.0.0-arm64v8` |
|
|
|
186
|
+| armv7 | 2.0.0 | `lejianwen/rustdesk-server-s6:2.0.0-armv7` |
|
|
140
|
187
|
|
|
141
|
|
-| Version | image:tag |
|
|
142
|
|
-| ------------- | ------------------------------------ |
|
|
143
|
|
-| latest | `rustdesk/rustdesk-server-s6:latest` |
|
|
144
|
|
-| Major version | `rustdesk/rustdesk-server-s6:1` |
|
|
|
188
|
+强烈建议您使用`major version` 或 `latest` tag 的 `multiarch` 架构的镜像。
|
|
145
|
189
|
|
|
146
|
|
-The S6-overlay acts as a supervisor and keeps both process running, so with this image, there's no need to have two separate running containers.
|
|
|
190
|
+S6-overlay 在此处作为监控程序,用以保证两个进程的运行,因此使用此镜像,您无需运行两个容器。
|
|
147
|
191
|
|
|
148
|
|
-You can start these images directly with `docker run` with this command:
|
|
|
192
|
+您可以使用 `docker run` 命令直接启动镜像,如下:
|
|
149
|
193
|
|
|
150
|
194
|
```bash
|
|
151
|
195
|
docker run --name rustdesk-server \
|
|
152
|
196
|
--net=host \
|
|
153
|
197
|
-e "RELAY=rustdeskrelay.example.com" \
|
|
154
|
198
|
-e "ENCRYPTED_ONLY=1" \
|
|
155
|
|
- -v "$PWD/data:/data" -d rustdesk/rustdesk-server-s6:latest
|
|
|
199
|
+ -v "$PWD/data:/data" -d lejianwen/rustdesk-server-s6:latest
|
|
156
|
200
|
```
|
|
157
|
201
|
|
|
158
|
|
-or without `--net=host`, but P2P direct connection cannot work.
|
|
|
202
|
+或刪去 `--net=host` 参数, 但 P2P 直连功能将无法工作。
|
|
159
|
203
|
|
|
160
|
204
|
```bash
|
|
161
|
205
|
docker run --name rustdesk-server \
|
|
|
@@ -163,10 +207,10 @@ docker run --name rustdesk-server \
|
|
163
|
207
|
-p 21117:21117 -p 21118:21118 -p 21119:21119 \
|
|
164
|
208
|
-e "RELAY=rustdeskrelay.example.com" \
|
|
165
|
209
|
-e "ENCRYPTED_ONLY=1" \
|
|
166
|
|
- -v "$PWD/data:/data" -d rustdesk/rustdesk-server-s6:latest
|
|
|
210
|
+ -v "$PWD/data:/data" -d lejianwen/rustdesk-server-s6:latest
|
|
167
|
211
|
```
|
|
168
|
212
|
|
|
169
|
|
-Or you can use a docker-compose file:
|
|
|
213
|
+或着您也可以使用 docker-compose 文件:
|
|
170
|
214
|
|
|
171
|
215
|
```yaml
|
|
172
|
216
|
version: '3'
|
|
|
@@ -175,13 +219,14 @@ services:
|
|
175
|
219
|
rustdesk-server:
|
|
176
|
220
|
container_name: rustdesk-server
|
|
177
|
221
|
ports:
|
|
|
222
|
+ - 21114:21114
|
|
178
|
223
|
- 21115:21115
|
|
179
|
224
|
- 21116:21116
|
|
180
|
225
|
- 21116:21116/udp
|
|
181
|
226
|
- 21117:21117
|
|
182
|
227
|
- 21118:21118
|
|
183
|
228
|
- 21119:21119
|
|
184
|
|
- image: rustdesk/rustdesk-server-s6:latest
|
|
|
229
|
+ image: lejianwen/rustdesk-server-s6:latest
|
|
185
|
230
|
environment:
|
|
186
|
231
|
- "RELAY=rustdesk.example.com:21117"
|
|
187
|
232
|
- "ENCRYPTED_ONLY=1"
|
|
|
@@ -190,26 +235,26 @@ services:
|
|
190
|
235
|
restart: unless-stopped
|
|
191
|
236
|
```
|
|
192
|
237
|
|
|
193
|
|
-For this container image, you can use these environment variables, **in addition** to the ones specified in the following **ENV variables** section:
|
|
|
238
|
+对于此容器镜像,除了在下面的环境变量部分指定的变量之外,您还可以使用以下`环境变量`
|
|
194
|
239
|
|
|
195
|
|
-| variable | optional | description |
|
|
196
|
|
-| --- | --- | --- |
|
|
197
|
|
-| RELAY | no | the IP address/DNS name of the machine running this container |
|
|
198
|
|
-| ENCRYPTED_ONLY | yes | if set to **"1"** unencrypted connection will not be accepted |
|
|
199
|
|
-| KEY_PUB | yes | public part of the key pair |
|
|
200
|
|
-| KEY_PRIV | yes | private part of the key pair |
|
|
|
240
|
+| 环境变量 | 是否可选 | 描述 |
|
|
|
241
|
+|----------------|------|--------------------------|
|
|
|
242
|
+| RELAY | 否 | 运行此容器的宿主机的 IP 地址/ DNS 名称 |
|
|
|
243
|
+| ENCRYPTED_ONLY | 是 | 如果设置为 **"1"**,将不接受未加密的连接。 |
|
|
|
244
|
+| KEY_PUB | 是 | 密钥对中的公钥(Public Key) |
|
|
|
245
|
+| KEY_PRIV | 是 | 密钥对中的私钥(Private Key) |
|
|
201
|
246
|
|
|
202
|
|
-### Secret management in S6-overlay based images
|
|
|
247
|
+### 基于 S6-overlay 镜像的密钥管理
|
|
203
|
248
|
|
|
204
|
|
-You can obviously keep the key pair in a docker volume, but the best practices tells you to not write the keys on the filesystem; so we provide a couple of options.
|
|
|
249
|
+您可以将密钥对保存在 Docker volume 中,但我们建议不要将密钥写入文件系統中;因此,我们提供了一些方案。
|
|
205
|
250
|
|
|
206
|
|
-On container startup, the presence of the keypair is checked (`/data/id_ed25519.pub` and `/data/id_ed25519`) and if one of these keys doesn't exist, it's recreated from ENV variables or docker secrets.
|
|
207
|
|
-Then the validity of the keypair is checked: if public and private keys doesn't match, the container will stop.
|
|
208
|
|
-If you provide no keys, `hbbs` will generate one for you, and it'll place it in the default location.
|
|
|
251
|
+在容器启动时,会检查密钥对是否存在(`/data/id_ed25519.pub` 和 `/data/id_ed25519`),如果其中一個密钥不存在,则会从环境变量或 Docker Secret 中重新生成它。
|
|
|
252
|
+然后检查密钥对的可用性:如果公钥和私钥不匹配,容器将停止运行。
|
|
|
253
|
+如果您未提供密钥,`hbbs` 将会在默认位置生成一个。
|
|
209
|
254
|
|
|
210
|
|
-#### Use ENV to store the key pair
|
|
|
255
|
+#### 使用 ENV 存储密钥对
|
|
211
|
256
|
|
|
212
|
|
-You can use docker environment variables to store the keys. Just follow this examples:
|
|
|
257
|
+您可以使用 Docker 环境变量來存储密钥。如下:
|
|
213
|
258
|
|
|
214
|
259
|
```bash
|
|
215
|
260
|
docker run --name rustdesk-server \
|
|
|
@@ -219,7 +264,7 @@ docker run --name rustdesk-server \
|
|
219
|
264
|
-e "DB_URL=/db/db_v2.sqlite3" \
|
|
220
|
265
|
-e "KEY_PRIV=FR2j78IxfwJNR+HjLluQ2Nh7eEryEeIZCwiQDPVe+PaITKyShphHAsPLn7So0OqRs92nGvSRdFJnE2MSyrKTIQ==" \
|
|
221
|
266
|
-e "KEY_PUB=iEyskoaYRwLDy5+0qNDqkbPdpxr0kXRSZxNjEsqykyE=" \
|
|
222
|
|
- -v "$PWD/db:/db" -d rustdesk/rustdesk-server-s6:latest
|
|
|
267
|
+ -v "$PWD/db:/db" -d lejianwen/rustdesk-server-s6:latest
|
|
223
|
268
|
```
|
|
224
|
269
|
|
|
225
|
270
|
```yaml
|
|
|
@@ -229,13 +274,14 @@ services:
|
|
229
|
274
|
rustdesk-server:
|
|
230
|
275
|
container_name: rustdesk-server
|
|
231
|
276
|
ports:
|
|
|
277
|
+ - 21114:21114
|
|
232
|
278
|
- 21115:21115
|
|
233
|
279
|
- 21116:21116
|
|
234
|
280
|
- 21116:21116/udp
|
|
235
|
281
|
- 21117:21117
|
|
236
|
282
|
- 21118:21118
|
|
237
|
283
|
- 21119:21119
|
|
238
|
|
- image: rustdesk/rustdesk-server-s6:latest
|
|
|
284
|
+ image: lejianwen/rustdesk-server-s6:latest
|
|
239
|
285
|
environment:
|
|
240
|
286
|
- "RELAY=rustdesk.example.com:21117"
|
|
241
|
287
|
- "ENCRYPTED_ONLY=1"
|
|
|
@@ -247,11 +293,11 @@ services:
|
|
247
|
293
|
restart: unless-stopped
|
|
248
|
294
|
```
|
|
249
|
295
|
|
|
250
|
|
-#### Use Docker secrets to store the key pair
|
|
|
296
|
+#### 使用 Docker Secret 來保存密钥对
|
|
251
|
297
|
|
|
252
|
|
-You can alternatively use docker secrets to store the keys.
|
|
253
|
|
-This is useful if you're using **docker-compose** or **Docker Swarm**.
|
|
254
|
|
-Just follow this examples:
|
|
|
298
|
+您还可以使用 Docker Secret 來保存密钥。
|
|
|
299
|
+如果您使用 **docker-compose** 或 **docker swarm**,推荐您使用。
|
|
|
300
|
+只需按照以下示例操作:
|
|
255
|
301
|
|
|
256
|
302
|
```bash
|
|
257
|
303
|
cat secrets/id_ed25519.pub | docker secret create key_pub -
|
|
|
@@ -263,7 +309,7 @@ docker service create --name rustdesk-server \
|
|
263
|
309
|
-e "ENCRYPTED_ONLY=1" \
|
|
264
|
310
|
-e "DB_URL=/db/db_v2.sqlite3" \
|
|
265
|
311
|
--mount "type=bind,source=$PWD/db,destination=/db" \
|
|
266
|
|
- rustdesk/rustdesk-server-s6:latest
|
|
|
312
|
+ lejianwen/rustdesk-server-s6:latest
|
|
267
|
313
|
```
|
|
268
|
314
|
|
|
269
|
315
|
```yaml
|
|
|
@@ -273,13 +319,14 @@ services:
|
|
273
|
319
|
rustdesk-server:
|
|
274
|
320
|
container_name: rustdesk-server
|
|
275
|
321
|
ports:
|
|
|
322
|
+ - 21114:21114
|
|
276
|
323
|
- 21115:21115
|
|
277
|
324
|
- 21116:21116
|
|
278
|
325
|
- 21116:21116/udp
|
|
279
|
326
|
- 21117:21117
|
|
280
|
327
|
- 21118:21118
|
|
281
|
328
|
- 21119:21119
|
|
282
|
|
- image: rustdesk/rustdesk-server-s6:latest
|
|
|
329
|
+ image: lejianwen/rustdesk-server-s6:latest
|
|
283
|
330
|
environment:
|
|
284
|
331
|
- "RELAY=rustdesk.example.com:21117"
|
|
285
|
332
|
- "ENCRYPTED_ONLY=1"
|
|
|
@@ -298,57 +345,55 @@ secrets:
|
|
298
|
345
|
file: secrets/id_ed25519
|
|
299
|
346
|
```
|
|
300
|
347
|
|
|
301
|
|
-## How to create a keypair
|
|
|
348
|
+## 如何生成密钥对
|
|
302
|
349
|
|
|
303
|
|
-A keypair is needed for encryption; you can provide it, as explained before, but you need a way to create one.
|
|
|
350
|
+加密需要一对密钥;您可以按照前面所述提供它,但需要一个工具去生成密钥对。
|
|
304
|
351
|
|
|
305
|
|
-You can use this command to generate a keypair:
|
|
|
352
|
+您可以使用以下命令生成一对密钥:
|
|
306
|
353
|
|
|
307
|
354
|
```bash
|
|
308
|
355
|
/usr/bin/rustdesk-utils genkeypair
|
|
309
|
356
|
```
|
|
310
|
357
|
|
|
311
|
|
-If you don't have (or don't want) the `rustdesk-utils` package installed on your system, you can invoke the same command with docker:
|
|
|
358
|
+如果您沒有(或不想)在系统上安装 `rustdesk-utils` 套件,您可以使用 Docker 执行相同的命令:
|
|
312
|
359
|
|
|
313
|
360
|
```bash
|
|
314
|
|
-docker run --rm --entrypoint /usr/bin/rustdesk-utils rustdesk/rustdesk-server-s6:latest genkeypair
|
|
|
361
|
+docker run --rm --entrypoint /usr/bin/rustdesk-utils lejianwen/rustdesk-server-s6:latest genkeypair
|
|
315
|
362
|
```
|
|
316
|
363
|
|
|
317
|
|
-The output will be something like this:
|
|
|
364
|
+运行后的输出内容如下:
|
|
318
|
365
|
|
|
319
|
366
|
```text
|
|
320
|
367
|
Public Key: 8BLLhtzUBU/XKAH4mep3p+IX4DSApe7qbAwNH9nv4yA=
|
|
321
|
368
|
Secret Key: egAVd44u33ZEUIDTtksGcHeVeAwywarEdHmf99KM5ajwEsuG3NQFT9coAfiZ6nen4hfgNICl7upsDA0f2e/jIA==
|
|
322
|
369
|
```
|
|
323
|
370
|
|
|
324
|
|
-## .deb packages
|
|
|
371
|
+## .deb 套件
|
|
325
|
372
|
|
|
326
|
|
-Separate .deb packages are available for each binary, you can find them in the [Releases](https://github.com/rustdesk/rustdesk-server/releases).
|
|
327
|
|
-These packages are meant for the following distributions:
|
|
|
373
|
+每个可执行文件都有单独的 .deb 套件可供使用,您可以在 [releases](https://github.com/lejianwen/rustdesk-server/releases) 页面中找到它們。
|
|
|
374
|
+這些套件适用于以下发行版:
|
|
328
|
375
|
|
|
329
|
|
-- Ubuntu 24.04 LTS
|
|
330
|
376
|
- Ubuntu 22.04 LTS
|
|
331
|
377
|
- Ubuntu 20.04 LTS
|
|
332
|
378
|
- Ubuntu 18.04 LTS
|
|
333
|
|
-- Debian 12 bookworm
|
|
334
|
379
|
- Debian 11 bullseye
|
|
335
|
380
|
- Debian 10 buster
|
|
336
|
381
|
|
|
337
|
|
-## ENV variables
|
|
338
|
|
-
|
|
339
|
|
-`hbbs` and `hbbr` can be configured using these ENV variables.
|
|
340
|
|
-You can specify the variables as usual or use an `.env` file.
|
|
341
|
|
-
|
|
342
|
|
-| variable | binary | description |
|
|
343
|
|
-| --- | --- | --- |
|
|
344
|
|
-| ALWAYS_USE_RELAY | hbbs | if set to **"Y"** disallows direct peer connection |
|
|
345
|
|
-| DB_URL | hbbs | path for database file |
|
|
346
|
|
-| DOWNGRADE_START_CHECK | hbbr | delay (in seconds) before downgrade check |
|
|
347
|
|
-| DOWNGRADE_THRESHOLD | hbbr | threshold of downgrade check (bit/ms) |
|
|
348
|
|
-| KEY | hbbs/hbbr | if set force the use of a specific key, if set to **"_"** force the use of any key |
|
|
349
|
|
-| LIMIT_SPEED | hbbr | speed limit (in Mb/s) |
|
|
350
|
|
-| PORT | hbbs/hbbr | listening port (21116 for hbbs - 21117 for hbbr) |
|
|
351
|
|
-| RELAY | hbbs | IP address/DNS name of the machines running hbbr (separated by comma) |
|
|
352
|
|
-| RUST_LOG | all | set debug level (error\|warn\|info\|debug\|trace) |
|
|
353
|
|
-| SINGLE_BANDWIDTH | hbbr | max bandwidth for a single connection (in Mb/s) |
|
|
354
|
|
-| TOTAL_BANDWIDTH | hbbr | max total bandwidth (in Mb/s) |
|
|
|
382
|
+## ENV 环境变量
|
|
|
383
|
+
|
|
|
384
|
+可以使用这些`环境变量`参数來配置 hbbs 和 hbbr。
|
|
|
385
|
+您可以像往常一样指定参数,或者使用 .env 文件。
|
|
|
386
|
+
|
|
|
387
|
+| 参数 | 可执行文件 | 描述 |
|
|
|
388
|
+|-----------------------|---------------|--------------------------------------------------|
|
|
|
389
|
+| ALWAYS_USE_RELAY | hbbs | 如果设定为 **"Y"**,将关闭直接点对点连接功能 |
|
|
|
390
|
+| DB_URL | hbbs | 数据库配置 |
|
|
|
391
|
+| DOWNGRADE_START_CHECK | hbbr | 降级检查之前的延迟是啊尽(以秒为单位) |
|
|
|
392
|
+| DOWNGRADE_THRESHOLD | hbbr | 降级检查的阈值(bit/ms) |
|
|
|
393
|
+| KEY | hbbs/hbbr | 如果设置了此参数,将强制使用指定密钥对,如果设为 **"_"**,则强制使用任意密钥 |
|
|
|
394
|
+| LIMIT_SPEED | hbbr | 速度限制(以Mb/s为单位) |
|
|
|
395
|
+| PORT | hbbs/hbbr | 监听端口(hbbs为21116,hbbr为21117) |
|
|
|
396
|
+| RELAY_SERVERS | hbbs | 运行hbbr的机器的IP地址/DNS名称(用逗号分隔) |
|
|
|
397
|
+| RUST_LOG | all | 设置 debug level (error\|warn\|info\|debug\|trace) |
|
|
|
398
|
+| SINGLE_BANDWIDTH | hbbr | 单个连接的最大带宽(以Mb/s为单位) |
|
|
|
399
|
+| TOTAL_BANDWIDTH | hbbr | 最大总带宽(以Mb/s为单位) |
|