Skip to content
This repository was archived by the owner on Jan 6, 2021. It is now read-only.

Commit 2def09e

Browse files
aptalcathelamer
authored andcommitted
attempt renewal on start if expired
1 parent 40c6783 commit 2def09e

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
282282

283283
## Versions
284284

285+
* **06.03.20:** - Implement cert renewal attempt during container start (only if the cert is already expired or will expire within the next 24 hours, otherwise it will be attempted at 2:08am).
285286
* **05.03.20:** - Use port and proto upstream variables for ldap and default sample confs.
286287
* **24.02.20:** - Remove world/group read permissions in dns-conf.
287288
* **23.02.20:** - Add aliyun dns validation plugin.

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ app_setup_nginx_reverse_proxy_block: ""
125125

126126
# changelog
127127
changelogs:
128+
- { date: "06.03.20:", desc: "Implement cert renewal attempt during container start (only if the cert is already expired or will expire within the next 24 hours, otherwise it will be attempted at 2:08am)." }
128129
- { date: "05.03.20:", desc: "Use port and proto upstream variables for ldap and default sample confs." }
129130
- { date: "24.02.20:", desc: "Remove world/group read permissions in dns-conf." }
130131
- { date: "23.02.20:", desc: "Add aliyun dns validation plugin." }

root/etc/cont-init.d/60-renew

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
# Check if the cert is expired or expires within a day, if so, renew
4+
if openssl x509 -in /config/keys/letsencrypt/fullchain.pem -noout -checkend 86400 >/dev/null; then
5+
echo "The cert does not expire within the next day. Letting the cron script handle the renewal attempts overnight (2:08am)."
6+
else
7+
echo "The cert is either expired or it expires within the next day. Attempting to renew. This could take up to 10 minutes."
8+
/app/le-renew.sh
9+
fi

0 commit comments

Comments
 (0)