|
|
@@ -176,3 +176,103 @@ We use these environment variables:
|
|
176
|
176
|
| --- | --- | --- |
|
|
177
|
177
|
| RELAY | no | the IP address/DNS name of the machine running this container |
|
|
178
|
178
|
| ENCRYPTED_ONLY | yes | if set to **"1"** unencrypted connection will not be accepted |
|
|
|
179
|
+| DB_URL | yes | path for database file |
|
|
|
180
|
+| KEY_PUB | yes | public part of the key pair |
|
|
|
181
|
+| KEY_PRIV | yes | private part of the key pair |
|
|
|
182
|
+
|
|
|
183
|
+### Secret management in S6-overlay based images
|
|
|
184
|
+
|
|
|
185
|
+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.
|
|
|
186
|
+
|
|
|
187
|
+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.
|
|
|
188
|
+
|
|
|
189
|
+#### Use ENV to store the key pair
|
|
|
190
|
+
|
|
|
191
|
+You can use docker environment variables to store the keys. Just follow this examples:
|
|
|
192
|
+
|
|
|
193
|
+```bash
|
|
|
194
|
+docker run --name rustdesk-server \
|
|
|
195
|
+ --net=host \
|
|
|
196
|
+ -e "RELAY=rustdeskrelay.example.com" \
|
|
|
197
|
+ -e "ENCRYPTED_ONLY=1" \
|
|
|
198
|
+ -e "DB_URL=/db/db_v2.sqlite3" \
|
|
|
199
|
+ -e "KEY_PRIV=FR2j78IxfwJNR+HjLluQ2Nh7eEryEeIZCwiQDPVe+PaITKyShphHAsPLn7So0OqRs92nGvSRdFJnE2MSyrKTIQ==" \
|
|
|
200
|
+ -e "KEY_PUB=iEyskoaYRwLDy5+0qNDqkbPdpxr0kXRSZxNjEsqykyE=" \
|
|
|
201
|
+ -v "$PWD/db:/db" -d rustdesk/rustdesk-server-s6:latest
|
|
|
202
|
+```
|
|
|
203
|
+
|
|
|
204
|
+```yaml
|
|
|
205
|
+version: '3'
|
|
|
206
|
+
|
|
|
207
|
+services:
|
|
|
208
|
+ rustdesk-server:
|
|
|
209
|
+ container_name: rustdesk-server
|
|
|
210
|
+ ports:
|
|
|
211
|
+ - 21115:21115
|
|
|
212
|
+ - 21116:21116
|
|
|
213
|
+ - 21116:21116/udp
|
|
|
214
|
+ - 21117:21117
|
|
|
215
|
+ - 21118:21118
|
|
|
216
|
+ - 21119:21119
|
|
|
217
|
+ image: rustdesk/rustdesk-server-s6:latest
|
|
|
218
|
+ environment:
|
|
|
219
|
+ - "RELAY=rustdesk.example.com:21117"
|
|
|
220
|
+ - "ENCRYPTED_ONLY=1"
|
|
|
221
|
+ - "DB_URL=/db/db_v2.sqlite3"
|
|
|
222
|
+ - "KEY_PRIV=FR2j78IxfwJNR+HjLluQ2Nh7eEryEeIZCwiQDPVe+PaITKyShphHAsPLn7So0OqRs92nGvSRdFJnE2MSyrKTIQ=="
|
|
|
223
|
+ - "KEY_PUB=iEyskoaYRwLDy5+0qNDqkbPdpxr0kXRSZxNjEsqykyE="
|
|
|
224
|
+ volumes:
|
|
|
225
|
+ - ./db:/db
|
|
|
226
|
+ restart: unless-stopped
|
|
|
227
|
+```
|
|
|
228
|
+
|
|
|
229
|
+#### Use Docker secrets to store the key pair
|
|
|
230
|
+
|
|
|
231
|
+You can alternatively use docker secrets to store the keys.
|
|
|
232
|
+This is useful if you're using **docker-compose** or **docker swarm**.
|
|
|
233
|
+Just follow this examples:
|
|
|
234
|
+
|
|
|
235
|
+```bash
|
|
|
236
|
+cat secrets/id_ed25519.pub | docker secret create key_pub -
|
|
|
237
|
+cat secrets/id_ed25519 | docker secret create key_priv -
|
|
|
238
|
+docker service create --name rustdesk-server \
|
|
|
239
|
+ --secret key_priv --secret key_pub \
|
|
|
240
|
+ --net=host \
|
|
|
241
|
+ -e "RELAY=rustdeskrelay.example.com" \
|
|
|
242
|
+ -e "ENCRYPTED_ONLY=1" \
|
|
|
243
|
+ -e "DB_URL=/db/db_v2.sqlite3" \
|
|
|
244
|
+ --mount "type=bind,source=$PWD/db,destination=/db" \
|
|
|
245
|
+ rustdesk/rustdesk-server-s6:latest
|
|
|
246
|
+```
|
|
|
247
|
+
|
|
|
248
|
+```yaml
|
|
|
249
|
+version: '3'
|
|
|
250
|
+
|
|
|
251
|
+services:
|
|
|
252
|
+ rustdesk-server:
|
|
|
253
|
+ container_name: rustdesk-server
|
|
|
254
|
+ ports:
|
|
|
255
|
+ - 21115:21115
|
|
|
256
|
+ - 21116:21116
|
|
|
257
|
+ - 21116:21116/udp
|
|
|
258
|
+ - 21117:21117
|
|
|
259
|
+ - 21118:21118
|
|
|
260
|
+ - 21119:21119
|
|
|
261
|
+ image: rustdesk/rustdesk-server-s6:latest
|
|
|
262
|
+ environment:
|
|
|
263
|
+ - "RELAY=rustdesk.example.com:21117"
|
|
|
264
|
+ - "ENCRYPTED_ONLY=1"
|
|
|
265
|
+ - "DB_URL=/db/db_v2.sqlite3"
|
|
|
266
|
+ volumes:
|
|
|
267
|
+ - ./db:/db
|
|
|
268
|
+ restart: unless-stopped
|
|
|
269
|
+ secrets:
|
|
|
270
|
+ - key_pub
|
|
|
271
|
+ - key_priv
|
|
|
272
|
+
|
|
|
273
|
+secrets:
|
|
|
274
|
+ key_pub:
|
|
|
275
|
+ file: secrets/id_ed25519.pub
|
|
|
276
|
+ key_priv:
|
|
|
277
|
+ file: secrets/id_ed25519
|
|
|
278
|
+```
|