all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH 1/2] tui: always use mail@example.invalid as default email address
@ 2023-06-21 12:30 Dominik Csapak
  2023-06-21 12:30 ` [pve-devel] [PATCH 2/2] tui: verify email with basic regex Dominik Csapak
  0 siblings, 1 reply; 4+ messages in thread
From: Dominik Csapak @ 2023-06-21 12:30 UTC (permalink / raw)
  To: pve-devel

like the gui installer

Signed-off-by: Dominik Csapak <d.csapak@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@example.invalid".to_string(),
             root_password: String::new(),
         }
     }
-- 
2.30.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-21 12:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-21 12:30 [pve-devel] [PATCH 1/2] tui: always use mail@example.invalid as default email address Dominik Csapak
2023-06-21 12:30 ` [pve-devel] [PATCH 2/2] tui: verify email with basic regex Dominik Csapak
2023-06-21 12:34   ` Thomas Lamprecht
2023-06-21 12:45   ` Maximiliano Sandoval

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal