From f8734d15e9392d0f0232c825867361b1b119a951 Mon Sep 17 00:00:00 2001 From: cmstew Date: Mon, 31 Dec 2018 15:48:29 -0700 Subject: [PATCH] Update vst-install-ubuntu.sh - Added to help function for ssl - Added argument for enabling Let's Encrypt SSL - Added set_default_value 'ssl' 'no' - Install Let's Encrypt on hostname, update certificate, and enable auto-renew if 'ssl' argument is 'yes' --- install/vst-install-ubuntu.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh index e1ca1044a..dd526f331 100755 --- a/install/vst-install-ubuntu.sh +++ b/install/vst-install-ubuntu.sh @@ -61,6 +61,7 @@ help() { -l, --lang Default language default: en -y, --interactive Interactive install [yes|no] default: yes -s, --hostname Set hostname + -u, --ssl Add LE SSL for hostname [yes|no] default: no -e, --email Set admin email -p, --password Set admin password -f, --force Force installation @@ -149,6 +150,7 @@ for arg; do --lang) args="${args}-l " ;; --interactive) args="${args}-y " ;; --hostname) args="${args}-s " ;; + --ssl) args="${args}-u " ;; --email) args="${args}-e " ;; --password) args="${args}-p " ;; --force) args="${args}-f " ;; @@ -183,6 +185,7 @@ while getopts "a:n:w:v:j:k:m:g:d:x:z:c:t:i:b:r:o:q:l:y:s:e:p:fh" Option; do l) lang=$OPTARG ;; # Language y) interactive=$OPTARG ;; # Interactive install s) servername=$OPTARG ;; # Hostname + u) ssl=$OPTARG ;; # Add Let's Encrypt SSL for hostname e) email=$OPTARG ;; # Admin email p) vpass=$OPTARG ;; # Admin password f) force='yes' ;; # Force install @@ -215,6 +218,7 @@ set_default_value 'fail2ban' 'yes' set_default_value 'softaculous' 'yes' set_default_value 'quota' 'no' set_default_value 'interactive' 'yes' +set_default_value 'ssl' 'no' set_default_lang 'en' # Checking software conflicts @@ -1299,6 +1303,13 @@ $VESTA/upd/add_notifications.sh # Adding cronjob for autoupdates $VESTA/bin/v-add-cron-vesta-autoupdate +# Add Let's Encrypt SSL for hostname and enable auto-renew +if [ "$ssl" = 'yes' ]; then + $VESTA/bin/v-add-letsencrypt-domain 'admin' $(hostname) '' 'yes' + $VESTA/bin/v-update-host-certificate admin $(hostname) + echo "UPDATE_HOSTNAME_SSL='yes'" >> $VESTA/conf/vesta.conf +fi + #----------------------------------------------------------# # Vesta Access Info #