|
|
@@ -8,8 +8,31 @@ desktop software that provides self-hosted solutions.
|
|
8
|
8
|
<img src="https://img.shields.io/badge/gin-v1.9.0-lightBlue"/>
|
|
9
|
9
|
<img src="https://img.shields.io/badge/gorm-v1.25.7-green"/>
|
|
10
|
10
|
<img src="https://img.shields.io/badge/swag-v1.16.3-yellow"/>
|
|
|
11
|
+<img src="https://github.com/lejianwen/rustdesk-api/actions/workflows/release.yml/badge.svg"/>
|
|
|
12
|
+<img src="https://github.com/lejianwen/rustdesk-api/actions/workflows/docker.yml/badge.svg"/>
|
|
11
|
13
|
</div>
|
|
12
|
14
|
|
|
|
15
|
+# Features
|
|
|
16
|
+
|
|
|
17
|
+- PC API
|
|
|
18
|
+ - Personal API
|
|
|
19
|
+ - Login
|
|
|
20
|
+ - Address Book
|
|
|
21
|
+ - Groups
|
|
|
22
|
+ - Authorized login, supports `GitHub` and `Google` login, supports `web admin` authorized login
|
|
|
23
|
+- Web Admin
|
|
|
24
|
+ - User Management
|
|
|
25
|
+ - Device Management
|
|
|
26
|
+ - Address Book Management
|
|
|
27
|
+ - Tag Management
|
|
|
28
|
+ - Group Management
|
|
|
29
|
+ - OAuth Management
|
|
|
30
|
+ - Quick access to web client
|
|
|
31
|
+- Web Client
|
|
|
32
|
+ - Automatically obtain API server
|
|
|
33
|
+ - Automatically obtain ID server and KEY
|
|
|
34
|
+ - Automatically obtain address book
|
|
|
35
|
+
|
|
13
|
36
|
## Prerequisites
|
|
14
|
37
|
|
|
15
|
38
|
### [Rustdesk](https://github.com/rustdesk/rustdesk)
|
|
|
@@ -32,11 +55,12 @@ desktop software that provides self-hosted solutions.
|
|
32
|
55
|
|
|
33
|
56
|
## Features
|
|
34
|
57
|
|
|
35
|
|
-### API Service: Basic implementation of the PC client's primary interfaces.
|
|
|
58
|
+### API Service: Basic implementation of the PC client's primary interfaces.Supports the Personal version api, which can be enabled by configuring the `rustdesk.personal` file or the `RUSTDESK_PERSONAL` environment variable.
|
|
36
|
59
|
|
|
37
|
60
|
#### Login
|
|
38
|
61
|
|
|
39
|
|
-- Added `GitHub` and `Google` login, which can be used after configuration in the admin panel. See the OAuth configuration section
|
|
|
62
|
+- Added `GitHub` and `Google` login, which can be used after configuration in the admin panel. See the OAuth
|
|
|
63
|
+ configuration section
|
|
40
|
64
|
for details.
|
|
41
|
65
|
- Added authorization login for the web admin panel.
|
|
42
|
66
|
|
|
|
@@ -50,7 +74,10 @@ desktop software that provides self-hosted solutions.
|
|
50
|
74
|
|
|
51
|
75
|

