summaryrefslogtreecommitdiff
path: root/roles/common/files/jitsi-letsencrypt.sh
diff options
context:
space:
mode:
authorAntoine Ouvrard <antoine.ouvrard@nereide.fr>2020-04-10 10:46:14 +0200
committerAntoine Ouvrard <antoine.ouvrard@nereide.fr>2020-04-10 10:46:14 +0200
commit9a186d1ed8cd947a98ffa8a804ddfe308944b53c (patch)
treee41ca6c8dfb084191a4b61743fbce68089692866 /roles/common/files/jitsi-letsencrypt.sh
parent3ffe65188cdc9e8a50169ac549decfd4fc35f728 (diff)
maj du script lets encrypt
Diffstat (limited to 'roles/common/files/jitsi-letsencrypt.sh')
-rw-r--r--roles/common/files/jitsi-letsencrypt.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/roles/common/files/jitsi-letsencrypt.sh b/roles/common/files/jitsi-letsencrypt.sh
index b97f92e..c05e089 100644
--- a/roles/common/files/jitsi-letsencrypt.sh
+++ b/roles/common/files/jitsi-letsencrypt.sh
@@ -30,6 +30,9 @@ if [ ! -f certbot-auto ] ; then
fi
CRON_FILE="/etc/cron.weekly/letsencrypt-renew"
+if [ ! -d "/etc/cron.weekly" ] ; then
+ mkdir "/etc/cron.weekly"
+fi
echo "#!/bin/bash" > $CRON_FILE
echo "/usr/local/sbin/certbot-auto renew >> /var/log/le-renew.log" >> $CRON_FILE
@@ -58,6 +61,15 @@ if [ -f /etc/nginx/sites-enabled/$DOMAIN.conf ] ; then
echo "service nginx reload" >> $CRON_FILE
service nginx reload
+ TURN_CONFIG="/etc/turnserver.conf"
+ if [ -f $TURN_CONFIG ] && grep -q "jitsi-meet coturn config" "$TURN_CONFIG" ; then
+ echo "Configuring turnserver"
+ sed -i "s/cert=\/etc\/jitsi\/meet\/.*crt/cert=$CERT_CRT_ESC/g" $TURN_CONFIG
+ sed -i "s/pkey=\/etc\/jitsi\/meet\/.*key/pkey=$CERT_KEY_ESC/g" $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 \
@@ -101,6 +113,3 @@ else
service jitsi-videobridge start
fi
-
-# the cron file that will renew certificates
-chmod a+x $CRON_FILE \ No newline at end of file