Upgrade jibri config

This commit is contained in:
Luis Guzmán 2020-10-01 02:10:53 -05:00
parent f8b58802f9
commit 8ea31cc974
1 changed files with 67 additions and 33 deletions

View File

@ -46,7 +46,7 @@ THIS_SRV_DIST=$(lsb_release -sc)
JITSI_REPO=$(apt-cache policy | grep http | grep jitsi | grep stable | awk '{print $3}' | head -n 1 | cut -d "/" -f1) JITSI_REPO=$(apt-cache policy | grep http | grep jitsi | grep stable | awk '{print $3}' | head -n 1 | cut -d "/" -f1)
START=0 START=0
LAST=TBD LAST=TBD
CONF_JSON="/etc/jitsi/jibri/config.json" JIBRI_CONF="/etc/jitsi/jibri/jibri.conf"
DIR_RECORD="/var/jbrecord" DIR_RECORD="/var/jbrecord"
REC_DIR="/home/jibri/finalize_recording.sh" REC_DIR="/home/jibri/finalize_recording.sh"
CHD_VER="$(curl -sL https://chromedriver.storage.googleapis.com/LATEST_RELEASE)" CHD_VER="$(curl -sL https://chromedriver.storage.googleapis.com/LATEST_RELEASE)"
@ -220,42 +220,76 @@ REC_DIR
chown jibri:jibri $REC_DIR chown jibri:jibri $REC_DIR
chmod +x $REC_DIR chmod +x $REC_DIR
## JSON Config ## New Jibri Config (2020)
cp $CONF_JSON ${CONF_JSON}.orig mv $JIBRI_CONF ${JIBRI_CONF}-dpkg-file
cat << NEW_CONF > $JIBRI_CONF
cat << CONF_JSON > $CONF_JSON // New XMPP environment config.
{ jibri {
"recording_directory":"$DIR_RECORD", recording {
"finalize_recording_script_path": "$REC_DIR", recordings-directory = $DIR_RECORD
"xmpp_environments": [ finalize-script = $REC_DIR
}
api {
xmpp {
environments = [
{ {
"name": "$JB_NAME", // A user-friendly name for this environment
"xmpp_server_hosts": [ name = "$JB_NAME"
"$MAIN_SRV_DOMAIN"
],
"xmpp_domain": "$MAIN_SRV_DOMAIN",
"control_login": {
"domain": "auth.$MAIN_SRV_DOMAIN",
"username": "jibri",
"password": "$JB_AUTH_PASS"
},
"control_muc": {
"domain": "internal.auth.$MAIN_SRV_DOMAIN",
"room_name": "$JibriBrewery",
"nickname": "Live-$ADDUP"
},
"call_login": {
"domain": "recorder.$MAIN_SRV_DOMAIN",
"username": "recorder",
"password": "$JB_REC_PASS"
},
"room_jid_domain_string_to_strip_from_start": "conference.", // A list of XMPP server hosts to which we'll connect
"usage_timeout": "0" xmpp-server-hosts = [ "$DOMAIN" ]
// The base XMPP domain
xmpp-domain = "$DOMAIN"
// The MUC we'll join to announce our presence for
// recording and streaming services
control-muc {
domain = "internal.auth.$DOMAIN"
room-name = "$JibriBrewery"
nickname = "Live"
}
// The login information for the control MUC
control-login {
domain = "auth.$DOMAIN"
username = "jibri"
password = "$JB_AUTH_PASS"
}
// An (optional) MUC configuration where we'll
// join to announce SIP gateway services
// sip-control-muc {
// domain = "domain"
// room-name = "room-name"
// nickname = "nickname"
// }
// The login information the selenium web client will use
call-login {
domain = "recorder.$DOMAIN"
username = "recorder"
password = "$JB_REC_PASS"
}
// The value we'll strip from the room JID domain to derive
// the call URL
strip-from-room-domain = "conference."
// How long Jibri sessions will be allowed to last before
// they are stopped. A value of 0 allows them to go on
// indefinitely
usage-timeout = 0 hour
// Whether or not we'll automatically trust any cert on
// this XMPP domain
trust-all-xmpp-certs = true
} }
] ]
}
}
} }
CONF_JSON NEW_CONF
echo "Writting last node number..." echo "Writting last node number..."
sed -i "$(var_dlim 0_VAR),$(var_dlim 1_VAR){s|LAST=.*|LAST=$ADDUP|}" add-jibri-node.sh sed -i "$(var_dlim 0_VAR),$(var_dlim 1_VAR){s|LAST=.*|LAST=$ADDUP|}" add-jibri-node.sh