[pbs-devel] [PATCH proxmox-backup v2] fix #3867: server/api: send emails on certificate renewal failure

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Jun 14 09:38:34 CEST 2022


needs a rebase
also a note inline...

On Thu, Mar 31, 2022 at 11:36:55AM +0200, Stefan Sterz wrote:
> the superuser's email will be used to notify them that certificate
> renewal has failed.
> 
> Signed-off-by: Stefan Sterz <s.sterz at proxmox.com>
> ---
>  src/api2/node/certificates.rs     | 22 +++++++++----
>  src/server/email_notifications.rs | 54 ++++++++++++++++++++++++++++++-
>  2 files changed, 69 insertions(+), 7 deletions(-)
> 
(...)
> diff --git a/src/server/email_notifications.rs b/src/server/email_notifications.rs
> index 4d734368..6fffefd3 100644
> --- a/src/server/email_notifications.rs
> +++ b/src/server/email_notifications.rs
> @@ -543,6 +557,42 @@ pub fn send_updates_available(
>      Ok(())
>  }
>  
> +/// send email on certificate renewal failure.
> +/// `notify` currently only accepts `Notify::Error`.
> +pub fn send_certificate_renewal_mail(
> +    notify: Notify,

I think it's better to actually just drop the `notify` parameter rather
than hardcoding an unchangable value.
That way if we add support for it you'll automatically get errors at all
the call-sites from the compiler.

> +    result: &Result<(), Error>,
> +) -> Result<(), Error> {
(...)





More information about the pbs-devel mailing list