Skip to content

Commit

Permalink
debian: updates let's encrypt and coturn scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Apr 7, 2020
1 parent 96a048e commit 379c0f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
7 changes: 7 additions & 0 deletions doc/debian/jitsi-meet-turn/coturn-certbot-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -e

COTURN_CERT_DIR="/etc/coturn/certs"
TURN_CONFIG="/etc/turnserver.conf"

# create a directory to store certs if it does not exists
if [ ! -d "$COTURN_CERT_DIR" ]; then
Expand All @@ -29,6 +30,12 @@ for domain in $RENEWED_DOMAINS; do
chmod 400 "$COTURN_CERT_DIR/$domain.fullchain.pem" \
"$COTURN_CERT_DIR/$domain.privkey.pem"

if [ -f $TURN_CONFIG ] && grep -q "jitsi-meet coturn config" "$TURN_CONFIG" ; then
echo "Configuring turnserver"
sed -i "/^cert/c\cert=\/etc\/coturn\/certs\/$DOMAIN.fullchain.pem" $TURN_CONFIG
sed -i "/^pkey/c\pkey=\/etc\/coturn\/certs\/$DOMAIN.privkey.pem" $TURN_CONFIG
fi
service coturn restart
;;
esac
done
Expand Down
15 changes: 4 additions & 11 deletions resources/install-letsencrypt-cert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ CERT_CRT="/etc/letsencrypt/live/$DOMAIN/fullchain.pem"
if [ -f /etc/nginx/sites-enabled/$DOMAIN.conf ] ; then

TURN_CONFIG="/etc/turnserver.conf"
TURN_HOOK=/etc/letsencrypt/renewal-hooks/deploy/0000-coturn-certbot-deploy.sh
if [ -f $TURN_CONFIG ] && grep -q "jitsi-meet coturn config" "$TURN_CONFIG" ; then
TURN_HOOK=/etc/letsencrypt/renewal-hooks/deploy/0000-coturn-certbot-deploy.sh
mkdir -p $(dirname $TURN_HOOK)

cp /usr/share/jitsi-meet-turnserver/coturn-certbot-deploy.sh $TURN_HOOK
chmod u+x $TURN_HOOK
Expand All @@ -54,7 +55,8 @@ if [ -f /etc/nginx/sites-enabled/$DOMAIN.conf ] ; then
./certbot-auto certonly --noninteractive \
--webroot --webroot-path /usr/share/jitsi-meet \
-d $DOMAIN \
--agree-tos --email $EMAIL
--agree-tos --email $EMAIL \
--deploy-hook $TURN_HOOK

echo "Configuring nginx"

Expand All @@ -70,15 +72,6 @@ if [ -f /etc/nginx/sites-enabled/$DOMAIN.conf ] ; then

echo "service nginx reload" >> $CRON_FILE
service nginx reload

if [ -f $TURN_CONFIG ] && grep -q "jitsi-meet coturn config" "$TURN_CONFIG" ; then
echo "Configuring turnserver"
sed -i "/^cert/c\cert=\/etc\/coturn\/certs\/$DOMAIN.fullchain.pem" $TURN_CONFIG
sed -i "/^pkey/c\pkey=\/etc\/coturn\/certs\/$DOMAIN.privkey.pem" $TURN_CONFIG

echo "service coturn restart" >> $CRON_FILE
service coturn restart
fi
elif [ -f /etc/apache2/sites-enabled/$DOMAIN.conf ] ; then

./certbot-auto certonly --noninteractive \
Expand Down

0 comments on commit 379c0f6

Please sign in to comment.