From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 9444A1FF396 for ; Thu, 23 May 2024 14:19:40 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BFEDB1F1CA; Thu, 23 May 2024 14:19:48 +0200 (CEST) From: Christoph Heiss To: pve-devel@lists.proxmox.com Date: Thu, 23 May 2024 14:19:32 +0200 Message-ID: <20240523121938.1058898-5-c.heiss@proxmox.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240523121938.1058898-1-c.heiss@proxmox.com> References: <20240523121938.1058898-1-c.heiss@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.006 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH installer 4/7] tui-installer: adapt to new `root_password` plain/hashed setup option X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Signed-off-by: Christoph Heiss --- proxmox-installer-common/src/setup.rs | 12 ++++++++++-- proxmox-tui-installer/src/setup.rs | 10 ++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/proxmox-installer-common/src/setup.rs b/proxmox-installer-common/src/setup.rs index 64d05af..ef92eb7 100644 --- a/proxmox-installer-common/src/setup.rs +++ b/proxmox-installer-common/src/setup.rs @@ -424,6 +424,14 @@ impl Interface { } } +#[derive(Clone, Deserialize, Serialize)] +pub struct InstallRootPassword { + #[serde(skip_serializing_if = "Option::is_none")] + pub plain: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub hashed: Option, +} + pub fn spawn_low_level_installer(test_mode: bool) -> io::Result { let (path, args, envs): (&str, &[&str], Vec<(&str, &str)>) = if test_mode { ( @@ -444,7 +452,7 @@ pub fn spawn_low_level_installer(test_mode: bool) -> io::Result } /// See Proxmox::Install::Config -#[derive(Debug, Deserialize, Serialize)] +#[derive(Deserialize, Serialize)] pub struct InstallConfig { pub autoreboot: usize, @@ -485,7 +493,7 @@ pub struct InstallConfig { pub timezone: String, pub keymap: String, - pub password: String, + pub root_password: InstallRootPassword, pub mailto: String, #[serde(skip_serializing_if = "Vec::is_empty")] pub root_ssh_keys: Vec, diff --git a/proxmox-tui-installer/src/setup.rs b/proxmox-tui-installer/src/setup.rs index 8c01e42..ee6e65c 100644 --- a/proxmox-tui-installer/src/setup.rs +++ b/proxmox-tui-installer/src/setup.rs @@ -1,7 +1,10 @@ use std::collections::BTreeMap; use crate::options::InstallerOptions; -use proxmox_installer_common::{options::AdvancedBootdiskOptions, setup::InstallConfig}; +use proxmox_installer_common::{ + options::AdvancedBootdiskOptions, + setup::{InstallConfig, InstallRootPassword}, +}; impl From for InstallConfig { fn from(options: InstallerOptions) -> Self { @@ -23,7 +26,10 @@ impl From for InstallConfig { timezone: options.timezone.timezone, keymap: options.timezone.kb_layout, - password: options.password.root_password, + root_password: InstallRootPassword { + plain: Some(options.password.root_password), + hashed: None, + }, mailto: options.password.email, root_ssh_keys: vec![], -- 2.44.0 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel