79 lines
2.7 KiB
Bash
Executable File
79 lines
2.7 KiB
Bash
Executable File
#!bin/bash
|
|
|
|
# Activating Debug mode
|
|
echo "Press CTRL+C to proceed."
|
|
trap "pkill -f 'sleep 1h'" INT
|
|
trap "set +x ; sleep 1h ; set -x" DEBUG
|
|
|
|
clear
|
|
echo " ***********************************************"
|
|
echo " * *"
|
|
echo " * WELCOME TO THE CLUSTERMEET INSTALLER *"
|
|
echo " * powered by clusteres.com *"
|
|
echo " * *"
|
|
echo " ***********************************************"
|
|
echo " "
|
|
echo " "
|
|
echo " "
|
|
echo "Before executing this script, make sure to meet the following requisites:"
|
|
echo " 1. Properly configure HAProxy in OPNsense"
|
|
echo " 2. Replace favicon.ico, watermark.png, background.png for company ones"
|
|
echo " 3. "
|
|
echo " 4. "
|
|
echo ""
|
|
echo "Execute this script every time you run apt-get upgrade"
|
|
echo ""
|
|
read -r -p "Do you want to continue installing this Jitsi Meet server? Choose \"No\" to Cancel and Exit [y/N]: " response
|
|
case $response in
|
|
[yY][eE][sS]|[yY])
|
|
echo "Starting Jitsi Meet installation..."
|
|
;;
|
|
*)
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
# source the user data file containing the variables
|
|
source ~/ClusterMeetConfigurator/.env
|
|
|
|
# Update repos and install dependencies
|
|
apt update
|
|
apt install apt-transport-https
|
|
|
|
# Change the hostname
|
|
hostnamectl set-hostname $COMPANYSUBDOMAIN
|
|
|
|
# Add record to hosts file
|
|
echo "$PUBLICIP $COMPANYSUBDOMAIN.$COMPANYDOMAIN $COMPANYSUBDOMAIN" >> /etc/hosts
|
|
|
|
# Download jitsi repo and update
|
|
curl https://download.jitsi.org/jitsi-key.gpg.key | sudo sh -c 'gpg --dearmor > /usr/share/keyrings/jitsi-keyring.gpg'
|
|
echo 'deb [signed-by=/usr/share/keyrings/jitsi-keyring.gpg] https://download.jitsi.org stable/' | sudo tee /etc/apt/sources.list.d/jitsi-stable.list > /dev/null
|
|
apt update
|
|
|
|
# Install jitsi meet
|
|
apt install jitsi-meet
|
|
|
|
# Add SSL certificates from letsencrypt
|
|
/usr/share/jitsi-meet/scripts/install-letsencrypt-cert.sh
|
|
|
|
# Adapting config to work properly behind NAT
|
|
echo "org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS=$LOCALIP
|
|
org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS=$PUBLICIP" >> /etc/jitsi/videobridge/sip-communicator.properties
|
|
sed -i 's/org.ice4j.ice.harvest.STUN_MAPPING_HARVESTER_ADDRESSES/#org.ice4j.ice.harvest.STUN_MAPPING_HARVESTER_ADDRESSES/g' /etc/jitsi/videobridge/sip-communicator.properties
|
|
rm -rf /etc/nginx/modules-enabled/60-jitsi-meet.conf
|
|
sed -i "s/4444/443/g" >> "/etc/nginx/sites-available/$COMPANYSUBDOMAIN.$COMPANYDOMAIN.conf"
|
|
|
|
read -r -p "Do you want to customize this Jitsi Meet server? Choose \"No\" to Cancel and Exit [y/N]: " response
|
|
case $response in
|
|
[yY][eE][sS]|[yY])
|
|
echo "Starting Jitsi Customization..."
|
|
/bin/bash ~/ClusterMeetConfigurator/configure.sh
|
|
;;
|
|
*)
|
|
echo "Bye"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|