|
|
52
|
76
|
|
|
53
|
|
-### **Web UI**: The frontend and backend are separated to provide a user-friendly management interface, primarily for managing and displaying data.
|
|
|
77
|
+### **Web UI
|
|
|
78
|
+
|
|
|
79
|
+**: The frontend and backend are separated to provide a user-friendly management interface, primarily for managing and
|
|
|
80
|
+displaying data.
|
|
54
|
81
|
|
|
55
|
82
|
***Frontend code is available at [rustdesk-api-web](https://github.com/lejianwen/rustdesk-api-web)***
|
|
56
|
83
|
|
|
|
@@ -67,7 +94,8 @@ installation are `admin` `admin`, please change the password immediately.***
|
|
67
|
94
|

|
|
68
|
95
|
5. You can open the web client directly for convenience:
|
|
69
|
96
|

|
|
70
|
|
-6. OAuth support: Currently, `GitHub` and `Google` is supported. You need to create an `OAuth App` and configure it in the admin
|
|
|
97
|
+6. OAuth support: Currently, `GitHub` and `Google` is supported. You need to create an `OAuth App` and configure it in
|
|
|
98
|
+ the admin
|
|
71
|
99
|
panel.
|
|
72
|
100
|

|
|
73
|
101
|
- Create a `GitHub OAuth App`
|
|
|
@@ -84,7 +112,9 @@ installation are `admin` `admin`, please change the password immediately.***
|
|
84
|
112
|
3. After logging in, the ID server and key will be automatically synced.
|
|
85
|
113
|
4. The address book will also be automatically saved to the web client for convenient use.
|
|
86
|
114
|
|
|
87
|
|
-### **Automated Documentation** : API documentation is generated using Swag, making it easier for developers to understand and use the API.
|
|
|
115
|
+### **Automated Documentation
|
|
|
116
|
+
|
|
|
117
|
+** : API documentation is generated using Swag, making it easier for developers to understand and use the API.
|
|
88
|
118
|
|
|
89
|
119
|
1. Admin panel docs: `<your server>/admin/swagger/index.html`
|
|
90
|
120
|
2. PC client docs: `<your server>/swagger/index.html`
|
|
|
@@ -125,11 +155,13 @@ rustdesk:
|
|
125
|
155
|
| Variable Name | Description | Example |
|
|
126
|
156
|
|------------------------------------|-----------------------------------------------------------|--------------------------------|
|
|
127
|
157
|
| ----- GIN Configuration ----- | --------------------------------------- | ------------------------------ |
|
|
|
158
|
+| TZ | 时区 | Asia/Shanghai |
|
|
128
|
159
|
| RUSTDESK_API_GIN_TRUST_PROXY | Trusted proxy IPs, separated by commas. | 192.168.1.2,192.168.1.3 |
|
|
129
|
160
|
| ----- GORM Configuration ----- | --------------------------------------- | ------------------------------ |
|
|
130
|
161
|
| RUSTDESK_API_GORM_TYPE | Database type (`sqlite` or `mysql`). Default is `sqlite`. | sqlite |
|
|
131
|
162
|
| RUSTDESK_API_GORM_MAX_IDLE_CONNS | Maximum idle connections | 10 |
|
|
132
|
163
|
| RUSTDESK_API_GORM_MAX_OPEN_CONNS | Maximum open connections | 100 |
|
|
|
164
|
+| RUSTDESK_PERSONAL | Open Personal Api 1:Enable,0:Disable | 1 |
|
|
133
|
165
|
| ----- MYSQL Configuration ----- | --------------------------------------- | ------------------------------ |
|
|
134
|
166
|
| RUSTDESK_API_MYSQL_USERNAME | MySQL username | root |
|
|
135
|
167
|
| RUSTDESK_API_MYSQL_PASSWORD | MySQL password | 111111 |
|
|
|
@@ -241,6 +273,70 @@ lejianwen/rustdesk-api
|
|
241
|
273
|
restart: unless-stopped
|
|
242
|
274
|
|
|
243
|
275
|
```
|
|
|
276
|
+ - If you are using an S6 image, you need to modify the startup script `/etc/s6-overlay/s6-rc.d/hbbr/run`
|
|
|
277
|
+ and `/etc/s6-overlay/s6-rc.d/hbbr/run`
|
|
|
278
|
+
|
|
|
279
|
+ 1. create `hbbr/run`
|
|
|
280
|
+
|
|
|
281
|
+ ```bash
|
|
|
282
|
+ #!/command/with-contenv sh
|
|
|
283
|
+ cd /data
|
|
|
284
|
+ PARAMS=
|
|
|
285
|
+ [ "${ENCRYPTED_ONLY}" = "1" ] && PARAMS="-k ${KEY}"
|
|
|
286
|
+ /usr/bin/hbbr $PARAMS
|
|
|
287
|
+ ```
|
|
|
288
|
+
|
|
|
289
|
+ 2. create `hbbs/run`
|
|
|
290
|
+ ```bash
|
|
|
291
|
+ #!/command/with-contenv sh
|
|
|
292
|
+ sleep 2
|
|
|
293
|
+ cd /data
|
|
|
294
|
+ PARAMS=
|
|
|
295
|
+ [ "${ENCRYPTED_ONLY}" = "1" ] && PARAMS="-k ${KEY}"
|
|
|
296
|
+ /usr/bin/hbbs -r $RELAY $PARAMS
|
|
|
297
|
+ ```
|
|
|
298
|
+ 3. edit `docker-compose.yml`
|
|
|
299
|
+ ```
|
|
|
300
|
+ networks:
|
|
|
301
|
+ rustdesk-net:
|
|
|
302
|
+ external: false
|
|
|
303
|
+ services:
|
|
|
304
|
+ rustdesk-server:
|
|
|
305
|
+ container_name: rustdesk-server
|
|
|
306
|
+ ports:
|
|
|
307
|
+ - 21115:21115
|
|
|
308
|
+ - 21116:21116
|
|
|
309
|
+ - 21116:21116/udp
|
|
|
310
|
+ - 21117:21117
|
|
|
311
|
+ - 21118:21118
|
|
|
312
|
+ - 21119:21119
|
|
|
313
|
+ image: rustdesk/rustdesk-server-s6:latest
|
|
|
314
|
+ environment:
|
|
|
315
|
+ - RELAY=192.168.1.66:21117
|
|
|
316
|
+ - ENCRYPTED_ONLY=1
|
|
|
317
|
+ - KEY=abc123456789
|
|
|
318
|
+ volumes:
|
|
|
319
|
+ - ./data:/data
|
|
|
320
|
+ - ./hbbr/run:/etc/s6-overlay/s6-rc.d/hbbr/run
|
|
|
321
|
+ - ./hbbs/run:/etc/s6-overlay/s6-rc.d/hbbs/run
|
|
|
322
|
+ restart: unless-stopped
|
|
|
323
|
+ rustdesk-api:
|
|
|
324
|
+ container_name: rustdesk-api
|
|
|
325
|
+ ports:
|
|
|
326
|
+ - 21114:21114
|
|
|
327
|
+ image: lejianwen/rustdesk-api
|
|
|
328
|
+ environment:
|
|
|
329
|
+ - TZ=Asia/Shanghai
|
|
|
330
|
+ - RUSTDESK_API_RUSTDESK_ID_SERVER=192.168.1.66:21116
|
|
|
331
|
+ - RUSTDESK_API_RUSTDESK_RELAY_SERVER=192.168.1.66:21117
|
|
|
332
|
+ - RUSTDESK_API_RUSTDESK_API_SERVER=http://192.168.1.66:21114
|
|
|
333
|
+ - RUSTDESK_API_RUSTDESK_KEY=abc123456789
|
|
|
334
|
+ volumes:
|
|
|
335
|
+ - /data/rustdesk/api:/app/data #将数据库挂载
|
|
|
336
|
+ networks:
|
|
|
337
|
+ - rustdesk-net
|
|
|
338
|
+ restart: unless-stopped
|
|
|
339
|
+ ```
|
|
244
|
340
|
|
|
245
|
341
|
#### Running from Release
|
|
246
|
342
|
|