Skip to content

Commit

Permalink
Ready for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
LeKovr committed Jan 6, 2024
1 parent a33c4ea commit 36908f2
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 30 deletions.
21 changes: 17 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CFG ?= .env
CFG_BAK ?= $(CFG).bak

#- App name
APP_NAME ?= coturn
APP_NAME ?= turn

#- Docker image name
IMAGE ?= ghcr.io/coturn/coturn
Expand All @@ -19,7 +19,7 @@ IMAGE_VER ?= 4.6.2-alpine
APP_DOMAIN ?= dev.test

# Hostname for external access
APP_SITE ?= coturn.$(APP_DOMAIN)
APP_SITE ?= $(APP_DOMAIN)

#EXTERNAL_IP ?= $(shell docker run --rm $(IMAGE):$(IMAGE_VER) detect-external-ip)

Expand All @@ -36,6 +36,7 @@ MAX_PORT = 49200

USE_DB = yes
DB_INIT_SQL = schema.sql
USE_DCAPE_DC = no
# ------------------------------------------------------------------------------

# if exists - load old values
Expand Down Expand Up @@ -64,5 +65,17 @@ endif
ext-ip: CMD=exec app detect-external-ip
ext-ip: dc

cli: CMD=exec app bash
cli: dc
## Open CLI via telnet
cli:
@echo "Use pass: $(CLI_SECRET)"
@telnet 127.0.0.1 5766

PG_DSN := postgres://$(PGUSER):$(PGPASSWORD)@db/$(PGDATABASE)?sslmode=disable

## Add admin user
admin-add: CMD=exec app turnadmin -A -u admin -p "$(CLI_SECRET)" --psql-userdb="$(PG_DSN)"
admin-add: dc

## List admin users
admin-ls: CMD=exec app turnadmin -L --psql-userdb="$(PG_DSN)"
admin-ls: dc
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Based on [coturn-docker](https://github.com/m1rkwood/coturn-docker) repo.

## Notes

* Traefik [has no DTLS support](https://github.com/traefik/traefik/issues/6642)
* Traefik [has no DTLS support](https://github.com/traefik/traefik/issues/6642), we are not using Traefik to proxy anything for it

## Docker image used

Expand Down
61 changes: 36 additions & 25 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,61 @@
# custom app config
# overrides DCAPE/apps/drone/dcape-app/docker-compose.yml

version: '2'

services:
app:
image: ${IMAGE}:${IMAGE_VER}
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /etc/ssl/certs:/etc/ssl/certs:ro
- /opt/src/dopos/cert-exp/ssl:/ssl:ro # traefik acme.json exported
restart: unless-stopped
ports:
# - 3478:3478
# - 3478:3478/udp
# - 5349:5349
# - 5349:5349/udp
## STUN/TURN
- "3478:3478"
- "3478:3478/udp"
- "3479:3479"
- "3479:3479/udp"
## STUN/TURN SSL
- "5349:5349"
- "5349:5349/udp"
- "5350:5350"
- "5350:5350/udp"
- 7999:7999 # webadmin
- 127.0.0.1:5766:5766 # cli
# Relay Ports
- '${MIN_PORT}-${MAX_PORT}:${MIN_PORT}-${MAX_PORT}/udp'
- 127.0.0.1:5766:5766
command:
- -v
- --realm=${APP_SITE}
- --cert=/ssl/${APP_SITE}.crt
- --pkey=/ssl/${APP_SITE}.key
- --log-file=stdout
- --external-ip=$(detect-external-ip)
- --realm=${APP_SITE}
- --tcp-proxy-port=5555
- --fingerprint
- --listening-ip=0.0.0.0
# - '--external-ip=${EXTERNAL_IP}'
# - '--relay-ip=${EXTERNAL_IP}'
- --min-port=${MIN_PORT}
- --max-port=${MAX_PORT}
- --log-file=stdout
- --cli-ip=0.0.0.0
- --use-auth-secret
- --static-auth-secret=${STATIC_AUTH_SECRET}
- --cli-ip=0.0.0.0
- --cli-password=${CLI_SECRET}
- --cli-ip=0.0.0.0
- --web-admin
- --web-admin-listen-on-workers
- --no-tls
- --no-dtls
- --web-admin-ip=0.0.0.0
- --web-admin-port=7999
- --user-quota=12
- --total-quota=1200
- --no-tlsv1
- --no-tlsv1_1
- --no-tcp-relay
- --pidfile=/var/tmp/turnserver.pid
- -n
- --psql-userdb="host=db dbname=${PGDATABASE} user=${PGUSER} password=${PGPASSWORD} sslmode=disable"
# tmpfs:
# - /run:mode=770,size=1k,uid=200,gid=10000
# network_mode: host
labels:
- "traefik.http.services.app-${APP_TAG}.loadbalancer.server.port=5555"
- "traefik.http.services.app-${APP_TAG}.loadbalancer.proxyprotocol=2"

- --psql-userdb="postgres://${PGUSER}:${PGPASSWORD}@db/${PGDATABASE}?sslmode=disable"
environment:
- DETECT_EXTERNAL_IP=yes
- DETECT_RELAY_IP=yes

networks:
default:
name: ${DCAPE_NET}
external: true

0 comments on commit 36908f2

Please sign in to comment.