|
|
@@ -267,189 +267,7 @@ The prefix for variable names is `RUSTDESK_API`. If environment variables exist,
|
|
267
|
267
|
lejianwen/rustdesk-api
|
|
268
|
268
|
```
|
|
269
|
269
|
|
|
270
|
|
-2. Using `docker-compose`
|
|
271
|
|
- - Simple example:
|
|
272
|
|
- ```yaml
|
|
273
|
|
- services:
|
|
274
|
|
- rustdesk-api:
|
|
275
|
|
- container_name: rustdesk-api
|
|
276
|
|
- environment:
|
|
277
|
|
- - RUSTDESK_API_LANG=en
|
|
278
|
|
- - RUSTDESK_API_RUSTDESK_ID_SERVER=192.168.1.66:21116
|
|
279
|
|
- - RUSTDESK_API_RUSTDESK_RELAY_SERVER=192.168.1.66:21117
|
|
280
|
|
- - RUSTDESK_API_RUSTDESK_API_SERVER=http://192.168.1.66:21114
|
|
281
|
|
- - RUSTDESK_API_RUSTDESK_KEY=<key>
|
|
282
|
|
- ports:
|
|
283
|
|
- - 21114:21114
|
|
284
|
|
- image: lejianwen/rustdesk-api
|
|
285
|
|
- volumes:
|
|
286
|
|
- - /data/rustdesk/api:/app/data # Mount the database for easy backup
|
|
287
|
|
- networks:
|
|
288
|
|
- - rustdesk-net
|
|
289
|
|
- restart: unless-stopped
|
|
290
|
|
- ```
|
|
291
|
|
-
|
|
292
|
|
- - Example with RustDesk's official Docker Compose file, adding your `rustdesk-api` service:
|
|
293
|
|
- - If you are using a system-generated KEY, remove the `-k <key>` parameter. However, after the first startup, run `docker-compose logs hbbs` or `cat ./data/id_ed25519.pub` to view the KEY, then modify `RUSTDESK_API_RUSTDESK_KEY=<key>` and execute `docker-compose up -d` again.
|
|
294
|
|
- ```yaml
|
|
295
|
|
- networks:
|
|
296
|
|
- rustdesk-net:
|
|
297
|
|
- external: false
|
|
298
|
|
- services:
|
|
299
|
|
- hbbs:
|
|
300
|
|
- container_name: hbbs
|
|
301
|
|
- ports:
|
|
302
|
|
- - 21115:21115
|
|
303
|
|
- - 21116:21116 # 自定义 hbbs 映射端口
|
|
304
|
|
- - 21116:21116/udp # 自定义 hbbs 映射端口
|
|
305
|
|
- - 21118:21118 # web client
|
|
306
|
|
- image: rustdesk/rustdesk-server
|
|
307
|
|
- command: hbbs -r <relay-server-ip[:port]> -k <key> # 填入个人域名或 IP + hbbr 暴露端口
|
|
308
|
|
- volumes:
|
|
309
|
|
- - ./data:/root # 自定义挂载目录
|
|
310
|
|
- networks:
|
|
311
|
|
- - rustdesk-net
|
|
312
|
|
- depends_on:
|
|
313
|
|
- - hbbr
|
|
314
|
|
- restart: unless-stopped
|
|
315
|
|
- deploy:
|
|
316
|
|
- resources:
|
|
317
|
|
- limits:
|
|
318
|
|
- memory: 64M
|
|
319
|
|
- hbbr:
|
|
320
|
|
- container_name: hbbr
|
|
321
|
|
- ports:
|
|
322
|
|
- - 21117:21117 # 自定义 hbbr 映射端口
|
|
323
|
|
- - 21119:21119 # web client
|
|
324
|
|
- image: rustdesk/rustdesk-server
|
|
325
|
|
- command: hbbr -k <key>
|
|
326
|
|
- volumes:
|
|
327
|
|
- - ./data:/root
|
|
328
|
|
- networks:
|
|
329
|
|
- - rustdesk-net
|
|
330
|
|
- restart: unless-stopped
|
|
331
|
|
- deploy:
|
|
332
|
|
- resources:
|
|
333
|
|
- limits:
|
|
334
|
|
- memory: 64M
|
|
335
|
|
- rustdesk-api:
|
|
336
|
|
- container_name: rustdesk-api
|
|
337
|
|
- environment:
|
|
338
|
|
- - TZ=Asia/Shanghai
|
|
339
|
|
- - RUSTDESK_API_RUSTDESK_ID_SERVER=192.168.1.66:21116
|
|
340
|
|
- - RUSTDESK_API_RUSTDESK_RELAY_SERVER=192.168.1.66:21117
|
|
341
|
|
- - RUSTDESK_API_RUSTDESK_API_SERVER=http://192.168.1.66:21114
|
|
342
|
|
- - RUSTDESK_API_RUSTDESK_KEY=<key>
|
|
343
|
|
- ports:
|
|
344
|
|
- - 21114:21114
|
|
345
|
|
- image: lejianwen/rustdesk-api
|
|
346
|
|
- volumes:
|
|
347
|
|
- - /data/rustdesk/api:/app/data #将数据库挂载出来方便备份
|
|
348
|
|
- networks:
|
|
349
|
|
- - rustdesk-net
|
|
350
|
|
- restart: unless-stopped
|
|
351
|
|
- ```
|
|
352
|
|
-
|
|
353
|
|
- - S6 image
|
|
354
|
|
- - - If using ***custom KEY***, you will need to modify the startup script to override the `/etc/s6-overlay/s6-rc.d/hbbr/run` and `/etc/s6-overlay/s6-rc.d/hbbr/run` in the image.
|
|
355
|
|
- 1. Create `hbbr/run`, only needed for custom KEY
|
|
356
|
|
- ```bash
|
|
357
|
|
- #!/command/with-contenv sh
|
|
358
|
|
- cd /data
|
|
359
|
|
- PARAMS=
|
|
360
|
|
- [ "${ENCRYPTED_ONLY}" = "1" ] && PARAMS="-k ${KEY}"
|
|
361
|
|
- /usr/bin/hbbr $PARAMS
|
|
362
|
|
- ```
|
|
363
|
|
- 2. Create `hbbs/run`, only needed for custom KEY
|
|
364
|
|
- ```bash
|
|
365
|
|
- #!/command/with-contenv sh
|
|
366
|
|
- sleep 2
|
|
367
|
|
- cd /data
|
|
368
|
|
- PARAMS=
|
|
369
|
|
- [ "${ENCRYPTED_ONLY}" = "1" ] && PARAMS="-k ${KEY}"
|
|
370
|
|
- /usr/bin/hbbs -r $RELAY $PARAMS
|
|
371
|
|
- ```
|
|
372
|
|
- 3. Modify the `s6` section in `docker-compose.yml`
|
|
373
|
|
- ```yaml
|
|
374
|
|
- networks:
|
|
375
|
|
- rustdesk-net:
|
|
376
|
|
- external: false
|
|
377
|
|
- services:
|
|
378
|
|
- rustdesk-server:
|
|
379
|
|
- container_name: rustdesk-server
|
|
380
|
|
- ports:
|
|
381
|
|
- - 21115:21115
|
|
382
|
|
- - 21116:21116
|
|
383
|
|
- - 21116:21116/udp
|
|
384
|
|
- - 21117:21117
|
|
385
|
|
- - 21118:21118
|
|
386
|
|
- - 21119:21119
|
|
387
|
|
- image: rustdesk/rustdesk-server-s6:latest
|
|
388
|
|
- environment:
|
|
389
|
|
- - RELAY=192.168.1.66:21117
|
|
390
|
|
- - ENCRYPTED_ONLY=1
|
|
391
|
|
- - KEY=<key> #KEY
|
|
392
|
|
- volumes:
|
|
393
|
|
- - ./data:/data
|
|
394
|
|
- - ./hbbr/run:/etc/s6-overlay/s6-rc.d/hbbr/run
|
|
395
|
|
- - ./hbbs/run:/etc/s6-overlay/s6-rc.d/hbbs/run
|
|
396
|
|
- restart: unless-stopped
|
|
397
|
|
- rustdesk-api:
|
|
398
|
|
- container_name: rustdesk-api
|
|
399
|
|
- ports:
|
|
400
|
|
- - 21114:21114
|
|
401
|
|
- image: lejianwen/rustdesk-api
|
|
402
|
|
- environment:
|
|
403
|
|
- - TZ=Asia/Shanghai
|
|
404
|
|
- - RUSTDESK_API_RUSTDESK_ID_SERVER=192.168.1.66:21116
|
|
405
|
|
- - RUSTDESK_API_RUSTDESK_RELAY_SERVER=192.168.1.66:21117
|
|
406
|
|
- - RUSTDESK_API_RUSTDESK_API_SERVER=http://192.168.1.66:21114
|
|
407
|
|
- - RUSTDESK_API_RUSTDESK_KEY=<key>
|
|
408
|
|
- volumes:
|
|
409
|
|
- - /data/rustdesk/api:/app/data
|
|
410
|
|
- networks:
|
|
411
|
|
- - rustdesk-net
|
|
412
|
|
- restart: unless-stopped
|
|
413
|
|
- ```
|
|
414
|
|
- - If using ***system-generated KEY*** or ***custom KEY_PUB, KEY_PRIV***, you do not need to modify the startup script, but you need to obtain the KEY after it is generated and then run `docker-compose up -d`
|
|
415
|
|
- ```yaml
|
|
416
|
|
- networks:
|
|
417
|
|
- rustdesk-net:
|
|
418
|
|
- external: false
|
|
419
|
|
- services:
|
|
420
|
|
- rustdesk-server:
|
|
421
|
|
- container_name: rustdesk-server
|
|
422
|
|
- ports:
|
|
423
|
|
- - 21115:21115
|
|
424
|
|
- - 21116:21116
|
|
425
|
|
- - 21116:21116/udp
|
|
426
|
|
- - 21117:21117
|
|
427
|
|
- - 21118:21118
|
|
428
|
|
- - 21119:21119
|
|
429
|
|
- image: rustdesk/rustdesk-server-s6:latest
|
|
430
|
|
- environment:
|
|
431
|
|
- - RELAY=192.168.1.66:21117
|
|
432
|
|
- - ENCRYPTED_ONLY=1
|
|
433
|
|
- volumes:
|
|
434
|
|
- - ./data:/data
|
|
435
|
|
- restart: unless-stopped
|
|
436
|
|
- rustdesk-api:
|
|
437
|
|
- container_name: rustdesk-api
|
|
438
|
|
- ports:
|
|
439
|
|
- - 21114:21114
|
|
440
|
|
- image: lejianwen/rustdesk-api
|
|
441
|
|
- environment:
|
|
442
|
|
- - TZ=Asia/Shanghai
|
|
443
|
|
- - RUSTDESK_API_RUSTDESK_ID_SERVER=192.168.1.66:21116
|
|
444
|
|
- - RUSTDESK_API_RUSTDESK_RELAY_SERVER=192.168.1.66:21117
|
|
445
|
|
- - RUSTDESK_API_RUSTDESK_API_SERVER=http://192.168.1.66:21114
|
|
446
|
|
- - RUSTDESK_API_RUSTDESK_KEY=<key>
|
|
447
|
|
- volumes:
|
|
448
|
|
- - /data/rustdesk/api:/app/data
|
|
449
|
|
- networks:
|
|
450
|
|
- - rustdesk-net
|
|
451
|
|
- restart: unless-stopped
|
|
452
|
|
- ```
|
|
|
270
|
+2. Using `docker-compose`,look [wiki](https://github.com/lejianwen/rustdesk-api/wiki)
|
|
453
|
271
|
|
|
454
|
272
|
#### Running from Release
|
|
455
|
273
|
|
|
|
@@ -498,21 +316,7 @@ Download the release from [release](https://github.com/lejianwen/rustdesk-api/re
|
|
498
|
316
|
6. Open your browser and visit `http://<your server[:port]>/_admin/`, with default credentials `admin admin`. Please
|
|
499
|
317
|
change the password promptly.
|
|
500
|
318
|
|
|
501
|
|
-#### nginx reverse proxy
|
|
502
|
|
-Configure reverse proxy in `nginx`
|
|
503
|
|
-```
|
|
504
|
|
-server {
|
|
505
|
|
- listen <your port>;
|
|
506
|
|
- server_name <your server>;
|
|
507
|
|
- location / {
|
|
508
|
|
- proxy_pass http://<api-server[:port]>;
|
|
509
|
|
- proxy_set_header Host $host;
|
|
510
|
|
- proxy_set_header X-Real-IP $remote_addr;
|
|
511
|
|
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
512
|
|
- proxy_set_header X-Forwarded-Proto $scheme;
|
|
513
|
|
- }
|
|
514
|
|
-}
|
|
515
|
|
-```
|
|
|
319
|
+
|
|
516
|
320
|
## Others
|
|
517
|
321
|
|
|
518
|
322
|
- [Change client ID](https://github.com/abdullah-erturk/RustDesk-ID-Changer)
|