public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH 1/2] tui: always use mail@example.invalid as default email address
Date: Wed, 21 Jun 2023 14:30:31 +0200	[thread overview]
Message-ID: <20230621123032.744374-1-d.csapak@proxmox.com> (raw)

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





             reply	other threads:[~2023-06-21 12:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-21 12:30 Dominik Csapak [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230621123032.744374-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal