From 38d6426b0eed35ed0adbdfc414bedb48eb6e2ac8 Mon Sep 17 00:00:00 2001 From: purplemeteorite Date: Tue, 4 Jul 2023 18:41:05 +0200 Subject: [PATCH 1/2] coturn setup instructions for docker --- docker/README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/docker/README.md b/docker/README.md index c7028329..4ed70837 100644 --- a/docker/README.md +++ b/docker/README.md @@ -54,7 +54,7 @@ to pass `-e CONDUIT_CONFIG=""` into your container. For an overview of possible If you just want to test Conduit for a short time, you can use the `--rm` flag, which will clean up everything related to your container after you stop it. -## Docker-compose +### Docker-compose If the `docker run` command is not for you or your setup, you can also use one of the provided `docker-compose` files. @@ -138,3 +138,56 @@ So...step by step: 6. Run `docker-compose up -d` 7. Connect to your homeserver with your preferred client and create a user. You should do this immediately after starting Conduit, because the first created user is the admin. + + + + +## Voice communication + +In order to make or receive calls, a TURN server is required. Conduit suggests using [Coturn](https://github.com/coturn/coturn) for this purpose, which is also available as a Docker image. Before proceeding with the software installation, it is essential to have the necessary configurations in place. + +### Configuration + +Create a configuration file called `coturn.conf` containing: + +```conf +use-auth-secret +static-auth-secret= +realm= +``` +These same values need to be set in conduit. You can either modify conduit.toml to include these lines: +``` +turn_uris = ["turn:?transport=udp", "turn:?transport=tcp"] +turn_secret = "" +``` +or append the following to the docker environment variables dependig on which configuration method you used earlier: +```yml +- CONDUIT_TURN_URIS=["turn:?transport=udp", "turn:?transport=tcp"] +- CONDUIT_TURN_SECRET=" +``` +Restart Conduit to apply these changes. + +### Run +Run the [Coturn](https://hub.docker.com/r/coturn/coturn) image using +```bash +docker run -d --network=host -v $(pwd)/coturn.conf:/etc/coturn/turnserver.conf coturn/coturn +``` + +or docker-compose. For the latter, paste the following section into a file called `docker-compose.yml` +and run `docker-compose up -d` in the same directory. + +```yml +version: 3 +services: + turn: + container_name: coturn-server + image: docker.io/coturn/coturn + restart: unless-stopped + network_mode: "host" + volumes: + - ./coturn.conf:/etc/coturn/turnserver.conf +``` + +To understand why the host networking mode is used and explore alternative configuration options, please visit the following link: https://github.com/coturn/coturn/blob/master/docker/coturn/README.md. +For security recommendations see Synapse's [Coturn documentation](https://github.com/matrix-org/synapse/blob/develop/docs/setup/turn/coturn.md#configuration). + From 20924a44f1a5214df22f0547ce0e686f962ea649 Mon Sep 17 00:00:00 2001 From: Jonas Zohren Date: Thu, 10 Aug 2023 14:42:04 +0000 Subject: [PATCH 2/2] Suggestion on how to generate a secure key --- docker/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/README.md b/docker/README.md index 4ed70837..dccdc35f 100644 --- a/docker/README.md +++ b/docker/README.md @@ -155,6 +155,8 @@ use-auth-secret static-auth-secret= realm= ``` +A common way to generate a suitable alphanumeric secret key is by using `pwgen -s 64 1`. + These same values need to be set in conduit. You can either modify conduit.toml to include these lines: ``` turn_uris = ["turn:?transport=udp", "turn:?transport=tcp"]