one enables the path unit, say, systemctl enable --now tls@example.com, and once Caddy renews TLS certificate, /usr/lib/caddy-tls-hooks/example.com script will be triggered. In that script the admin is free to shuffle certificate files for whatever daemon they need, and also reload/restart the daemon to make a new certificate effective.
An abstract example of /usr/lib/caddy-tls-hooks/example.com for an abstract postfix setup:
Yup, I totally get it, but OTOH IIUC events requires 3rd-party modules right now to be useful, and for me personally it’s not a quite go ATM.
As for ZeroSSL, I’d appreciate knowing more about a) “few different factors”; and b) what changes with regard to certificate path so that the .path unit can be adapted as and if needed.
See Automatic HTTPS — Caddy Documentation which explains. Basically, LE is tried first by default, but if anything ever fails for any reason (transient network issues, rate limiting, LE downtime) then it’ll swap over to ZeroSSL to try that instead.
You can turn off ZeroSSL by specifying the issuer in your config to only use LE, but I don’t recommend that because you’d be making your Caddy server more brittle.
The problem is ZeroSSL certs will use a different filesystem path (i.e. with the ZeroSSL domain as the directory) so your setup would fail to detect that.
FWIW, I’ve also realised tls@.path needs Before=caddy.service to avoid a situation when caddy starts and (re)obtains a certificate, and then .path unit starts and misses this event.