-  Set jibri resolution from installer
This commit is contained in:
Luis Guzman 2021-06-28 04:57:54 -05:00 committed by GitHub
commit 1b5f990c59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 65 additions and 7 deletions

View File

@ -44,10 +44,10 @@ JB_AUTH_PASS=TBD
JB_REC_PASS=TBD JB_REC_PASS=TBD
MJS_USER=TBD MJS_USER=TBD
MJS_USER_PASS=TBD MJS_USER_PASS=TBD
JIBRI_RES_CONF=TBD
JIBRI_RES_XORG_CONF=TBD
THIS_SRV_DIST=$(lsb_release -sc) THIS_SRV_DIST=$(lsb_release -sc)
JITSI_REPO=$(apt-cache policy | awk '/jitsi/&&/stable/{print$3}' | awk -F / 'NR==1{print$1}') JITSI_REPO=$(apt-cache policy | awk '/jitsi/&&/stable/{print$3}' | awk -F / 'NR==1{print$1}')
START=0
LAST=TBD
JIBRI_CONF="/etc/jitsi/jibri/jibri.conf" 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"
@ -63,6 +63,7 @@ GITHUB_RAW="https://raw.githubusercontent.com"
GIT_REPO="switnet-ltd/quick-jibri-installer" GIT_REPO="switnet-ltd/quick-jibri-installer"
TEST_JIBRI_ENV="$GITHUB_RAW/$GIT_REPO/unstable/tools/test-jibri-env.sh" TEST_JIBRI_ENV="$GITHUB_RAW/$GIT_REPO/unstable/tools/test-jibri-env.sh"
SHORT_ID="$(awk '{print substr($0,0,7)}' /etc/machine-id)" SHORT_ID="$(awk '{print substr($0,0,7)}' /etc/machine-id)"
JIBRI_XORG_CONF="/etc/jitsi/jibri/xorg-video-dummy.conf"
### 1_VAR_DEF ### 1_VAR_DEF
# sed limiters for add-jibri-node.sh variables # sed limiters for add-jibri-node.sh variables
@ -96,7 +97,9 @@ JMS_DATA=($MAIN_SRV_DIST \
$JB_AUTH_PASS \ $JB_AUTH_PASS \
$JB_REC_PASS \ $JB_REC_PASS \
$MJS_USER \ $MJS_USER \
$MJS_USER_PASS) $MJS_USER_PASS \
$JIBRI_RES_CONF \
$JIBRI_RES_XORG_CONF)
JMS_EVAL=${JMS_DATA[0]} JMS_EVAL=${JMS_DATA[0]}
for i in "${JMS_DATA[@]}"; do for i in "${JMS_DATA[@]}"; do
@ -124,6 +127,8 @@ check_var JB_AUTH_PASS "$JB_AUTH_PASS"
check_var JB_REC_PASS "$JB_REC_PASS" check_var JB_REC_PASS "$JB_REC_PASS"
check_var MJS_USER "$MJS_USER" check_var MJS_USER "$MJS_USER"
check_var MJS_USER_PASS "$MJS_USER_PASS" check_var MJS_USER_PASS "$MJS_USER_PASS"
check_var JIBRI_RES_CONF "$JIBRI_RES_CONF"
check_var JIBRI_RES_XORG_CONF "$JIBRI_RES_XORG_CONF"
#Check server and node OS #Check server and node OS
if [ ! "$THIS_SRV_DIST" = "$MAIN_SRV_DIST" ]; then if [ ! "$THIS_SRV_DIST" = "$MAIN_SRV_DIST" ]; then
@ -354,7 +359,7 @@ jibri {
] ]
} }
ffmpeg { ffmpeg {
resolution = "1920x1080" resolution = "$JIBRI_RES_CONF"
} }
chrome { chrome {
// The flags which will be passed to chromium when launching // The flags which will be passed to chromium when launching
@ -453,6 +458,9 @@ jibri {
} }
NEW_CONF NEW_CONF
#Jibri xorg resolution
sed -i "s|[[:space:]]Virtual .*|Virtual $JIBRI_RES_XORG_CONF|" $JIBRI_XORG_CONF
echo -e "\n---- Create random nodesync user ----" echo -e "\n---- Create random nodesync user ----"
useradd -m -g jibri $NJN_USER useradd -m -g jibri $NJN_USER
echo "$NJN_USER:$NJN_USER_PASS" | chpasswd echo "$NJN_USER:$NJN_USER_PASS" | chpasswd

View File

@ -250,7 +250,8 @@ So you can add a Jibri server on a instance with enough resources.\n"
fi fi
#Check system oriented porpuse #Check system oriented porpuse
echo "Checking system oriented purpose...." echo "Checking system oriented purpose....
"
apt-get -yq2 update apt-get -yq2 update
SYSTEM_DE="$(apt-cache search "ubuntu-(desktop|mate-desktop)"|awk '{print$1}'|xargs|sed 's|$| trisquel triskel trisquel-mini|')" SYSTEM_DE="$(apt-cache search "ubuntu-(desktop|mate-desktop)"|awk '{print$1}'|xargs|sed 's|$| trisquel triskel trisquel-mini|')"
SYSTEM_DE_ARRAY=( $SYSTEM_DE ) SYSTEM_DE_ARRAY=( $SYSTEM_DE )
@ -262,7 +263,7 @@ do
This is an unsupported use, as it will likely BREAK YOUR SYSTEM, so please don't." This is an unsupported use, as it will likely BREAK YOUR SYSTEM, so please don't."
exit exit
else else
echo -e "\n > No standard desktop environment for user oriented porpuse detected, continuing..." echo -e " > No standard desktop environment '$de' for user oriented porpuse detected, continuing...\n"
fi fi
done done
@ -471,6 +472,7 @@ MJS_RAND_TAIL="$(tr -dc "a-zA-Z0-9" < /dev/urandom | fold -w 4 | head -n1)"
MJS_USER="jbsync_$MJS_RAND_TAIL" MJS_USER="jbsync_$MJS_RAND_TAIL"
MJS_USER_PASS="$(tr -dc "a-zA-Z0-9#_*=" < /dev/urandom | fold -w 32 | head -n1)" MJS_USER_PASS="$(tr -dc "a-zA-Z0-9#_*=" < /dev/urandom | fold -w 32 | head -n1)"
FQDN_HOST="fqdn" FQDN_HOST="fqdn"
JIBRI_XORG_CONF="/etc/jitsi/jibri/xorg-video-dummy.conf"
# Rename hostname for jitsi server # Rename hostname for jitsi server
while [[ "$FQDN_HOST" != "yes" && "$FQDN_HOST" != "no" && ! -z "$FQDN_HOST" ]] while [[ "$FQDN_HOST" != "yes" && "$FQDN_HOST" != "no" && ! -z "$FQDN_HOST" ]]
@ -573,6 +575,7 @@ do
fi fi
done done
# Set authentication method
echo " echo "
> Jitsi Meet Auth Method selection. > Jitsi Meet Auth Method selection.
" "
@ -599,6 +602,39 @@ do
esac esac
done done
# Set jibris default resolution
echo "
> What jibri resolution should be the default for this and all the following jibri nodes?
"
PS3='The more resolution the more resources jibri will require to record properly: '
jib_res=("HD 720" "FHD 1080")
select res in "${jib_res[@]}"
do
case $res in
"HD 720")
echo -e "\n > HD (1280x720) is good enough for most cases, and requires a moderate high hw requirements.\n"
JIBRI_RES="720"
break
;;
"FHD 1080")
echo -e "\n > Full HD (1920x1080) is the best resolution available, it also requires high hw requirements.\n"
JIBRI_RES="1080"
break
;;
*) echo "Invalid option «$REPLY», choose 1 or 2";;
esac
done
if [ "$JIBRI_RES" = "720" ]; then
JIBRI_RES_CONF="\"1280x720\""
JIBRI_RES_XORG_CONF="1280 720"
fi
if [ "$JIBRI_RES" = "1080" ]; then
JIBRI_RES_CONF="\"1920x1080\""
JIBRI_RES_XORG_CONF="1920 1080"
fi
#Jibri Records Access (JRA) via Nextcloud #Jibri Records Access (JRA) via Nextcloud
while [[ "$ENABLE_NC_ACCESS" != "yes" && "$ENABLE_NC_ACCESS" != "no" ]] while [[ "$ENABLE_NC_ACCESS" != "yes" && "$ENABLE_NC_ACCESS" != "no" ]]
do do
@ -848,7 +884,7 @@ jibri {
] ]
} }
ffmpeg { ffmpeg {
resolution = "1920x1080" resolution = $JIBRI_RES_CONF
} }
chrome { chrome {
// The flags which will be passed to chromium when launching // The flags which will be passed to chromium when launching
@ -946,6 +982,10 @@ jibri {
} }
} }
NEW_CONF NEW_CONF
#Jibri xorg resolution
sed -i "s|[[:space:]]Virtual .*|Virtual $JIBRI_RES_XORG_CONF|" $JIBRI_XORG_CONF
#Create receiver user #Create receiver user
useradd -m -g jibri $MJS_USER useradd -m -g jibri $MJS_USER
echo "$MJS_USER:$MJS_USER_PASS" | chpasswd echo "$MJS_USER:$MJS_USER_PASS" | chpasswd
@ -966,6 +1006,8 @@ sed -i "s|JB_AUTH_PASS=.*|JB_AUTH_PASS=\"$JB_AUTH_PASS\"|" add-jibri-node.sh
sed -i "s|JB_REC_PASS=.*|JB_REC_PASS=\"$JB_REC_PASS\"|" add-jibri-node.sh sed -i "s|JB_REC_PASS=.*|JB_REC_PASS=\"$JB_REC_PASS\"|" add-jibri-node.sh
sed -i "s|MJS_USER=.*|MJS_USER=\"$MJS_USER\"|" add-jibri-node.sh sed -i "s|MJS_USER=.*|MJS_USER=\"$MJS_USER\"|" add-jibri-node.sh
sed -i "s|MJS_USER_PASS=.*|MJS_USER_PASS=\"$MJS_USER_PASS\"|" add-jibri-node.sh sed -i "s|MJS_USER_PASS=.*|MJS_USER_PASS=\"$MJS_USER_PASS\"|" add-jibri-node.sh
sed -i "s|JIBRI_RES_CONF=.*|JIBRI_RES_CONF=\"$JIBRI_RES_CONF\"|" add-jibri-node.sh
sed -i "s|JIBRI_RES_XORG_CONF=.*|JIBRI_RES_XORG_CONF=\"$JIBRI_RES_XORG_CONF\"|" add-jibri-node.sh
sed -i "$(var_dlim 0_LAST),$(var_dlim 1_LAST){s|LETS: .*|LETS: $(date -R)|}" add-jibri-node.sh sed -i "$(var_dlim 0_LAST),$(var_dlim 1_LAST){s|LETS: .*|LETS: $(date -R)|}" add-jibri-node.sh
echo "Last file edition at: $(grep "LETS:" add-jibri-node.sh|head -n1|awk -F'LETS:' '{print$2}')" echo "Last file edition at: $(grep "LETS:" add-jibri-node.sh|head -n1|awk -F'LETS:' '{print$2}')"

