From 99b7f7e05b230fbac1b6d714412ef2a426f56cfc Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 4 Apr 2021 22:17:13 +0100 Subject: [PATCH] Add certbot set up to bootstrap --- bootstrap.sh | 23 ++++++++++++++++++++++- certbot/certbot.service | 6 ++++++ certbot/certbot.timer | 10 ++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 certbot/certbot.service create mode 100644 certbot/certbot.timer diff --git a/bootstrap.sh b/bootstrap.sh index 70501f8..536b832 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -13,7 +13,7 @@ passwd -l root # Install necessary packages echo "------- Installing packages -------" -pacman -S --needed --noconfirm sudo wget tmux htop vim docker docker-compose git ufw +pacman -S --needed --noconfirm sudo wget tmux htop vim docker docker-compose git ufw certbot certbot-dns-digitalocean echo "------- Setting up SSH -------" # Remove old SSH keys in case running again @@ -52,6 +52,27 @@ chmod +x /app/gitea/gitea chown -R git /app/gitea/gitea chown -R git /var/lib/gitea +if [ $APP_ENV = "production" ] +then + echo "------- Enabling certbot service -------" + mkdir -p /root/.secret/certbot + tee /root/.secret/certbot/digitalocean.ini <