renames and tweaks

This commit is contained in:
Alex Graber 2021-02-15 20:09:01 -05:00
parent 09410f9285
commit 69350f9921
6 changed files with 12 additions and 5 deletions

View File

@ -7,4 +7,4 @@ echo
echo "<------------------------------------------------->"
echo "cronjob running on "$(date)
echo "Running certbot renew"
certbot renew --noninteractive --no-self-upgrade
certbot renew --non-interactive --no-self-upgrade

View File

@ -7,7 +7,11 @@
# new certificates and keys; the shell variable $RENEWED_DOMAINS will contain a space-delimited list
# of renewed certificate domains (for example, "example.com www.example.com" (default: None)
echo "Running deploy script ..."
KEYPATH="/letsencrypt"
echo "KEYPATH is ${KEYPATH}"
echo "LINEAGE is ${RENEWED_LINEAGE}"
# clean current KEYPATH contents
rm -f ${KEYPATH}/*

View File

@ -53,9 +53,9 @@ ln -s /config/crontabs /etc/crontabs
# Copy deploy hook defaults if needed
# [[ -z "$(ls -A /letsencrypt/renewal-hooks/deploy)" ]] && \
[[ ! -f /config/deploy/deploy-certs.sh ]] && \
[[ ! -f /config/deploy/01-deploy_certs.sh ]] && \
echo "Copying deploy hooks..." && \
cp -n /defaults/deploy/deploy-certs.sh /config/deploy/
cp -n /defaults/deploy/01-deploy_certs.sh /config/deploy/
chmod +x /config/deploy/*
# Link /config/deploy
echo "Linking /config/deploy -> /etc/letsencrypt/renewal-hooks/deploy ..."
@ -169,7 +169,10 @@ echo -e "ORIGTLD=\"${TLD}\" ORIGSUBDOMAINS=\"${SUBDOMAINS}\" ORIGONLY_SUBDOMAINS
if [ ! -f "/letsencrypt/fullchain.pem" ]; then
echo "Generating new certificate"
# shellcheck disable=SC2086
certbot certonly --renew-by-default --server ${ACMESERVER} ${PREFCHAL} --rsa-key-size 4096 ${EMAILPARAM} --agree-tos ${TLD_REAL}
certbot certonly --non-interactive --force-renewal --server ${ACMESERVER} ${PREFCHAL} --rsa-key-size 4096 ${EMAILPARAM} --agree-tos ${TLD_REAL}
echo $(printenv)
/usr/bin/with-contenv bash /etc/letsencrypt/renewal-hooks/deploy/01-deploy_certs.sh
if [ -f /letsencrypt/fullchain.pem ]; then
cd /letsencrypt || exit
else

View File

@ -10,6 +10,6 @@ if openssl x509 -in /letsencrypt/fullchain.pem -noout -checkend 86400 >/dev/null
echo "Letting the cron script handle the renewal attempts overnight (2:08am)."
else
echo "The cert is either expired or it expires within the next day. Attempting to renew. This could take up to 10 minutes."
/app/le-renew.sh
/app/le_renew.sh
sleep 1
fi