diff options
author | Ivan Davydov <lotigara@lotigara.ru> | 2025-03-23 16:07:46 +0300 |
---|---|---|
committer | Ivan Davydov <lotigara@lotigara.ru> | 2025-03-28 10:41:24 +0300 |
commit | a0f5891f7ebaef61c8ea362b4540d027f633849d (patch) | |
tree | 97571e7e46bf06af8d2f005ffbc54ca7a4aeb79d /get-cert.sh | |
parent | 553e884a45de6f67fb842dd281c662db1000cce3 (diff) |
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.
Diffstat (limited to 'get-cert.sh')
-rwxr-xr-x | get-cert.sh | 24 |
1 files changed, 19 insertions, 5 deletions
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.' |