From 594ce0c67a698d6dc5f9a904dc9c4d0e266f3d0a Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 20 May 2025 14:48:26 -0500 Subject: [PATCH] Fixed acme.sh installation in userdata.sh --- infrastructure/userdata.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/infrastructure/userdata.sh b/infrastructure/userdata.sh index 46fd0fe..5266d3e 100644 --- a/infrastructure/userdata.sh +++ b/infrastructure/userdata.sh @@ -32,11 +32,14 @@ Restart=always WantedBy=multi-user.target EOF +# Ensure root has a crontab before installing acme.sh +crontab -u root -l >/dev/null 2>&1 || (echo "" | crontab -u root -) + # Install and configure acme.sh curl https://get.acme.sh | sh -s email=stefano@fiorinis.com # Configure acme.sh to use DNS API for FreeDNS -. "/root/.acme.sh/acme.sh.env" +. "/.acme.sh/acme.sh.env" acme.sh --issue --dns dns_freedns -d ${DOMAIN_NAME} -d *.${DOMAIN_NAME} sudo mkdir -p /etc/nginx/ssl acme.sh --install-cert -d ${DOMAIN_NAME} -d *.${DOMAIN_NAME} \