5.3.2 #29

Merged
Ark74 merged 2 commits from unstable into master 2021-01-28 17:56:06 +00:00
1 changed files with 45 additions and 47 deletions

View File

@ -249,17 +249,19 @@ else
JITSI_REPO="stable" JITSI_REPO="stable"
fi fi
#Default to LE SSL? #Default to LE SSL?
while [[ $LE_SSL != yes && $LE_SSL != no ]] while [[ "$LE_SSL" != "yes" && "$LE_SSL" != "no" ]]
do do
read -p "> Do you plan to use Let's Encrypt SSL certs?: (yes or no)"$'\n' -r LE_SSL read -p "> Do you plan to use Let's Encrypt SSL certs?: (yes or no)"$'\n' -r LE_SSL
if [ $LE_SSL = yes ]; then if [ $LE_SSL = yes ]; then
echo "We'll defaul to Let's Encrypt SSL certs." echo "We'll defaul to Let's Encrypt SSL certs."
else else
echo "We'll let you choose later on for it." echo "We'll let you choose later on for it.
Please be aware that a valid SSL cert is required for some features to work properly."
fi fi
done done
#Set domain #Set domain
while [[ $ANS_JD != yes ]] if [ "$LE_SSL" = "yes" ]; then
while [[ "$ANS_JD" != "yes" ]]
do do
read -p "> Please set your domain (or subdmain) here: (e.g.: jitsi.domain.com)"$'\n' -r JITSI_DOMAIN read -p "> Please set your domain (or subdmain) here: (e.g.: jitsi.domain.com)"$'\n' -r JITSI_DOMAIN
read -p "> Did you mean?: $JITSI_DOMAIN (yes or no)"$'\n' -r ANS_JD read -p "> Did you mean?: $JITSI_DOMAIN (yes or no)"$'\n' -r ANS_JD
@ -269,6 +271,7 @@ else
echo "Please try again." echo "Please try again."
fi fi
done done
#Simple DNS test #Simple DNS test
if [ "$PUBLIC_IP" = "$(dig -4 +short $JITSI_DOMAIN)" ]; then if [ "$PUBLIC_IP" = "$(dig -4 +short $JITSI_DOMAIN)" ]; then
echo "Server public IP & DNS record for $JITSI_DOMAIN seems to match, continuing... echo "Server public IP & DNS record for $JITSI_DOMAIN seems to match, continuing...
@ -279,8 +282,9 @@ echo "Please check your dns records are applied and updated. Exiting for now...
" "
exit exit
fi fi
fi
# Requirements # Requirements
echo "We'll start by installing system requirements this may take a while please be patient..." echo -e "\nWe'll start by installing system requirements this may take a while please be patient...\n"
apt-get update -q2 apt-get update -q2
apt-get dist-upgrade -yq2 apt-get dist-upgrade -yq2
@ -292,13 +296,17 @@ apt-get -y install \
git \ git \
htop \ htop \
jq \ jq \
letsencrypt \
net-tools \ net-tools \
rsync \ rsync \
ssh \ ssh \
unzip \ unzip \
wget wget
if [ "$LE_SSL" = "yes" ]; then
apt-get -y install \
letsencrypt
fi
echo "# Check and Install HWE kernel if possible..." echo "# Check and Install HWE kernel if possible..."
HWE_VIR_MOD=$(apt-cache madison linux-image-generic-hwe-$(lsb_release -sr) 2>/dev/null|head -n1|grep -c "hwe-$(lsb_release -sr)") HWE_VIR_MOD=$(apt-cache madison linux-image-generic-hwe-$(lsb_release -sr) 2>/dev/null|head -n1|grep -c "hwe-$(lsb_release -sr)")
if [ "$HWE_VIR_MOD" = "1" ]; then if [ "$HWE_VIR_MOD" = "1" ]; then
@ -319,8 +327,8 @@ echo "
" "
if [ "$LE_SSL" = "yes" ]; then if [ "$LE_SSL" = "yes" ]; then
echo "set jitsi-meet/cert-choice select Generate a new self-signed certificate (You will later get a chance to obtain a Let's encrypt certificate)" | debconf-set-selections echo "set jitsi-meet/cert-choice select Generate a new self-signed certificate (You will later get a chance to obtain a Let's encrypt certificate)" | debconf-set-selections
fi
echo "jitsi-videobridge2 jitsi-videobridge/jvb-hostname string $JITSI_DOMAIN" | debconf-set-selections echo "jitsi-videobridge2 jitsi-videobridge/jvb-hostname string $JITSI_DOMAIN" | debconf-set-selections
fi
apt-get -y install \ apt-get -y install \
jitsi-meet \ jitsi-meet \
jibri \ jibri \
@ -425,10 +433,12 @@ MJS_USER_PASS="$(tr -dc "a-zA-Z0-9#_*=" < /dev/urandom | fold -w 32 | head -n1)"
#sed -i "1i ${PUBLIC_IP} jitsi.${DOMAIN}" /etc/hosts #sed -i "1i ${PUBLIC_IP} jitsi.${DOMAIN}" /etc/hosts
#Sysadmin email #Sysadmin email
if [ "$LE_SSL" = "yes" ]; then
while [[ -z $SYSADMIN_EMAIL ]] while [[ -z $SYSADMIN_EMAIL ]]
do do
read -p "Set sysadmin email (this is a mandatory field):"$'\n' -r SYSADMIN_EMAIL read -p "Set sysadmin email (this is a mandatory field):"$'\n' -r SYSADMIN_EMAIL
done done
fi
#Language #Language
echo "## Setting up Jitsi Meet language ## echo "## Setting up Jitsi Meet language ##
You can define the language, for a complete list of the supported languages You can define the language, for a complete list of the supported languages
@ -459,20 +469,6 @@ elif [ "$DROP_TLS1" = "yes" ]; then
echo "TLSv1.0/1.1 will be dropped" echo "TLSv1.0/1.1 will be dropped"
fi fi
done done
#SSL LE
if [ "$LE_SSL" = "yes" ]; then
ENABLE_SSL=yes
else
while [[ "$ENABLE_SSL" != "yes" && "$ENABLE_SSL" != "no" ]]
do
read -p "> Do you want to setup LetsEncrypt with your domain: (yes or no)"$'\n' -r ENABLE_SSL
if [ "$ENABLE_SSL" = "no" ]; then
echo "Please run letsencrypt.sh manually post-installation."
else
echo "SSL will be enabled."
fi
done
fi
#Dropbox -- no longer requirement for localrecording #Dropbox -- no longer requirement for localrecording
#while [[ $ENABLE_DB != yes && $ENABLE_DB != no ]] #while [[ $ENABLE_DB != yes && $ENABLE_DB != no ]]
#do #do
@ -627,6 +623,7 @@ INT_CONF_ETC="/etc/jitsi/meet/$DOMAIN-interface_config.js"
WAN_IP=$(dig +short myip.opendns.com @resolver1.opendns.com) WAN_IP=$(dig +short myip.opendns.com @resolver1.opendns.com)
ssl_wa() { ssl_wa() {
if [ "$LE_SSL" = "yes" ]; then
systemctl stop $1 systemctl stop $1
letsencrypt certonly --standalone --renew-by-default --agree-tos --email $5 -d $6 letsencrypt certonly --standalone --renew-by-default --agree-tos --email $5 -d $6
sed -i "s|/etc/jitsi/meet/$3.crt|/etc/letsencrypt/live/$3/fullchain.pem|" $4 sed -i "s|/etc/jitsi/meet/$3.crt|/etc/letsencrypt/live/$3/fullchain.pem|" $4
@ -635,10 +632,11 @@ systemctl restart $1
#Add cron #Add cron
crontab -l | { cat; echo "@weekly certbot renew --${2} > $LE_RENEW_LOG 2>&1"; } | crontab - crontab -l | { cat; echo "@weekly certbot renew --${2} > $LE_RENEW_LOG 2>&1"; } | crontab -
crontab -l crontab -l
fi
} }
enable_letsencrypt() { enable_letsencrypt() {
if [ "$ENABLE_SSL" = "yes" ]; then if [ "$LE_SSL" = "yes" ]; then
echo ' echo '
#-------------------------------------------------- #--------------------------------------------------
# Starting LetsEncrypt configuration # Starting LetsEncrypt configuration