From a0f5891f7ebaef61c8ea362b4540d027f633849d Mon Sep 17 00:00:00 2001 From: Ivan Davydov Date: Sun, 23 Mar 2025 16:07:46 +0300 Subject: Big refactor TL;DR: this commit makes README.md more simple and makes scripts more complex. This commit makes scripts look (and behave) like scripts. That is, they now contain shebangs, `echo` lines to allow user to watch the installation process. The latter is now more configurable: user can customize the directory, where LibreTranslate will be installed, username, which will be used to run LibreTranslate and the domain name configuration is now contained in the .env file, which used for all other settings. --- get-cert.sh | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'get-cert.sh') diff --git a/get-cert.sh b/get-cert.sh index a5b9f81..ef9d3ed 100755 --- a/get-cert.sh +++ b/get-cert.sh @@ -1,7 +1,21 @@ -# Setup TLS with certbot and Let's Encrypt -# https://certbot.eff.org/ +#!/bin/sh -sudo apt install certbot python3-certbot-nginx -sudo certbot --nginx -sudo certbot renew --dry-run +if [ -f .env ]; then + . ./.env +else + . ./.env.example +fi +# --- + +echo 'Installing Certbot...' +apt-get install -y certbot python3-certbot-nginx + +if ![$LT_DOMAIN = "_" ]; then + certbot --nginx -d $LT_DOMAIN +else + echo 'Please set the $LT_DOMAIN variable in the .env file to your domain name.' + exit 1 +fi + +echo 'Done! Now you have SSL enabled on your LibreTranslate instance.' -- cgit v1.2.3