-
Notifications
You must be signed in to change notification settings - Fork 1.5k
turn: add TURN server #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from 1 commit
0d1baf8
854753f
6c6df2c
656d48b
5753213
cb8552a
d983578
e0e0d81
14d717c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,17 @@ admins = { "{{ .Env.JICOFO_AUTH_USER }}@{{ .Env.XMPP_AUTH_DOMAIN }}" } | |
| plugin_paths = { "/prosody-plugins/", "/prosody-plugins-custom" } | ||
| http_default_host = "{{ .Env.XMPP_DOMAIN }}" | ||
|
|
||
| {{ if or (.Env.TURN_ENABLE_P2P | default "0" | toBool) (.Env.TURN_ENABLE_JVB | default "0" | toBool) }} | ||
| turncredentials_secret = "{{ .Env.TURN_SECRET | default "keepthissecret" }}"; | ||
| turncredentials = { | ||
| { type = "{{ .Env.TURN_TYPE | default "turns" }}", | ||
| host = "{{ .Env.TURN_HOST | default "8.8.8.8" }}", | ||
netaskd marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| port = {{ .Env.TURN_PORT | default "3478" }}, | ||
| transport = "{{ .Env.TURN_TRANSPORT | default "tcp" }}" | ||
| } | ||
| } | ||
| {{ end }} | ||
|
|
||
|
||
| {{ $ENABLE_AUTH := .Env.ENABLE_AUTH | default "0" | toBool }} | ||
| {{ $AUTH_TYPE := .Env.AUTH_TYPE | default "internal" }} | ||
| {{ $JWT_ASAP_KEYSERVER := .Env.JWT_ASAP_KEYSERVER | default "" }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| version: '3' | ||
|
|
||
| services: | ||
netaskd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # coturn TURN server project | ||
| turn: | ||
| image: jitsi/turn | ||
saghul marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| restart: always | ||
| ports: | ||
| - '${TURN_PORT}:${TURN_PORT}/tcp' | ||
| - '${TURN_PORT}:${TURN_PORT}/udp' | ||
| - '${TURN_RTP_MIN}-${TURN_RTP_MAX}:${TURN_RTP_MIN}-${TURN_RTP_MAX}/udp' | ||
| - '${TURN_ADMIN_PORT}:${TURN_ADMIN_PORT}/tcp' | ||
| environment: | ||
| - TURN_SECRET | ||
| - TURN_REALM | ||
| - TURN_ADMIN_USER | ||
| - TURN_ADMIN_SECRET | ||
| - TURN_ADMIN_PORT | ||
| - TURN_TYPE | ||
| - TURN_HOST | ||
| - TURN_PORT | ||
| - TURN_TRANSPORT | ||
| - TURN_RTP_MIN | ||
| - TURN_RTP_MAX | ||
| networks: | ||
| meet.jitsi: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| ARG VERSION | ||
| FROM instrumentisto/coturn:${VERSION:-latest} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This has been deprecated: instrumentisto/coturn-docker-image@0a4a7f0 It is suggested to switch to the upstream image |
||
|
|
||
| RUN apk add --no-cache openssl | ||
|
|
||
| ADD ./rootfs/defaults/docker-entrypoint.sh /docker-entrypoint.sh | ||
|
|
||
| ENTRYPOINT ["/docker-entrypoint.sh"] | ||
netaskd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| EXPOSE 5349 8443 10000:11000/udp | ||
|
|
||
netaskd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| build: | ||
| docker build $(BUILD_ARGS) -t $(JITSI_REPO)/turn . | ||
|
|
||
| .PHONY: build | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| #!/bin/ash | ||
| # make certs if not exist | ||
| if [[ ! -f /etc/ssl/cert.crt || ! -f /etc/ssl/cert.key ]]; then | ||
netaskd marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 3650 -out certificate.pem -subj "/C=US/ST=NY/L=NY/O=IT/CN=${TURN_HOST}" | ||
| fi | ||
|
|
||
| # set coturn admin user | ||
| turnadmin -A -u ${TURN_ADMIN_USER:-admin} -p ${TURN_ADMIN_SECRET:-changeme} | ||
|
|
||
| # run coturn server with API auth method enabled. | ||
| turnserver -n \ | ||
| --verbose \ | ||
| --prod \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good spot! |
||
| --no-tlsv1 \ | ||
| --no-tlsv1_1 \ | ||
| --log-file=stdout \ | ||
| --listening-port=${TURN_PORT:-5349} \ | ||
| --tls-listening-port=${TURN_PORT:-5349} \ | ||
| --alt-listening-port=${TURN_PORT:-5349} \ | ||
| --alt-tls-listening-port=${TURN_PORT:-5349} \ | ||
| --cert=/etc/ssl/cert.crt \ | ||
netaskd marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --pkey=/etc/ssl/cert.key \ | ||
| --min-port=${TURN_RTP_MIN:-10000} \ | ||
| --max-port=${TURN_RTP_MAX:-11000} \ | ||
| --no-stun \ | ||
| --use-auth-secret \ | ||
| --static-auth-secret=${TURN_SECRET:-keepthissecret} \ | ||
| --no-multicast-peers \ | ||
| --realm=${TURN_REALM:-realm} \ | ||
| --external-ip=$(curl -4k https://icanhazip.com 2>/dev/null) \ | ||
saghul marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --relay-ip=$(hostname -i) \ | ||
netaskd marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --listening-ip=$(hostname -i) \ | ||
| --web-admin \ | ||
netaskd marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --web-admin-ip=$(hostname -i) \ | ||
| --web-admin-port=${TURN_ADMIN_PORT:-8443} \ | ||
| --no-cli \ | ||
| --cli-password=${TURN_ADMIN_SECRET:-changeme} | ||
netaskd marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change needs to be applied to https://github.com/jitsi/handbook/blob/master/docs/devops-guide/docker.md (cf: #601)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything I can do to support his PR towards being merged? I'd really like to vacate Zoom with all of its problems for Jitsi Meet...