From b372b2ccf233497524dcd7940a8b5602e37db0b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=8F=D0=BD=20=D0=9C=D0=B8=D0=BD=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Thu, 2 Apr 2020 18:20:41 -0500 Subject: [PATCH] Fix turn file link (#5601) * debian: Does not add a link of turnserver will not be configured. Fixes #5596. * debian: Partially reverts 990c77bd. * debian: Skip filename duplication, use variable. --- debian/jitsi-meet-turnserver.links | 1 - debian/jitsi-meet-turnserver.postinst | 15 ++++++++++++++- debian/jitsi-meet-turnserver.postrm | 3 +++ 3 files changed, 17 insertions(+), 2 deletions(-) delete mode 100644 debian/jitsi-meet-turnserver.links diff --git a/debian/jitsi-meet-turnserver.links b/debian/jitsi-meet-turnserver.links deleted file mode 100644 index 9518f96ac..000000000 --- a/debian/jitsi-meet-turnserver.links +++ /dev/null @@ -1 +0,0 @@ -/usr/share/jitsi-meet-turnserver/jitsi-meet.conf /etc/nginx/modules-enabled/60-jitsi-meet.conf diff --git a/debian/jitsi-meet-turnserver.postinst b/debian/jitsi-meet-turnserver.postinst index 1526f7333..07b442423 100644 --- a/debian/jitsi-meet-turnserver.postinst +++ b/debian/jitsi-meet-turnserver.postinst @@ -46,14 +46,22 @@ case "$1" in # check whether other enabled hosts has listen 443 if cat ${site} | grep -v "^[[:space:]]*#" | grep listen | grep -q "^.*[[:space:]:]443[;[:space:]].*" ; then # nothing to do + echo "------------------------------------------------" echo "" echo "turnserver not configured as other nginx sites use port 443" echo "" + echo "------------------------------------------------" db_stop exit 0 fi done + # if there was a turn config backup it so we can configure + # we cannot recognize at the moment is this a user config or default config when installing coturn + if [[ -f $TURN_CONFIG ]] && ! grep -q "jitsi-meet coturn config" "$TURN_CONFIG" ; then + mv $TURN_CONFIG $TURN_CONFIG.bak + fi + # detect dpkg-reconfigure, just delete old links db_get jitsi-meet-turnserver/jvb-hostname JVB_HOSTNAME_OLD=$RET @@ -67,17 +75,21 @@ case "$1" in db_get jitsi-meet/jvb-serve || true if [ ! -f $NGINX_CONFIG -o "$RET" = "true" ] ; then # nothing to do + echo "------------------------------------------------" echo "" echo "turnserver not configured as no nginx found to multiplex traffic" echo "" + echo "------------------------------------------------" db_stop exit 0 fi if [[ -f $TURN_CONFIG ]] ; then + echo "------------------------------------------------" echo "" echo "turnserver is already configured on this machine, skipping." echo "" + echo "------------------------------------------------" db_stop exit 0 fi @@ -130,7 +142,8 @@ case "$1" in invoke-rc.d coturn restart || true NGINX_STREAM_CONFIG="/etc/nginx/modules-enabled/60-jitsi-meet.conf" - if [ -f $NGINX_STREAM_CONFIG ] && [ -f $NGINX_CONFIG ] ; then + if [ ! -f $NGINX_STREAM_CONFIG ] && [ -f $NGINX_CONFIG ] ; then + ln -s /usr/share/jitsi-meet-turnserver/jitsi-meet.conf $NGINX_STREAM_CONFIG sed -i "s/listen 443 ssl/listen 4444 ssl http2/g" $NGINX_CONFIG sed -i "s/listen \[\:\:\]\:443 ssl/listen \[\:\:\]\:4444 ssl http2/g" $NGINX_CONFIG invoke-rc.d nginx reload || true diff --git a/debian/jitsi-meet-turnserver.postrm b/debian/jitsi-meet-turnserver.postrm index aad705a02..90ef72574 100644 --- a/debian/jitsi-meet-turnserver.postrm +++ b/debian/jitsi-meet-turnserver.postrm @@ -24,6 +24,7 @@ set -e case "$1" in remove) + rm -rf /etc/nginx/modules-enabled/60-jitsi-meet.conf if [ -x "/etc/init.d/nginx" ]; then invoke-rc.d nginx reload || true fi @@ -32,6 +33,8 @@ case "$1" in fi ;; purge) + rm -rf /etc/nginx/modules-enabled/60-jitsi-meet.conf + rm -rf /etc/turnserver.conf if [ -x "/etc/init.d/nginx" ]; then invoke-rc.d nginx reload || true fi