Begin entrypoint rewrite

This commit is contained in:
Nico Schottelius 2021-07-17 17:17:56 +02:00
parent b651b6af2a
commit 510028c209
1 changed files with 19 additions and 9 deletions

View File

@ -11,13 +11,23 @@ else
STAGING="--staging" STAGING="--staging"
fi fi
certbot certonly --agree-tos --cert-name "${DOMAIN}" \ # Try to get a certificate, accept failures
--email "$EMAIL" --expand --non-interactive \ while [ ! -f /etc/letsencrypt/live/${DOMAIN}/fullchain.pem ]; do
--domain "$DOMAIN" --standalone $STAGING certbot certonly --agree-tos --cert-name "${DOMAIN}" \
--email "$EMAIL" --expand --non-interactive \
--domain "$DOMAIN" --standalone $STAGING
sleep 60
# Correct permissions for multi user container/pod deployments # Correct permissions for multi user container/pod deployments
# if not indicated otherwise # if not indicated otherwise
if [ -z "$LEAVE_PERMISSIONS_AS_IS" ]; then if [ -z "$LEAVE_PERMISSIONS_AS_IS" ]; then
find /etc/letsencrypt -type d -exec chmod 0755 {} \; find /etc/letsencrypt -type d -exec chmod 0755 {} \;
find /etc/letsencrypt -type f -exec chmod 0644 {} \; find /etc/letsencrypt -type f -exec chmod 0644 {} \;
fi fi
done
# Try to renew once per day
while true; do
/usr/bin/certbot renew
sleep 86400
done