From 85f3a1e8167c894aebb7ec6c32c1361af608f039 Mon Sep 17 00:00:00 2001 From: Tony Benoy Date: Sun, 1 Mar 2020 16:35:25 +0530 Subject: [PATCH] testing certbot --- odoo_install.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/odoo_install.sh b/odoo_install.sh index 1cb34c2..ce98f85 100644 --- a/odoo_install.sh +++ b/odoo_install.sh @@ -38,6 +38,8 @@ OE_CONFIG="${OE_USER}-server" WEBSITE_NAME="_" # Set the default Odoo longpolling port (you still have to use -c /etc/odoo-server.conf for example to use this.) LONGPOLLING_PORT="8072" +# Set to "True" to install certbot and have ssl enabled, "False" to use http +ENABLE_SSL="True" ## ### WKHTMLTOPDF download links @@ -345,6 +347,22 @@ EOF else echo "Nginx isn't installed due to choice of the user!" fi + +#-------------------------------------------------- +# Enable ssl +#-------------------------------------------------- + +if [ $INSTALL_NGINX = "True" ] and [$ENABLE_SSL= "True" ]; + sudo add-apt-repository ppa:certbot/certbot && sudo apt-get update + sudo apt-get install python-certbot-nginx + sudo certbot --nginx -d $WEBSITE_NAME --noninteractive + echo "SSL is enabled!" + +else + echo "SSL isn't enabled due to choice of the user!" +fi + + echo -e "* Starting Odoo Service" sudo su root -c "/etc/init.d/$OE_CONFIG start" echo "-----------------------------------------------------------"