Commit graph

22 commits

Author SHA1 Message Date
fc9bd40c9a Improve bullseye support, perticularly __letsencrypt_cert 2021-10-01 13:14:57 +02:00
a696f3cf00 [__letsencrypt_cert] Revamp explorers, add locking.
This would fix #839

Certbot uses locking [1] even for read-only operations and does not properly
use exit codes, which means that sometimes it would print:
"Another instance of Certbot is already running" and exit with success.

However, the previous explorers would take that as the certificate being absent
and would trigger code generation.

The issue was made worse by having many explorers running certbot, so for N
certificates, we'd run certbot N*4 times, potentially "in parallel".

[1]: https://certbot.eff.org/docs/using.html#id5

This patch joins all explorers in one to avoid starting multiple remote python
processes and uses a cdist-specific lock in /tmp/certbot.cdist.lock with a
60 seconds timeout.

It has been tested with certbot 0.31.0 and 0.17 that the:

    from certbot.main import main

trick works. It is somewhat well documented so it can be somewhat relied upon.
2021-05-10 12:10:00 +02:00
aa80c09c80 [__letsencrypt_cert] Move hook contents generation out of manifest
While there address some minor issues in the comments in the hook contents.
2021-02-10 10:10:21 +01:00
b832af5e3b [__letsencrypt_cert] Don't mess with user script indentation
This could break in odd ways if they passed sth like:
cat <<eof
bla bla
eof
2021-02-09 20:53:58 +01:00
e49da474c4 [__letsencrypt_cert] Remove problematic trailing slash in sed.
Happy fingers are happy and like adding slashes places.
2021-02-09 20:29:17 +01:00
bc145bbc27 [__letsencrypt_cert] Fix various issues with hooks.
Closes #853, see issue for full description / discussion.

Short summary:
- There was about 6.53% chances of `--renewal-hook` not being applied
- Using --automatic-renewal in one cert and not in another was an error.
- It was not possible to use different hooks for different certificates.
- FreeBSD support was utterly broken.
2021-02-09 19:58:47 +01:00
Nico Schottelius
d4059fd29e [__letsencrypt_cert] whitelist Ubuntu 2020-05-01 15:31:23 +02:00
Nico Schottelius
9f1ec6f89e Merge branch 'master' of code.ungleich.ch:ungleich-public/cdist 2019-10-17 16:47:28 +02:00
Nico Schottelius
689b5a2992 [letsencrypt_cert] add support for alpine 2019-10-17 16:44:26 +02:00
Ahmed Bilal
f5c725a57f Fix issues/Make prometheus+grafana+blackbox types compatible with Debian 10 2019-10-15 20:19:04 +02:00
Nico Schottelius
2bc26e398c [__letsencrypt_cert] Add Arch Linux support 2019-10-13 11:15:53 +02:00
a432d6a51e Support Added for Debian 10* in __letsencrypt_cert 2019-10-04 14:13:10 +05:00
PCoder
88fe83ed73 Fix beowulf's spelling 2019-09-14 15:24:36 +05:30
Nico Schottelius
a86893889b [letsencrypt] devuan/ascii: only install certbot package
It seems python-certbot is gone
2019-08-15 14:24:11 +02:00
Nico Schottelius
c0aa2214aa [letsencrypt] add support for devuan/beowulf 2019-08-15 14:19:54 +02:00
Darko Poljak
334201b945 Fix remaining shellcheck problems. 2018-10-07 10:22:11 +02:00
Darko Poljak
6c8014b407 __letsencrypt_cert: add support for devuan ascii 2018-06-22 14:09:31 +02:00
22d570ae60 Rewrite __letsencrypt_cert type
This commit adds the following features:

 * Ability to expand existing certificate
 * Ability to manage object state
 * Ability to obtain test certificate
 * Ability to promote test certificate to production
 * Ability to specify custom certificate name
 * Ability to specify multiple domains per certificate
 * Ability to use Certbot in standalone mode
 * Messaging

This commit also introduces the following behavioral changes:

 * Attempt to install Certbot only when it is not installed
   already
 * Installation of the cron job has to be enabled using
   `--automatic-renewal` parameter

**Note:** Object ID is now treated as certificate name and new
required parameter `--domain` was added.
2018-05-08 10:49:49 +02:00
Darko Poljak
47399bfa9f Add --renew-hook param to letsencrypt_cert type. 2018-02-05 13:57:53 +01:00
be7a99210b add --minute to __cron (#603)
We don't want this to run _every_ minute (default for `--minute` is `*`).
2017-11-19 13:31:44 +01:00
_moep_
4cdc4ea42c update type for Debian Stretch (#593) 2017-11-07 13:26:44 +01:00
4799e43516 new type: __letsencrypt_cert (#591) 2017-11-01 08:56:12 +01:00