-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Coturn #667
Open
goacid
wants to merge
35
commits into
jitsi:master
Choose a base branch
from
goacid:coturn
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Coturn #667
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
424253b
turn: add TURN server
netaskd 463bf71
turn: the fist review changes
netaskd c6b12d6
turn: add forgotten variable TURN_ADMIN_ENABLE
netaskd e837f12
turn: the second review
netaskd c2b0d0a
base: add curl as necessary for getting mod_turncredentials.lua in pr…
netaskd 80208ba
release: stable-4857
saghul 8b9d238
misc: working on latest
saghul 7b08d32
prosody: add support for lobby
saghul 387a715
release: stable-4857
saghul 5be9470
misc: working on latest
saghul 1f40f2f
prosody: configure lobby on the guest domain is necessary
ChrisPortman 20e7104
jicofo: no auth URL in JWT auth mode
paweldomas 888e03d
release: stable-5076
saghul 4fad233
misc: working on latest
saghul d5de8c5
release: stable-4857
saghul 63ded20
misc: working on latest
saghul da80b37
release: stable-5076
saghul 441a987
misc: working on latest
saghul 2eb46ef
Fix after rebase
goacid a349d00
Turn : Add Letsencrypt support.
goacid c117521
Prosody : remove mod_credential
goacid 970f13c
etherpad: use official image and making skin full width
sapkra c3befc0
turn: add TURN server
netaskd 0edd80d
turn: the second review
netaskd f49a2b2
misc: working on latest
saghul 9b77048
release: stable-4857
saghul 0053163
misc: working on latest
saghul 3562942
release: stable-5076
saghul 902b7b7
misc: working on latest
saghul b325704
release: stable-4857
saghul 763c087
misc: working on latest
saghul 912bfe7
release: stable-5076
saghul 3504749
misc: working on latest
saghul dce2fa6
Turn : cleaning code
goacid 7a0116f
Change source image from official coturn image
goacid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version: '3' | ||
|
||
services: | ||
# coturn TURN server project | ||
turn: | ||
image: jitsi/turn | ||
restart: always | ||
volumes: | ||
- ${CONFIG}/turn:/config | ||
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' | ||
- '80:80' | ||
environment: | ||
- DOCKER_HOST_ADDRESS | ||
- TURN_SECRET | ||
- TURN_REALM | ||
- TURN_ADMIN_ENABLE | ||
- TURN_ADMIN_USER | ||
- TURN_ADMIN_SECRET | ||
- TURN_ADMIN_PORT | ||
- TURN_TYPE | ||
- TURN_HOST | ||
- TURN_PORT | ||
- TURN_TRANSPORT | ||
- TURN_RTP_MIN | ||
- TURN_RTP_MAX | ||
- DISABLE_HTTPS | ||
- ENABLE_LETSENCRYPT | ||
- LETSENCRYPT_DOMAIN | ||
- LETSENCRYPT_EMAIL | ||
networks: | ||
meet.jitsi: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ARG VERSION | ||
FROM coturn/coturn:${VERSION:-latest} | ||
|
||
RUN apk add --no-cache openssl | ||
RUN apk add --no-cache certbot | ||
RUN apk add --no-cache curl | ||
RUN apk add --no-cache bash | ||
|
||
ADD ./rootfs/defaults/docker-entrypoint.sh /docker-entrypoint.sh | ||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
|
||
VOLUME ["/config"] | ||
|
||
EXPOSE 80 5349 8443 10000:11000/udp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
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.
|
||
--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 \ | ||
--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) \ | ||
--relay-ip=$(hostname -i) \ | ||
--listening-ip=$(hostname -i) \ | ||
--web-admin \ | ||
--web-admin-ip=$(hostname -i) \ | ||
--web-admin-port=${TURN_ADMIN_PORT:-8443} \ | ||
--no-cli \ | ||
--cli-password=${TURN_ADMIN_SECRET:-changeme} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
certbot --no-self-upgrade -n renew >> /config/le-renew.log | ||
|
||
# Not sur it reload the service ... | ||
/bin/kill -HUP `cat /var/run/turnserver.pid 2>/dev/null` 2> /dev/null || true | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#!/bin/bash | ||
|
||
mkdir -p /config/keys | ||
# make certs if not exist | ||
# generate keys (maybe) | ||
if [[ $DISABLE_HTTPS -ne 1 ]]; then | ||
if [[ $ENABLE_LETSENCRYPT -eq 1 ]]; then | ||
if [[ ! -f /etc/letsencrypt/live/$LETSENCRYPT_DOMAIN/fullchain.pem ]]; then | ||
if ! certbot \ | ||
certonly \ | ||
--no-self-upgrade \ | ||
--noninteractive \ | ||
--standalone \ | ||
--preferred-challenges http \ | ||
-d $LETSENCRYPT_DOMAIN \ | ||
--agree-tos \ | ||
--email $LETSENCRYPT_EMAIL; then | ||
|
||
echo "Failed to obtain a certificate from the Let's Encrypt CA." | ||
# this tries to get the user's attention and to spare the | ||
# authority's rate limit: | ||
sleep 15 | ||
echo "Exiting." | ||
exit 1 | ||
else | ||
echo "Let's Encrypt certificate generated." | ||
cp -f /etc/letsencrypt/live/$LETSENCRYPT_DOMAIN/fullchain.pem /config/keys/cert.crt | ||
cp -f /etc/letsencrypt/live/$LETSENCRYPT_DOMAIN/privkey.pem /config/keys/cert.key | ||
fi | ||
fi | ||
|
||
# setup certbot renewal script | ||
if [[ ! -f /etc/periodic/weekly/letencrypt-renew ]]; then | ||
cp /defaults/letsencrypt-renew /etc/periodic/weekly/ | ||
fi | ||
else | ||
# use self-signed certs | ||
if [[ -f /config/keys/cert.key && -f /config/keys/cert.crt ]]; then | ||
echo "using keys found in /config/keys" | ||
else | ||
echo "generating self-signed keys in /config/keys, you can replace these with your own keys if required" | ||
SUBJECT="/C=US/ST=TX/L=Austin/O=jitsi.org/OU=Jitsi Server/CN=*" | ||
openssl req -new -x509 -days 3650 -nodes -out /config/keys/cert.crt -keyout /config/keys/cert.key -subj "$SUBJECT" | ||
fi | ||
fi | ||
fi | ||
|
||
# use non empty TURN_PUBLIC_IP variable, othervise set it dynamically. | ||
[ -z "${TURN_PUBLIC_IP}" ] && export TURN_PUBLIC_IP=$(curl -4ks https://icanhazip.com) | ||
[ -z "${TURN_PUBLIC_IP}" ] && echo "ERROR: variable TURN_PUBLIC_IP is not set and can not be set dynamically!" && kill 1 | ||
|
||
# set coturn web-admin access | ||
if [[ "${TURN_ADMIN_ENABLE}" == "1" || "${TURN_ADMIN_ENABLE}" == "true" ]]; then | ||
turnadmin -A -u ${TURN_ADMIN_USER:-admin} -p ${TURN_ADMIN_SECRET:-changeme} | ||
export TURN_ADMIN_OPTIONS="--web-admin --web-admin-ip=$(hostname -i) --web-admin-port=${TURN_ADMIN_PORT:-8443}" | ||
fi | ||
|
||
#run cron | ||
crond | ||
|
||
# run coturn server with API auth method enabled. | ||
turnserver -n ${TURN_ADMIN_OPTIONS} \ | ||
--verbose \ | ||
--prod \ | ||
--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=/config/keys/cert.crt \ | ||
--pkey=/config/keys/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} \ | ||
--listening-ip=$(hostname -i) \ | ||
--external-ip=${TURN_PUBLIC_IP} \ | ||
--cli-password=NotReallyCliUs3d \ | ||
--no-cli |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We can hard code the
443
port here if TLS / Let's Encrypt is enabled / used