Browse Source

docs: up readme

lejianwen 1 year ago
parent
commit
d793bcf569
5 changed files with 522 additions and 471 deletions
  1. 354 0
      README-EN.md
  2. 0 348
      README-ZH.md
  3. 168 123
      README.md
  4. BIN
      img.png
  5. BIN
      readme/api.png

+ 354 - 0
README-EN.md

@@ -0,0 +1,354 @@
1
+<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>
9
+</p>
10
+
11
+# RustDesk Server Program
12
+
13
+[![build](https://github.com/rustdesk/rustdesk-server/actions/workflows/build.yaml/badge.svg)](https://github.com/rustdesk/rustdesk-server/actions/workflows/build.yaml)
14
+
15
+[**Download**](https://github.com/rustdesk/rustdesk-server/releases)
16
+
17
+[**Manual**](https://rustdesk.com/docs/en/self-host/)
18
+
19
+[**FAQ**](https://github.com/rustdesk/rustdesk/wiki/FAQ)
20
+
21
+Self-host your own RustDesk server, it is free and open source.
22
+
23
+## How to build manually
24
+
25
+```bash
26
+cargo build --release
27
+```
28
+
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
34
+
35
+You can find updated binaries on the [Releases](https://github.com/rustdesk/rustdesk-server/releases) page.
36
+
37
+If you want extra features, [RustDesk Server Pro](https://rustdesk.com/pricing.html) might suit you better.
38
+
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.
40
+
41
+## Docker images
42
+
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.
44
+
45
+### Classic image
46
+
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:
48
+
49
+* amd64
50
+* arm64v8
51
+* armv7
52
+
53
+You could use `latest` tag or major version tag `1` with supported architectures:
54
+
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:
62
+
63
+```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 
66
+```
67
+
68
+or without `--net=host`, but P2P direct connection can not work.
69
+
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`.
71
+
72
+```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 
75
+```
76
+
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`.
78
+
79
+You can also use docker-compose, using this configuration as a template:
80
+
81
+```yaml
82
+version: '3'
83
+
84
+networks:
85
+  rustdesk-net:
86
+    external: false
87
+
88
+services:
89
+  hbbs:
90
+    container_name: hbbs
91
+    ports:
92
+      - 21115:21115
93
+      - 21116:21116
94
+      - 21116:21116/udp
95
+      - 21118:21118
96
+    image: rustdesk/rustdesk-server:latest
97
+    command: hbbs -r rustdesk.example.com:21117
98
+    volumes:
99
+      - ./data:/root
100
+    networks:
101
+      - rustdesk-net
102
+    depends_on:
103
+      - hbbr
104
+    restart: unless-stopped
105
+
106
+  hbbr:
107
+    container_name: hbbr
108
+    ports:
109
+      - 21117:21117
110
+      - 21119:21119
111
+    image: rustdesk/rustdesk-server:latest
112
+    command: hbbr
113
+    volumes:
114
+      - ./data:/root
115
+    networks:
116
+      - rustdesk-net
117
+    restart: unless-stopped
118
+```
119
+
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.
126
+
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.
129
+
130
+## S6-overlay based images
131
+
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:
133
+
134
+* amd64
135
+* i386
136
+* arm64v8
137
+* armv7
138
+
139
+You could use `latest` tag or major version tag `1` with supported architectures:
140
+
141
+| Version       | image:tag                            |
142
+| ------------- | ------------------------------------ |
143
+| latest        | `rustdesk/rustdesk-server-s6:latest` |
144
+| Major version | `rustdesk/rustdesk-server-s6:1`      |
145
+
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.
147
+
148
+You can start these images directly with `docker run` with this command:
149
+
150
+```bash
151
+docker run --name rustdesk-server \ 
152
+  --net=host \
153
+  -e "RELAY=rustdeskrelay.example.com" \
154
+  -e "ENCRYPTED_ONLY=1" \
155
+  -v "$PWD/data:/data" -d rustdesk/rustdesk-server-s6:latest
156
+```
157
+
158
+or without `--net=host`, but P2P direct connection cannot work.
159
+
160
+```bash
161
+docker run --name rustdesk-server \
162
+  -p 21115:21115 -p 21116:21116 -p 21116:21116/udp \
163
+  -p 21117:21117 -p 21118:21118 -p 21119:21119 \
164
+  -e "RELAY=rustdeskrelay.example.com" \
165
+  -e "ENCRYPTED_ONLY=1" \
166
+  -v "$PWD/data:/data" -d rustdesk/rustdesk-server-s6:latest
167
+```
168
+
169
+Or you can use a docker-compose file:
170
+
171
+```yaml
172
+version: '3'
173
+
174
+services:
175
+  rustdesk-server:
176
+    container_name: rustdesk-server
177
+    ports:
178
+      - 21115:21115
179
+      - 21116:21116
180
+      - 21116:21116/udp
181
+      - 21117:21117
182
+      - 21118:21118
183
+      - 21119:21119
184
+    image: rustdesk/rustdesk-server-s6:latest
185
+    environment:
186
+      - "RELAY=rustdesk.example.com:21117"
187
+      - "ENCRYPTED_ONLY=1"
188
+    volumes:
189
+      - ./data:/data
190
+    restart: unless-stopped
191
+```
192
+
193
+For this container image, you can use these environment variables, **in addition** to the ones specified in the following **ENV variables** section:
194
+
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 |
201
+
202
+### Secret management in S6-overlay based images
203
+
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.
205
+
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.
209
+
210
+#### Use ENV to store the key pair
211
+
212
+You can use docker environment variables to store the keys. Just follow this examples:
213
+
214
+```bash
215
+docker run --name rustdesk-server \ 
216
+  --net=host \
217
+  -e "RELAY=rustdeskrelay.example.com" \
218
+  -e "ENCRYPTED_ONLY=1" \
219
+  -e "DB_URL=/db/db_v2.sqlite3" \
220
+  -e "KEY_PRIV=FR2j78IxfwJNR+HjLluQ2Nh7eEryEeIZCwiQDPVe+PaITKyShphHAsPLn7So0OqRs92nGvSRdFJnE2MSyrKTIQ==" \
221
+  -e "KEY_PUB=iEyskoaYRwLDy5+0qNDqkbPdpxr0kXRSZxNjEsqykyE=" \
222
+  -v "$PWD/db:/db" -d rustdesk/rustdesk-server-s6:latest
223
+```
224
+
225
+```yaml
226
+version: '3'
227
+
228
+services:
229
+  rustdesk-server:
230
+    container_name: rustdesk-server
231
+    ports:
232
+      - 21115:21115
233
+      - 21116:21116
234
+      - 21116:21116/udp
235
+      - 21117:21117
236
+      - 21118:21118
237
+      - 21119:21119
238
+    image: rustdesk/rustdesk-server-s6:latest
239
+    environment:
240
+      - "RELAY=rustdesk.example.com:21117"
241
+      - "ENCRYPTED_ONLY=1"
242
+      - "DB_URL=/db/db_v2.sqlite3"
243
+      - "KEY_PRIV=FR2j78IxfwJNR+HjLluQ2Nh7eEryEeIZCwiQDPVe+PaITKyShphHAsPLn7So0OqRs92nGvSRdFJnE2MSyrKTIQ=="
244
+      - "KEY_PUB=iEyskoaYRwLDy5+0qNDqkbPdpxr0kXRSZxNjEsqykyE="
245
+    volumes:
246
+      - ./db:/db
247
+    restart: unless-stopped
248
+```
249
+
250
+#### Use Docker secrets to store the key pair
251
+
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:
255
+
256
+```bash
257
+cat secrets/id_ed25519.pub | docker secret create key_pub -
258
+cat secrets/id_ed25519 | docker secret create key_priv -
259
+docker service create --name rustdesk-server \
260
+  --secret key_priv --secret key_pub \
261
+  --net=host \
262
+  -e "RELAY=rustdeskrelay.example.com" \
263
+  -e "ENCRYPTED_ONLY=1" \
264
+  -e "DB_URL=/db/db_v2.sqlite3" \
265
+  --mount "type=bind,source=$PWD/db,destination=/db" \
266
+  rustdesk/rustdesk-server-s6:latest
267
+```
268
+
269
+```yaml
270
+version: '3'
271
+
272
+services:
273
+  rustdesk-server:
274
+    container_name: rustdesk-server
275
+    ports:
276
+      - 21115:21115
277
+      - 21116:21116
278
+      - 21116:21116/udp
279
+      - 21117:21117
280
+      - 21118:21118
281
+      - 21119:21119
282
+    image: rustdesk/rustdesk-server-s6:latest
283
+    environment:
284
+      - "RELAY=rustdesk.example.com:21117"
285
+      - "ENCRYPTED_ONLY=1"
286
+      - "DB_URL=/db/db_v2.sqlite3"
287
+    volumes:
288
+      - ./db:/db
289
+    restart: unless-stopped
290
+    secrets:
291
+      - key_pub
292
+      - key_priv
293
+
294
+secrets:
295
+  key_pub:
296
+    file: secrets/id_ed25519.pub
297
+  key_priv:
298
+    file: secrets/id_ed25519      
299
+```
300
+
301
+## How to create a keypair
302
+
303
+A keypair is needed for encryption; you can provide it, as explained before, but you need a way to create one.
304
+
305
+You can use this command to generate a keypair:
306
+
307
+```bash
308
+/usr/bin/rustdesk-utils genkeypair
309
+```
310
+
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:
312
+
313
+```bash
314
+docker run --rm --entrypoint /usr/bin/rustdesk-utils  rustdesk/rustdesk-server-s6:latest genkeypair
315
+```
316
+
317
+The output will be something like this:
318
+
319
+```text
320
+Public Key:  8BLLhtzUBU/XKAH4mep3p+IX4DSApe7qbAwNH9nv4yA=
321
+Secret Key:  egAVd44u33ZEUIDTtksGcHeVeAwywarEdHmf99KM5ajwEsuG3NQFT9coAfiZ6nen4hfgNICl7upsDA0f2e/jIA==
322
+```
323
+
324
+## .deb packages
325
+
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:
328
+
329
+- Ubuntu 24.04 LTS
330
+- Ubuntu 22.04 LTS
331
+- Ubuntu 20.04 LTS
332
+- Ubuntu 18.04 LTS
333
+- Debian 12 bookworm
334
+- Debian 11 bullseye
335
+- Debian 10 buster
336
+
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) |

+ 0 - 348
README-ZH.md

@@ -1,348 +0,0 @@
1
-<p align="center">
2
-  <a href="#如何自行构建">自行构建</a> •
3
-  <a href="#Docker-镜像">Docker</a> •
4
-  <a href="#基于-S6-overlay-的镜像">S6-overlay</a> •
5
-  <a href="#如何创建密钥">密钥</a> •
6
-  <a href="#deb-套件">Debian</a> •
7
-  <a href="#ENV-环境参数">环境参数</a><br>
8
-  [<a href="README.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
-</p>
10
-
11
-# RustDesk Server Program
12
-
13
-[![build](https://github.com/rustdesk/rustdesk-server/actions/workflows/build.yaml/badge.svg)](https://github.com/rustdesk/rustdesk-server/actions/workflows/build.yaml)
14
-
15
-[**下载**](https://github.com/rustdesk/rustdesk-server/releases)
16
-
17
-[**说明文件**](https://rustdesk.com/docs/zh-cn/self-host/)
18
-
19
-[**FAQ**](https://github.com/rustdesk/rustdesk/wiki/FAQ)
20
-
21
-自行搭建属于你的RustDesk服务器,所有的一切都是免费且开源的
22
-
23
-## 如何自行构建
24
-
25
-```bash
26
-cargo build --release
27
-```
28
-
29
-执行后会在target/release目录下生成三个对应平台的可执行程序
30
-
31
-- hbbs - RustDesk ID/会和服务器
32
-- hbbr - RustDesk 中继服务器
33
-- rustdesk-utils - RustDesk 命令行工具
34
-
35
-您可以在 [releases](https://github.com/rustdesk/rustdesk-server/releases) 页面中找到最新的服务端软件。
36
-
37
-如果您需要额外的功能支持,[RustDesk 专业版服务器](https://rustdesk.com/pricing.html) 获取更适合您。
38
-
39
-如果您想开发自己的服务器,[rustdesk-server-demo](https://github.com/rustdesk/rustdesk-server-demo) 应该会比直接使用这个仓库更简单快捷。
40
-
41
-## Docker 镜像
42
-
43
-Docker镜像会在每次 GitHub 发布新的release版本时自动构建。我们提供两种类型的镜像。
44
-
45
-### Classic 传统镜像
46
-
47
-这个类型的镜像是基于 `ubuntu-20.04` 进行构建,镜像仅包含两个主要的可执行程序(`hbbr` 和 `hbbs`)。它们可以通过以下tag在 [Docker Hub](https://hub.docker.com/r/rustdesk/rustdesk-server/) 上获得:
48
-
49
-| 架构      | image:tag                                 |
50
-|---------| ----------------------------------------- |
51
-| amd64   | `rustdesk/rustdesk-server:latest`         |
52
-| arm64v8 | `rustdesk/rustdesk-server:latest-arm64v8` |
53
-
54
-您可以使用以下命令,直接通过 ``docker run`` 來启动这些镜像:
55
-
56
-```bash
57
-docker run --name hbbs --net=host -v "$PWD/data:/root" -d rustdesk/rustdesk-server:latest hbbs -r <relay-server-ip[:port]> 
58
-docker run --name hbbr --net=host -v "$PWD/data:/root" -d rustdesk/rustdesk-server:latest hbbr 
59
-```
60
-
61
-或不使用 `--net=host` 参数启动, 但这样 P2P 直连功能将无法工作。
62
-
63
-对于使用了 SELinux 的系统,您需要将 ``/root`` 替换为 ``/root:z``,以保证容器的正常运行。或者,也可以通过添加参数 ``--security-opt label=disable`` 来完全禁用 SELinux 容器隔离。
64
-
65
-```bash
66
-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]> 
67
-docker run --name hbbr -p 21117:21117 -p 21119:21119 -v "$PWD/data:/root" -d rustdesk/rustdesk-server:latest hbbr 
68
-```
69
-
70
-`relay-server-ip` 参数是运行这些容器的服务器的 IP 地址(或 DNS 名称)。如果你不想使用 **21117** 作为 `hbbr` 的服务端口,可使用可选参数 `port` 进行指定。
71
-
72
-您也可以使用 docker-compose 进行构建,以下为配置示例:
73
-
74
-```yaml
75
-version: '3'
76
-
77
-networks:
78
-  rustdesk-net:
79
-    external: false
80
-
81
-services:
82
-  hbbs:
83
-    container_name: hbbs
84
-    ports:
85
-      - 21115:21115
86
-      - 21116:21116
87
-      - 21116:21116/udp
88
-      - 21118:21118
89
-    image: rustdesk/rustdesk-server:latest
90
-    command: hbbs -r rustdesk.example.com:21117
91
-    volumes:
92
-      - ./data:/root
93
-    networks:
94
-      - rustdesk-net
95
-    depends_on:
96
-      - hbbr
97
-    restart: unless-stopped
98
-
99
-  hbbr:
100
-    container_name: hbbr
101
-    ports:
102
-      - 21117:21117
103
-      - 21119:21119
104
-    image: rustdesk/rustdesk-server:latest
105
-    command: hbbr
106
-    volumes:
107
-      - ./data:/root
108
-    networks:
109
-      - rustdesk-net
110
-    restart: unless-stopped
111
-```
112
-
113
-编辑第16行来指定你的中继服务器 (默认端口监听在 21117 的那一个)。 如果需要的话,您也可以编辑 volume 信息  (第 18 和 33 行)。
114
-
115
-(感谢 @lukebarone 和 @QuiGonLeong 协助提供的 docker-compose 配置示例)
116
-
117
-## 基于 S6-overlay 的镜像
118
-
119
-> 这些镜像是针对 `busybox:stable` 构建的,并添加了可执行程序(hbbr 和 hbbs)以及 [S6-overlay](https://github.com/just-containers/s6-overlay)。 它们可以使用以下tag在 [Docker hub](https://hub.docker.com/r/rustdesk/rustdesk-server-s6/) 上获取:
120
-
121
-
122
-| 架構      | version | image:tag                                    |
123
-| --------- | ------- | -------------------------------------------- |
124
-| multiarch | latest  | `rustdesk/rustdesk-server-s6:latest`         |
125
-| amd64     | latest  | `rustdesk/rustdesk-server-s6:latest-amd64`   |
126
-| i386      | latest  | `rustdesk/rustdesk-server-s6:latest-i386`    |
127
-| arm64v8   | latest  | `rustdesk/rustdesk-server-s6:latest-arm64v8` |
128
-| armv7     | latest  | `rustdesk/rustdesk-server-s6:latest-armv7`   |
129
-| multiarch | 2       | `rustdesk/rustdesk-server-s6:2`              |
130
-| amd64     | 2       | `rustdesk/rustdesk-server-s6:2-amd64`        |
131
-| i386      | 2       | `rustdesk/rustdesk-server-s6:2-i386`         |
132
-| arm64v8   | 2       | `rustdesk/rustdesk-server-s6:2-arm64v8`      |
133
-| armv7     | 2       | `rustdesk/rustdesk-server-s6:2-armv7`        |
134
-| multiarch | 2.0.0   | `rustdesk/rustdesk-server-s6:2.0.0`          |
135
-| amd64     | 2.0.0   | `rustdesk/rustdesk-server-s6:2.0.0-amd64`    |
136
-| i386      | 2.0.0   | `rustdesk/rustdesk-server-s6:2.0.0-i386`     |
137
-| arm64v8   | 2.0.0   | `rustdesk/rustdesk-server-s6:2.0.0-arm64v8`  |
138
-| armv7     | 2.0.0   | `rustdesk/rustdesk-server-s6:2.0.0-armv7`    |
139
-
140
-强烈建议您使用`major version` 或 `latest` tag 的 `multiarch` 架构的镜像。
141
-
142
-S6-overlay 在此处作为监控程序,用以保证两个进程的运行,因此使用此镜像,您无需运行两个容器。
143
-
144
-您可以使用 `docker run` 命令直接启动镜像,如下:
145
-
146
-```bash
147
-docker run --name rustdesk-server \ 
148
-  --net=host \
149
-  -e "RELAY=rustdeskrelay.example.com" \
150
-  -e "ENCRYPTED_ONLY=1" \
151
-  -v "$PWD/data:/data" -d rustdesk/rustdesk-server-s6:latest
152
-```
153
-
154
-或刪去 `--net=host` 参数, 但 P2P 直连功能将无法工作。
155
-
156
-```bash
157
-docker run --name rustdesk-server \
158
-  -p 21115:21115 -p 21116:21116 -p 21116:21116/udp \
159
-  -p 21117:21117 -p 21118:21118 -p 21119:21119 \
160
-  -e "RELAY=rustdeskrelay.example.com" \
161
-  -e "ENCRYPTED_ONLY=1" \
162
-  -v "$PWD/data:/data" -d rustdesk/rustdesk-server-s6:latest
163
-```
164
-
165
-或着您也可以使用 docker-compose 文件:
166
-
167
-```yaml
168
-version: '3'
169
-
170
-services:
171
-  rustdesk-server:
172
-    container_name: rustdesk-server
173
-    ports:
174
-      - 21115:21115
175
-      - 21116:21116
176
-      - 21116:21116/udp
177
-      - 21117:21117
178
-      - 21118:21118
179
-      - 21119:21119
180
-    image: rustdesk/rustdesk-server-s6:latest
181
-    environment:
182
-      - "RELAY=rustdesk.example.com:21117"
183
-      - "ENCRYPTED_ONLY=1"
184
-    volumes:
185
-      - ./data:/data
186
-    restart: unless-stopped
187
-```
188
-
189
-对于此容器镜像,除了在下面的环境变量部分指定的变量之外,您还可以使用以下`环境变量`
190
-
191
-| 环境变量           | 是否可选 | 描述                       |
192
-|----------------|------|--------------------------|
193
-| RELAY          | 否    | 运行此容器的宿主机的 IP 地址/ DNS 名称 |
194
-| ENCRYPTED_ONLY | 是    | 如果设置为 **"1"**,将不接受未加密的连接。 |
195
-| KEY_PUB        | 是    | 密钥对中的公钥(Public Key)      |
196
-| KEY_PRIV       | 是    | 密钥对中的私钥(Private Key)     |
197
-
198
-###  基于 S6-overlay 镜像的密钥管理
199
-
200
-您可以将密钥对保存在 Docker volume 中,但我们建议不要将密钥写入文件系統中;因此,我们提供了一些方案。
201
-
202
-在容器启动时,会检查密钥对是否存在(`/data/id_ed25519.pub` 和 `/data/id_ed25519`),如果其中一個密钥不存在,则会从环境变量或 Docker Secret 中重新生成它。
203
-然后检查密钥对的可用性:如果公钥和私钥不匹配,容器将停止运行。
204
-如果您未提供密钥,`hbbs` 将会在默认位置生成一个。
205
-
206
-#### 使用 ENV 存储密钥对
207
-
208
-您可以使用 Docker 环境变量來存储密钥。如下:
209
-
210
-```bash
211
-docker run --name rustdesk-server \ 
212
-  --net=host \
213
-  -e "RELAY=rustdeskrelay.example.com" \
214
-  -e "ENCRYPTED_ONLY=1" \
215
-  -e "DB_URL=/db/db_v2.sqlite3" \
216
-  -e "KEY_PRIV=FR2j78IxfwJNR+HjLluQ2Nh7eEryEeIZCwiQDPVe+PaITKyShphHAsPLn7So0OqRs92nGvSRdFJnE2MSyrKTIQ==" \
217
-  -e "KEY_PUB=iEyskoaYRwLDy5+0qNDqkbPdpxr0kXRSZxNjEsqykyE=" \
218
-  -v "$PWD/db:/db" -d rustdesk/rustdesk-server-s6:latest
219
-```
220
-
221
-```yaml
222
-version: '3'
223
-
224
-services:
225
-  rustdesk-server:
226
-    container_name: rustdesk-server
227
-    ports:
228
-      - 21115:21115
229
-      - 21116:21116
230
-      - 21116:21116/udp
231
-      - 21117:21117
232
-      - 21118:21118
233
-      - 21119:21119
234
-    image: rustdesk/rustdesk-server-s6:latest
235
-    environment:
236
-      - "RELAY=rustdesk.example.com:21117"
237
-      - "ENCRYPTED_ONLY=1"
238
-      - "DB_URL=/db/db_v2.sqlite3"
239
-      - "KEY_PRIV=FR2j78IxfwJNR+HjLluQ2Nh7eEryEeIZCwiQDPVe+PaITKyShphHAsPLn7So0OqRs92nGvSRdFJnE2MSyrKTIQ=="
240
-      - "KEY_PUB=iEyskoaYRwLDy5+0qNDqkbPdpxr0kXRSZxNjEsqykyE="
241
-    volumes:
242
-      - ./db:/db
243
-    restart: unless-stopped
244
-```
245
-
246
-#### 使用 Docker Secret 來保存密钥对
247
-
248
-您还可以使用 Docker Secret 來保存密钥。
249
-如果您使用 **docker-compose** 或 **docker swarm**,推荐您使用。
250
-只需按照以下示例操作:
251
-
252
-```bash
253
-cat secrets/id_ed25519.pub | docker secret create key_pub -
254
-cat secrets/id_ed25519 | docker secret create key_priv -
255
-docker service create --name rustdesk-server \
256
-  --secret key_priv --secret key_pub \
257
-  --net=host \
258
-  -e "RELAY=rustdeskrelay.example.com" \
259
-  -e "ENCRYPTED_ONLY=1" \
260
-  -e "DB_URL=/db/db_v2.sqlite3" \
261
-  --mount "type=bind,source=$PWD/db,destination=/db" \
262
-  rustdesk/rustdesk-server-s6:latest
263
-```
264
-
265
-```yaml
266
-version: '3'
267
-
268
-services:
269
-  rustdesk-server:
270
-    container_name: rustdesk-server
271
-    ports:
272
-      - 21115:21115
273
-      - 21116:21116
274
-      - 21116:21116/udp
275
-      - 21117:21117
276
-      - 21118:21118
277
-      - 21119:21119
278
-    image: rustdesk/rustdesk-server-s6:latest
279
-    environment:
280
-      - "RELAY=rustdesk.example.com:21117"
281
-      - "ENCRYPTED_ONLY=1"
282
-      - "DB_URL=/db/db_v2.sqlite3"
283
-    volumes:
284
-      - ./db:/db
285
-    restart: unless-stopped
286
-    secrets:
287
-      - key_pub
288
-      - key_priv
289
-
290
-secrets:
291
-  key_pub:
292
-    file: secrets/id_ed25519.pub
293
-  key_priv:
294
-    file: secrets/id_ed25519      
295
-```
296
-
297
-## 如何生成密钥对
298
-
299
-加密需要一对密钥;您可以按照前面所述提供它,但需要一个工具去生成密钥对。
300
-
301
-您可以使用以下命令生成一对密钥:
302
-
303
-```bash
304
-/usr/bin/rustdesk-utils genkeypair
305
-```
306
-
307
-如果您沒有(或不想)在系统上安装 `rustdesk-utils` 套件,您可以使用 Docker 执行相同的命令:
308
-
309
-```bash
310
-docker run --rm --entrypoint /usr/bin/rustdesk-utils  rustdesk/rustdesk-server-s6:latest genkeypair
311
-```
312
-
313
-运行后的输出内容如下:
314
-
315
-```text
316
-Public Key:  8BLLhtzUBU/XKAH4mep3p+IX4DSApe7qbAwNH9nv4yA=
317
-Secret Key:  egAVd44u33ZEUIDTtksGcHeVeAwywarEdHmf99KM5ajwEsuG3NQFT9coAfiZ6nen4hfgNICl7upsDA0f2e/jIA==
318
-```
319
-
320
-## .deb 套件
321
-
322
-每个可执行文件都有单独的 .deb 套件可供使用,您可以在 [releases](https://github.com/rustdesk/rustdesk-server/releases) 页面中找到它們。
323
-這些套件适用于以下发行版:
324
-
325
-- Ubuntu 22.04 LTS
326
-- Ubuntu 20.04 LTS
327
-- Ubuntu 18.04 LTS
328
-- Debian 11 bullseye
329
-- Debian 10 buster
330
-
331
-## ENV 环境变量
332
-
333
-可以使用这些`环境变量`参数來配置 hbbs 和 hbbr。
334
-您可以像往常一样指定参数,或者使用 .env 文件。
335
-
336
-| 参数                    | 可执行文件         | 描述                                               |
337
-|-----------------------|---------------|--------------------------------------------------|
338
-| ALWAYS_USE_RELAY      | hbbs          | 如果设定为 **"Y"**,将关闭直接点对点连接功能                       |
339
-| DB_URL                | hbbs          | 数据库配置                                            |
340
-| DOWNGRADE_START_CHECK | hbbr          | 降级检查之前的延迟是啊尽(以秒为单位)                              |
341
-| DOWNGRADE_THRESHOLD   | hbbr          | 降级检查的阈值(bit/ms)                                  |
342
-| KEY                   | hbbs/hbbr     | 如果设置了此参数,将强制使用指定密钥对,如果设为 **"_"**,则强制使用任意密钥       |
343
-| LIMIT_SPEED           | hbbr          | 速度限制(以Mb/s为单位)                                   |
344
-| PORT                  | hbbs/hbbr     | 监听端口(hbbs为21116,hbbr为21117)                      |
345
-| RELAY_SERVERS         | hbbs          | 运行hbbr的机器的IP地址/DNS名称(用逗号分隔)                      |
346
-| RUST_LOG              | all           | 设置 debug level (error\|warn\|info\|debug\|trace) |
347
-| SINGLE_BANDWIDTH      | hbbr          | 单个连接的最大带宽(以Mb/s为单位)                              |
348
-| TOTAL_BANDWIDTH       | hbbr          | 最大总带宽(以Mb/s为单位)                                  |

+ 168 - 123
README.md

@@ -1,82 +1,123 @@
1
+
2
+# 关于此分支
3
+
4
+
5
+
6
+[![build](https://github.com/lejianwen/rustdesk-server/actions/workflows/build.yaml/badge.svg)](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
+![Api.png](./readme/api.png)
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
-[![build](https://github.com/rustdesk/rustdesk-server/actions/workflows/build.yaml/badge.svg)](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为单位)                                  |

BIN
img.png


BIN
readme/api.png