Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Let's Encrypt random sleep on renewal to be disabled #64

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,21 @@ function dockerPrune() {
--filter="label!=com.bitwarden.project=setup"
}

function preventLetsEncryptRandomSleepOnRenew() {
if [ -f "${OUTPUT_DIR}/config.yml" ] &&
grep -q -E "^lets_encrypt_no_random_sleep_on_renew: true" "${OUTPUT_DIR}/config.yml"
then
echo '--no-random-sleep-on-renew'
fi
}

function updateLetsEncrypt() {
if [ -d "${OUTPUT_DIR}/letsencrypt/live" ]
then
docker pull certbot/certbot
docker run -i --rm --name certbot -p 443:443 -p 80:80 \
-v $OUTPUT_DIR/letsencrypt:/etc/letsencrypt/ certbot/certbot \
renew --logs-dir /etc/letsencrypt/logs
renew ${preventLetsEncryptRandomSleepOnRenew} --logs-dir /etc/letsencrypt/logs
fi
}

Expand All @@ -180,7 +188,7 @@ function forceUpdateLetsEncrypt() {
docker pull certbot/certbot
docker run -i --rm --name certbot -p 443:443 -p 80:80 \
-v $OUTPUT_DIR/letsencrypt:/etc/letsencrypt/ certbot/certbot \
renew --logs-dir /etc/letsencrypt/logs --force-renew
renew ${preventLetsEncryptRandomSleepOnRenew} --logs-dir /etc/letsencrypt/logs --force-renew
fi
}

Expand Down