From 3813b3b372d5dfd9e6a5b6c5ad403295ed322ad7 Mon Sep 17 00:00:00 2001 From: Vishnu Narayanan Date: Fri, 1 Apr 2022 00:34:50 +0530 Subject: [PATCH] feat: make linux script installation non-interactive (#4355) This PR changes the LetsEncrypt behaviour to be non-interactive. Earlier, the installation flow was waiting for user input at the SSL cert generation stage. With this change, once the user confirms completes the initial selection, the installation can be completed unattended. --- deployment/setup_20.04.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/deployment/setup_20.04.sh b/deployment/setup_20.04.sh index ca8b0a06a..14a0b74f6 100644 --- a/deployment/setup_20.04.sh +++ b/deployment/setup_20.04.sh @@ -2,7 +2,7 @@ # Description: Chatwoot installation script # OS: Ubuntu 20.04 LTS / Ubuntu 20.10 -# Script Version: 0.7 +# Script Version: 0.8 # Run this script as root read -p 'Would you like to configure a domain and SSL for Chatwoot?(yes or no): ' configure_webserver @@ -12,6 +12,7 @@ then read -p 'Enter your sub-domain to be used for Chatwoot (chatwoot.domain.com for example) : ' domain_name echo -e "\nThis script will try to generate SSL certificates via LetsEncrypt and serve chatwoot at "https://$domain_name". Proceed further once you have pointed your DNS to the IP of the instance.\n" +read -p 'Enter the email LetsEncrypt can use to send reminders when your SSL certificate is up for renewal: ' le_email read -p 'Do you wish to proceed? (yes or no): ' exit_true if [ $exit_true == "no" ] then @@ -138,7 +139,7 @@ else curl https://ssl-config.mozilla.org/ffdhe4096.txt >> /etc/ssl/dhparam wget https://raw.githubusercontent.com/chatwoot/chatwoot/develop/deployment/nginx_chatwoot.conf cp nginx_chatwoot.conf /etc/nginx/sites-available/nginx_chatwoot.conf -certbot certonly --nginx -d $domain_name +certbot certonly --non-interactive --agree-tos --nginx -m $le_email -d $domain_name sed -i "s/chatwoot.domain.com/$domain_name/g" /etc/nginx/sites-available/nginx_chatwoot.conf ln -s /etc/nginx/sites-available/nginx_chatwoot.conf /etc/nginx/sites-enabled/nginx_chatwoot.conf systemctl restart nginx