[turn] create coturn for Task#12025
This commit is contained in:
		
					parent
					
						
							
								b4a47c8905
							
						
					
				
			
			
				commit
				
					
						c5dab64583
					
				
			
		
					 4 changed files with 104 additions and 0 deletions
				
			
		
							
								
								
									
										26
									
								
								coturn/README.md
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								coturn/README.md
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -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
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
							
								
								
									
										16
									
								
								coturn/coturn/turnserver.conf
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								coturn/coturn/turnserver.conf
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -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
 | 
				
			||||||
							
								
								
									
										21
									
								
								coturn/coturn/turnserver.conf.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										21
									
								
								coturn/coturn/turnserver.conf.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
					@ -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
 | 
				
			||||||
							
								
								
									
										41
									
								
								coturn/docker-compose.yaml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								coturn/docker-compose.yaml
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -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
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue