web: always try to renew cert on container boot

acme.sh is smart enough to not send the request out unless it's necessary.
This commit is contained in:
Saúl Ibarra Corretgé
2021-04-01 14:03:32 +02:00
parent 73acbade59
commit d27336bece

View File

@@ -14,7 +14,7 @@ if [[ $DISABLE_HTTPS -ne 1 ]]; then
pushd /opt pushd /opt
sh ./acme.sh --install --home /config/acme.sh --accountemail $LETSENCRYPT_EMAIL sh ./acme.sh --install --home /config/acme.sh --accountemail $LETSENCRYPT_EMAIL
popd popd
if [[ ! -f /config/acme-certs/$LETSENCRYPT_DOMAIN/fullchain.pem ]]; then
STAGING="" STAGING=""
if [[ $LETSENCRYPT_USE_STAGING -eq 1 ]]; then if [[ $LETSENCRYPT_USE_STAGING -eq 1 ]]; then
STAGING="--staging" STAGING="--staging"
@@ -37,6 +37,7 @@ if [[ $DISABLE_HTTPS -ne 1 ]]; then
echo "Exiting." echo "Exiting."
exit 1 exit 1
fi fi
if [[ $rc -eq 0 ]]; then
mkdir -p /config/acme-certs/$LETSENCRYPT_DOMAIN mkdir -p /config/acme-certs/$LETSENCRYPT_DOMAIN
if ! /config/acme.sh/acme.sh \ if ! /config/acme.sh/acme.sh \
--install-cert -d $LETSENCRYPT_DOMAIN \ --install-cert -d $LETSENCRYPT_DOMAIN \