[pbs-devel] [PATCH v2 backup 25/27] acme: create directories as needed

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Apr 22 16:12:49 CEST 2021


Ah damn, I failed to include a fixup in this patch:

On Thu, Apr 22, 2021 at 04:02:11PM +0200, Wolfgang Bumiller wrote:
> Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
> ---
>  src/acme/client.rs        |  2 ++
>  src/config/acme/mod.rs    | 27 +++++++++++++++++++++++++++
>  src/config/acme/plugin.rs |  7 +++++--
>  3 files changed, 34 insertions(+), 2 deletions(-)
> 
> diff --git a/src/acme/client.rs b/src/acme/client.rs
> index dea2e3b0..83bfdf9e 100644
> --- a/src/acme/client.rs
> +++ b/src/acme/client.rs
> @@ -124,6 +124,7 @@ impl AcmeClient {
>  
>          let _ = self.register_account(account).await?;
>  
> +        crate::config::acme::make_acme_account_dir()?;
>          let account_path = account_path(account_name.as_ref());
>          let file = OpenOptions::new()
>              .write(true)
> @@ -151,6 +152,7 @@ impl AcmeClient {
>          let account_path = self.account_path.as_ref().ok_or_else(|| {
>              format_err!("no account path set, cannot save upated account information")
>          })?;
> +        crate::config::acme::make_acme_account_dir()?;
>          replace_file(
>              account_path,
>              &data,
> diff --git a/src/config/acme/mod.rs b/src/config/acme/mod.rs
> index ac409c20..0ed4974d 100644
> --- a/src/config/acme/mod.rs
> +++ b/src/config/acme/mod.rs
> @@ -7,14 +7,41 @@ use serde::{Deserialize, Serialize};
>  
>  use proxmox::api::api;
>  use proxmox::sys::error::SysError;
> +use proxmox::tools::fs::CreateOptions;
>  
>  use crate::api2::types::{PROXMOX_SAFE_ID_FORMAT, PROXMOX_SAFE_ID_REGEX};
>  use crate::tools::ControlFlow;
>  
> +pub(crate) const ACME_DIR: &str = configdir!("/acme/accounts");

^ This should obviously not include the `/accounts` part...

>  pub(crate) const ACME_ACCOUNT_DIR: &str = configdir!("/acme/accounts");





More information about the pbs-devel mailing list