nginx_docker-swag/root
Patrick Bellasi 936bc981e5 Ensure ACME Server is valid
Starting this container can fail at certbot initialization with this
error (reported at the end of /var/log/letsencrypt/letsencrypt.log):

   HTTPSConnectionPool(host='acme-v02.api.letsencrypt.org', port=443):
   Max retries exceeded with url: /directory "[Errno -3] Try again"

which does not tell much about the real problem and it just sounds like
a possible DNS resolution issue.

However, by logging into the container after the error above, a simple:

   wget https://acme-v02.api.letsencrypt.org/directory

usually works. It works also the exact same certbot command
logged in /var/log/letsencrypt/letsencrypt.log.

This has been verified happening for example while installing the
contained on a QNAP NAS with a bridged network setup.

Turns out that on some systems a small delay is required before running
network access operations (e.g. running certbot).

Add a tight look to ckeck for a valid resolution of ACMESERVER.
Report a clearer error in case we cannot resolve the server withing
1 min.
Otherwise, continue with the init script, as soon as nslook is
happy.

No overheads for generic systems: just a local nslookup will be
performed, which response caching will benifit anyway the following
certbot connection.

Signed-off-by: Patrick Bellasi <patrick.bellasi@matbug.net>
2021-02-07 18:32:57 +01:00
..
app update conf name in scripts 2020-12-10 13:37:53 -05:00
defaults add support for hetzner dns validation 2021-01-26 18:11:44 -05:00
etc Ensure ACME Server is valid 2021-02-07 18:32:57 +01:00
donate.txt initial release 2020-08-03 11:00:14 -04:00