#824223 dehydrated: Provide more automatism for letsencrypt.sh

#824223#5
Date:
2016-05-13 20:28:30 UTC
From:
To:
I continue the discussion from Bug#822493 here:

Please provide a cron based automatism for refreshing certificates.

It would be nice that users only need to provide the hostname(s) they
want to get a certificate for in /etc/letsencrypt.sh/ and a cronjob
that runs letsencrypt.sh -c takes care for refreshing it before it expires.

That script would also need hooks to reload daemons that need to know
about a certificate-change.

Debconf could ask if automatic refresh is activated.

Cord

#824223#10
Date:
2016-06-15 15:35:40 UTC
From:
To:
On Fri, May 13, 2016 at 22:28:30 +0200, Cord Beermann wrote:
[...]
[...]

Could my hook.d idea in #827371 possibly help with this?


Cheers

    Elrond

#824223#15
Date:
2017-01-08 11:38:23 UTC
From:
To:
How about add a systemd service like certbot?

A modified version from certbot package:

/lib/systemd/system/letsencrypt.sh.service

[Unit]
Description=letsencrypt.sh
Documentation=file:///usr/share/doc/letsencrypt.sh/README.Debian
[Service]
Type=oneshot
ExecStart=/usr/bin/letsencrypt.sh -c
PrivateTmp=true

/lib/systemd/system/letsencrypt.sh.timer

[Unit]
Description=Run letsencrypt.sh twice daily

[Timer]
OnCalendar=*-*-* 00,12:00:00
RandomizedDelaySec=3600
Persistent=true

[Install]
WantedBy=timers.target

#824223#26
Date:
2018-07-25 12:28:38 UTC
From:
To:
Hello,

attaching short examples for cron and logrotate scripts as they work on some
servers maintained by us. Works without systemd too.

1. /etc/cron.daily/dehydrated

#!/bin/sh
dehydrated -c >> /var/log/dehydrated.log


2. /etc/logrotate.d/dehydrated

/var/log/dehydrated.log
{
	missingok
	yearly
}

#824223#31
Date:
2021-03-06 15:48:42 UTC
From:
To:
An example cron job script is provided by the hosting company Mythic Beasts
at: https://www.mythic-beasts.com/support/domains/letsencrypt_dns_01

/etc/cron.daily/dehydrated:
#!/bin/sh
exec /usr/bin/dehydrated -c >>/var/log/dehydrated-cron.log 2>&1

/etc/logrotate.d/dehydrated:
/var/log/dehydrated-cron.log
{
        rotate 12
        monthly
        missingok
        notifempty
        delaycompress
        compress
}

It would be great to see this functionality added to the Debian package!