[pve-devel] [PATCH 1/2] tui: always use mail at example.invalid as default email address

Dominik Csapak d.csapak at proxmox.com
Wed Jun 21 14:30:31 CEST 2023


like the gui installer

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 proxmox-tui-installer/src/main.rs    |  2 +-
 proxmox-tui-installer/src/options.rs | 14 +++-----------
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/proxmox-tui-installer/src/main.rs b/proxmox-tui-installer/src/main.rs
index 90da81d..77cfb63 100644
--- a/proxmox-tui-installer/src/main.rs
+++ b/proxmox-tui-installer/src/main.rs
@@ -179,7 +179,7 @@ fn main() {
         options: InstallerOptions {
             bootdisk: BootdiskOptions::defaults_from(&runtime_info.disks[0]),
             timezone: TimezoneOptions::defaults_from(&runtime_info, &locales),
-            password: PasswordOptions::defaults_from(&runtime_info),
+            password: Default::default(),
             network: NetworkOptions::from(&runtime_info.network),
             autoreboot: false,
         },
diff --git a/proxmox-tui-installer/src/options.rs b/proxmox-tui-installer/src/options.rs
index 6855f4a..5f3d295 100644
--- a/proxmox-tui-installer/src/options.rs
+++ b/proxmox-tui-installer/src/options.rs
@@ -306,18 +306,10 @@ pub struct PasswordOptions {
     pub root_password: String,
 }
 
-impl PasswordOptions {
-    pub fn defaults_from(info: &RuntimeInfo) -> Self {
-        let domain = info
-            .network
-            .dns
-            .domain
-            .clone()
-            // Safety: The provided default domain will always be valid.
-            .unwrap_or_else(|| Fqdn::from("example.invalid").unwrap());
-
+impl Default for PasswordOptions {
+    fn default() -> Self {
         Self {
-            email: format!("mail@{domain}"),
+            email: "mail at example.invalid".to_string(),
             root_password: String::new(),
         }
     }
-- 
2.30.2






More information about the pve-devel mailing list