You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: cvat/apps/documentation/installation.md
+115-174
Original file line number
Diff line number
Diff line change
@@ -327,29 +327,37 @@ If this is not the case, please complete the steps in the installation manual fi
327
327
328
328
We will go through the following sequence of steps to get CVAT over HTTPS:
329
329
330
-
- Move Docker Compose CVAT access port to 80/tcp.
331
-
- Configure Nginx to pass one of the [ACME challenges](https://letsencrypt.org/docs/challenge-types/).
330
+
- Setup containers on default 80/tcp port. Checkin and then down the containers.
331
+
- Configure Nginx to pass one of the [ACME challenges](https://letsencrypt.org/docs/challenge-types/) - webroot.
332
332
- Create the certificate files using [acme.sh](https://github.com/acmesh-official/acme.sh).
333
333
- Reconfigure Nginx to serve over HTTPS and map CVAT to Docker Compose port 443.
334
334
335
335
#### Step-by-step instructions
336
336
337
-
##### 1. Move the CVAT access port
337
+
##### 1. Make the proxy listen on standard port 80 and prepare nginx for the ACME challenge via webroot method
338
+
339
+
> The configuration assumes that on the docker host there will be only one instance of the CVAT site listens for incoming connections on 80 and 443 port. Also redirecting everything that does not concern renewal of certificates to the site via secure HTTPS protocol.
338
340
339
341
Let's assume the server will be at `my-cvat-server.org`.
340
342
343
+
Point you shell in cvat repository directory, usually `cd $HOME/cvat`:
344
+
345
+
Add the following into your `docker-compose.override.yml`, replacing `my-cvat-server.org` with your own IP address. This file lives in the same directory as `docker-compose.yml`.
346
+
347
+
Create enough directories for letsencrypt webroot operation and acme folder passthrougth.
348
+
349
+
and restart containers with a new configuration updated in `docker-compose.override.yml`
350
+
341
351
```bash
342
-
# on the server
343
-
docker-compose down
352
+
# on the docker host
344
353
345
-
# add docker-compose.override.yml as per instructions below
354
+
# this will create ~/.acme.sh directory
355
+
curl https://get.acme.sh | sh
346
356
347
-
docker-compose up -d
357
+
# create a subdirs for acme-challenge webroot manually
You should now see an unsecured version of CVAT at `http://my-cvat-server.org`.
381
+
This will enable serving `http://my-cvat-server.org/.well-known/acme-challenge/`
382
+
route from `/var/tmp/letsencrypt-webroot` directory on the container's filesystem which is bind mounted from docker host `$HOME/cvat/letsencrypt-webroot`. That volume needed for issue and renewing certificates only.
383
+
384
+
Update a CVAT site proxy template `$HOME/cvat/cvat_proxy/conf.d/cvat.conf.template` on docker(system) host. Site config updates from this template each time`cvat_proxy` container start.
370
385
371
-
##### 2. Configure Nginx for the ACME challenge
386
+
Add a location to server with `server_name ${CVAT_HOST};` ahead others:
There are multiple approaches. First one is to use helper on docker host.
402
411
403
-
location / {
404
-
# workaround for match location by arguments
405
-
error_page 418 = @annotation_ui;
412
+
In a our approach
413
+
* it is easier to setup automatic certificate updates and (than it can be done in the container).
414
+
* leave certificates in safe place on docker host (protect from `docker-compose down` cleanup)
415
+
* no unnecessary certificate files copying between container and host.
406
416
407
-
if ( $query_string~"^id=\d+.*" ) { return 418; }
417
+
###### Create certificate files using an ACME challenge on docker host
408
418
409
-
proxy_pass http://cvat_ui;
410
-
proxy_pass_header X-CSRFToken;
411
-
proxy_set_header Host $http_host;
412
-
proxy_pass_header Set-Cookie;
413
-
}
419
+
**Prepare certificates.**
414
420
415
-
# old annotation ui, will be removed in the future.
416
-
location @annotation_ui {
417
-
proxy_pass http://cvat:8080;
418
-
proxy_pass_header X-CSRFToken;
419
-
proxy_set_header Host $http_host;
420
-
proxy_pass_header Set-Cookie;
421
-
}
422
-
}
423
-
```
421
+
Point you shell in cvat repository directory, usually `cd $HOME/cvat` on docker host.
424
422
425
-
Now create the `/letsencrypt` directory and mount it into `cvat_proxy` container.
426
-
Edit your `docker-compose.override.yml` to look like the following:
423
+
> Certificate issue and updates should be on docker host in this approach.
427
424
428
-
```yaml
429
-
# docker-compose.override.yml
430
-
version: "2.3"
425
+
Let’s Encrypt provides rate limits to ensure fair usage by as many people as possible. They recommend utilize their staging environment instead of the production API during testing. So first try to get a test certificate.
0 commit comments