Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#73186 - [certbot] Add systemd service and timer to renew certificates

Attached to Project: Community Packages
Opened by Damjan Georgievski (damjan) - Wednesday, 29 December 2021, 12:21 GMT
Last edited by George Rawlinson (rawlinsong) - Wednesday, 23 March 2022, 00:55 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Jelle van der Waa (jelly)
Felix Yan (felixonmars)
George Rawlinson (rawlinsong)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

People using certbot probably already have these, because, why would you have certbot without automatic renewals.

So let's have the timer and service unit files centrally, included in the package, where we can improve them in a single place.

# /usr/lib/systemd/system/certbot.service
[Unit]
Description=Renew all previously obtained certificates that are near expiry
Documentation=https://letsencrypt.org/docs/

[Service]
Type=oneshot
ExecStart=/usr/bin/certbot -q renew
PrivateTmp=true




# /usr/lib/systemd/system/certbot.timer
[Unit]
Description=Run certbot twice daily

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

[Install]
WantedBy=timers.target
This task depends upon

Closed by  George Rawlinson (rawlinsong)
Wednesday, 23 March 2022, 00:55 GMT
Reason for closing:  Implemented
Additional comments about closing:  Will be available as certbot-renew.{service,timer} in upcoming package 1.25.0-1.
Comment by George Rawlinson (rawlinsong) - Monday, 17 January 2022, 20:21 GMT
Upstream does not provide systemd integration as it is generally accepted that you do it yourself.

Speaking from a non-Arch devops perspective, this request does not cover all use cases and will most likely cause issues.
Comment by Damjan Georgievski (damjan) - Monday, 17 January 2022, 20:25 GMT
> this request does not cover all use cases

can you share some of those use cases you're thinking of?

> and will most likely cause issues.

the timer/service wouldn't be enabled by default, I don't see what issues they would cause by default?
Comment by George Rawlinson (rawlinsong) - Tuesday, 18 January 2022, 03:10 GMT
1. Let's assume that we push a new version with these systemd units, any previously installed files of the same name will cause pacman to throw a file conflict.
2. Some people do not want the timers run every day, or different parameters passed to certbot, or some other bespoke configuration.

Thankfully, we do not need to concern ourselves with these potential scenarios because upstream does not provide any systemd integration anyway.
Comment by Amin Vakil (aminvakil) - Tuesday, 18 January 2022, 08:53 GMT
I don't think Arch should handle these situations.

https://wiki.archlinux.org/title/Arch_Linux#Simplicity:

"It ships software as released by the original developers (upstream) with minimal distribution-specific (downstream) changes"
Comment by Damjan Georgievski (damjan) - Tuesday, 18 January 2022, 10:59 GMT
@rawlinsong
1. people shouldn't put units in /usr/lib/systemd/ anyway, it's documented that they should use /etc/systemd (which overrides /usr).
2. sure, the proposed units are what 99% of people would use (twice daily is what letsencrypt recommends). but of course, users can always have local overrides.

@aminvakil
but also
https://wiki.archlinux.org/title/Arch_Linux#Pragmatism
:)

my reasoning is that adding default units that will be useful to 99% of users,
offers a good common building block, and will lower peoples support "calls".
Comment by George Rawlinson (rawlinsong) - Wednesday, 23 March 2022, 00:54 GMT
I'm currently updating all the certbot* packages that are in the github.com/certbot/certbot repository (not certbot-dns-{hetzner,inwx}), I'll probably add these as certbot-renew.{service,timer}.

Loading...