From a5e84bed7173b19dbd324dde6ff8ba756a39736d Mon Sep 17 00:00:00 2001 From: M0VUB <76499782+ShaYmez@users.noreply.github.com> Date: Sat, 4 Dec 2021 23:23:27 +0000 Subject: [PATCH] Update xlxd-debian-installer.sh Add support for SSL Certbot (Debian 11) --- xlxd-debian-installer.sh | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/xlxd-debian-installer.sh b/xlxd-debian-installer.sh index 1dcf210..2bd7249 100755 --- a/xlxd-debian-installer.sh +++ b/xlxd-debian-installer.sh @@ -24,16 +24,16 @@ WEBDIR=/var/www/xlxd XLXINSTDIR=/root/reflector-install-files/xlxd DEP="git build-essential g++ apache2 php libapache2-mod-php php7.0-mbstring" DEP2="git build-essential g++ apache2 php libapache2-mod-php php7.3-mbstring" -DEP3="build-essential g++ apache2 php libapache2-mod-php php-curl php-json php-cgi" +DEP3="build-essential g++ apache2 php libapache2-mod-php php-curl php-json php-cgi snapd" VERSION=$(sed 's/\..*//' /etc/debian_version) clear echo "" -echo "XLX uses 3 digit numbers for its reflectors. For example: 032, 999, 099." +echo "XLX uses 3 digit numbers for its reflectors. For example: 248, 999, 099." read -p "What 3 digit XRF number will you be using? " XRFDIGIT XRFNUM=XLX$XRFDIGIT echo "" echo "--------------------------------------" -read -p "What is the FQDN of the XLX Reflector dashboard? Example: xlx.domain.com. " XLXDOMAIN +read -p "What is the FQDN of the XLX Reflector dashboard? Example: xlx999.domain.com. " XLXDOMAIN echo "" echo "--------------------------------------" read -p "What E-Mail address can your users send questions to? " EMAIL @@ -115,6 +115,24 @@ sed -i "s/ysf-xlxd/xlxd/g" /etc/apache2/sites-available/$XLXDOMAIN.conf chown -R www-data:www-data /var/www/xlxd/ chown -R www-data:www-data /xlxd/ a2ensite $XLXDOMAIN +systemctl restart apache2 +if [ $VERSION = 11 ] +then + snap install core + snap refresh core + snap install --classic certbot + ln -s /snap/bin/certbot /usr/bin/certbot + certbot --apache +else + echo "" + echo "Ahh! Somthing went wrong with the cerbot application, your SSL certificate" + echo "The output above is the only indication as to why it might have failed. " + echo "Run certbot --apache again to restart certbot installation" + echo "" + exit 0 +fi +ufw allow http +ufw allow https service xlxd start systemctl restart apache2 echo "------------------------------------------------------------------------------"