From e1b46fa8460c4d7d050f15507c11c59c20ca9f90 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Sat, 12 Dec 2020 12:58:45 -0600 Subject: [PATCH] Testing jwt setup --- mode/jwt.sh | 18 +++++++++++++----- quick_jibri_installer.sh | 22 +++++++++++----------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/mode/jwt.sh b/mode/jwt.sh index e45ab50..002332a 100644 --- a/mode/jwt.sh +++ b/mode/jwt.sh @@ -4,9 +4,14 @@ # GPLv3 or later. DOMAIN=$(ls /etc/prosody/conf.d/ | grep -v localhost | awk -F'.cfg' '{print $1}' | awk '!NF || !seen[$0]++') MEET_CONF="/etc/jitsi/meet/$DOMAIN-config.js" +JICOFO_SIP="/etc/jitsi/jicofo/sip-communicator.properties" +PROSODY_FILE="/etc/prosody/conf.d/$DOMAIN.cfg.lua" +PROSODY_SYS="/etc/prosody/prosody.cfg.lua" APP_ID="$(tr -dc "a-zA-Z0-9" < /dev/urandom | fold -w 16 | head -n1)" SECRET_APP="$(tr -dc "a-zA-Z0-9" < /dev/urandom | fold -w 64 | head -n1)" -echo $APP_ID && echo $SECRET_APP + +echo -e "\n$APP_ID" && \ +echo -e "$SECRET_APP\n" ## Required openssl for Focal 20.04 if [ "$(lsb_release -sc)" = "focal" ]; then @@ -33,12 +38,13 @@ echo "set jitsi-meet-tokens/appsecret password $SECRET_APP" | debconf-set-select apt-get install -y jitsi-meet-tokens #Setting up -sed -i "s|c2s_require_encryption = true|c2s_require_encryption = false|" /etc/prosody/prosody.cfg.lua -sed -i "/app_secret/a \ \ \ \ \ \ \ \ asap_accepted_issuers = { \"$APP_ID\" }" /etc/prosody/conf.d/$DOMAIN.cfg.lua -sed -i "/app_secret/a \ \ \ \ \ \ \ \ asap_accepted_audiences = { \"$APP_ID\" }" /etc/prosody/conf.d/$DOMAIN.cfg.lua - +sed -i "s|c2s_require_encryption = true|c2s_require_encryption = false|" $PROSODY_SYS +sed -i "/app_secret/a \ \ \ \ \ \ \ \ asap_accepted_issuers = { \"$APP_ID\" }" $PROSODY_FILE +sed -i "/app_secret/a \ \ \ \ \ \ \ \ asap_accepted_audiences = { \"$APP_ID\" }" $PROSODY_FILE #allow_empty_token = true +#Request auth +sed -i "s|#org.jitsi.jicofo.auth.URL=XMPP:|org.jitsi.jicofo.auth.URL=XMPP:|" $JICOFO_SIP sed -i "s|// anonymousdomain: 'guest.example.com'|anonymousdomain: \'guest.$DOMAIN\'|" $MEET_CONF echo -e "\nUse the following for your App (e.g. Rocket.Chat):\n" @@ -50,3 +56,5 @@ pyjwt3 --key="$SECRET_APP" \ sub="$DOMAIN" \ room="*" \ algorithm="HS256" + +read -n 1 -s -r -p "Press any key to continue..."$'\n' diff --git a/quick_jibri_installer.sh b/quick_jibri_installer.sh index b329f70..25a45f3 100644 --- a/quick_jibri_installer.sh +++ b/quick_jibri_installer.sh @@ -653,17 +653,6 @@ sed -i "/shard.HOSTNAME/s|localhost|$DOMAIN|" /etc/jitsi/videobridge/sip-communi # Configure Jibri if [ "$ENABLE_SC" = "yes" ]; then -## PROSODY -cat << REC-JIBRI >> $PROSODY_FILE - -VirtualHost "recorder.$DOMAIN" - modules_enabled = { - "ping"; - } - authentication = "internal_plain" - -REC-JIBRI - if [ ! -f $MOD_LIST_FILE ]; then echo -e "\n-> Adding external module to list prosody users...\n" curl -s $MOD_LISTU > $MOD_LIST_FILE @@ -674,6 +663,17 @@ REC-JIBRI fi fi +#Enable jibri recording +cat << REC-JIBRI >> $PROSODY_FILE + +VirtualHost "recorder.$DOMAIN" + modules_enabled = { + "ping"; + } + authentication = "internal_plain" + +REC-JIBRI + #Enable Jibri withelist sed -i "s| -- muc_lobby_whitelist| muc_lobby_whitelist|" $PROSODY_FILE