View File

@ -51,6 +51,7 @@ echo -e '
\n' \n'
SYNC_USER="$(ls /home|awk '/jbsync/{print}')" SYNC_USER="$(ls /home|awk '/jbsync/{print}')"
DOMAIN="$(ls /etc/prosody/conf.d/ | awk -F'.cfg' '!/localhost/{print $1}' | awk '!NF || !seen[$0]++')"
echo "We are about to remove and clean all the jitsi-meet platform bits and pieces... echo "We are about to remove and clean all the jitsi-meet platform bits and pieces...
Please make sure you have backed up anything you don't want to loose." Please make sure you have backed up anything you don't want to loose."
@ -95,6 +96,10 @@ apt-get -y purge jibri \
jitsi-videobridge2 \ jitsi-videobridge2 \
prosody prosody
#Chome related packages
apt-get -y purge google-chrome-stable
rm /usr/local/bin/chromedriver
#Services stop #Services stop
remove_services jibri remove_services jibri
remove_services jibri-icewm remove_services jibri-icewm
@ -110,6 +115,9 @@ remove_residuals /opt/jitsi
remove_residuals /usr/share/jicofo remove_residuals /usr/share/jicofo
remove_residuals /usr/share/jitsi-* remove_residuals /usr/share/jitsi-*
#Clean /etc/hosts
sed -i "/$DOMAIN/d" /etc/hosts
#Purging debconf db #Purging debconf db
purge_debconf jicofo purge_debconf jicofo
purge_debconf jigasi purge_debconf jigasi