diff --git a/coturn/README.md b/coturn/README.md new file mode 100644 index 0000000..8a27bf4 --- /dev/null +++ b/coturn/README.md @@ -0,0 +1,26 @@ +## Usage and Components + +Note: as of 2023-09-01 this docker-compose is available internally. + +### Versions + +* coturn: https://hub.docker.com/r/coturn/coturn/tags + +### HOSTNAME for turnserver + +* realm: on which domain for turn server + +### Sample usage + +Setting up turnserver.conf for coturn ... + +- set realm "fn.nf" +- set listenport 3487 +- set tlslistenport 5349 +- set min port 49152 +- set max port 65535 +- set static-auth-secret weqrdvfdsawerawefsdaf123#@#dsfaf132 + +``` +docker-compose up -d +``` diff --git a/coturn/coturn/turnserver.conf b/coturn/coturn/turnserver.conf new file mode 100644 index 0000000..c63e495 --- /dev/null +++ b/coturn/coturn/turnserver.conf @@ -0,0 +1,16 @@ +realm=turn.tws-matrix.ungleich.cloud +no-tcp-relay +listening-ip=0.0.0.0 +listening-port=3478 +tls-listening-port=5349 +min-port=49152 +max-port=65535 +log-file=stdout +verbose +pidfile=/var/tmp/turnserver.pid +#lt-cred-mech +use-auth-secret +static-auth-secret=iasdfsadfasdfasdfasdffsdfasdfsdfsdf +#user=$AUTHUSERNAME:$AUTHPW +pkey=/etc/ssl/private/privkey.pem +cert=/etc/ssl/certs/cert.pem diff --git a/coturn/coturn/turnserver.conf.sh b/coturn/coturn/turnserver.conf.sh new file mode 100755 index 0000000..32011df --- /dev/null +++ b/coturn/coturn/turnserver.conf.sh @@ -0,0 +1,21 @@ +#!/bin/sh + + +cat << EOF > /etc/turnserver.conf +realm=$HOSTNAME +no-tcp-relay +listening-ip=0.0.0.0 +listening-port=$LISTENPORT +tls-listening-port=$TLSPORT +min-port=$MINPORT +max-port=$MAXPORT +log-file=stdout +verbose +pidfile=/var/tmp/turnserver.pid +#lt-cred-mech +use-auth-secret +static-auth-secret=$AUTHSECRET +#user=$AUTHUSERNAME:$AUTHPW +pkey=/etc/ssl/private/privkey.pem +cert=/etc/ssl/certs/cert.pem +EOF diff --git a/coturn/docker-compose.yaml b/coturn/docker-compose.yaml new file mode 100644 index 0000000..e8077dc --- /dev/null +++ b/coturn/docker-compose.yaml @@ -0,0 +1,41 @@ +version: '3.8' +services: + coturn: + image: coturn/coturn:latest + restart: unless-stopped +# environment: +# - HOSTNAME=${hostname} +# - LISTENPORT=${listenport} +# - TLSPORT=${tlsport} +# - MINPORT=${minport} +# - MAXPORT=${maxport} +# - AUTHSECRET=${authsecret} +# ports: +## STUN/TURN +# - "3478:3478" +# - "3478:3478/udp" +# - "3479:3479" +# - "3479:3479/udp" +# - "80:80" +# - "80:80/udp" +## STUN/TURN SSL +# - "5349:5349" +# - "5349:5349/udp" +# - "5350:5350" +# - "5350:5350/udp" +# - "443:443" +# - "443:443/udp" +# - "49152-49252:49152-49252" +# - "49152-49252:49152-49252/udp" +# Relay Ports +# - "49152-65535:49152-65535" +# - "49152-65535:49152-65535/udp" + volumes: + - ./coturn/turnserver.conf:/etc/turnserver.conf + - ./coturn/privkey.pem:/etc/ssl/private/privkey.pem:ro + - ./coturn/cert.pem:/etc/ssl/certs/cert.pem:ro + network_mode: "host" +# command: sh -c "/etc/turnserver.conf.sh" +# entrypoint: sh -c "docker-entrypoint.sh && /etc/turnserver.conf.sh && chmod -R 777 /etc/turnsever.conf" +# depends_on: +# - nginx