]> git.proxmox.com Git - pve-installer.git/commitdiff
auto install: drop post/pre command execution for now
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 22 Apr 2024 06:00:58 +0000 (08:00 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 22 Apr 2024 12:31:37 +0000 (14:31 +0200)
This can be quite a bit dangerous w.r.t. prepared ISOs as attack
vector or copy cats, we rather should implement the common use cases,
like adding a SSH auth key, as explicit, declarative defined config
option.

Such a overly general command execution might be something to add at a
later stage, but not for the initial MVP.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
proxmox-auto-installer/src/answer.rs
proxmox-auto-installer/src/bin/proxmox-auto-installer.rs

index 57c2602a15ae62d558438b4b774e89bf2ff14972..a9e723a78bf67ee1b5e94f1a5bb6f4d900465423 100644 (file)
@@ -27,8 +27,6 @@ pub struct Global {
     pub mailto: String,
     pub timezone: String,
     pub password: String,
-    pub pre_commands: Option<Vec<String>>,
-    pub post_commands: Option<Vec<String>>,
     #[serde(default)]
     pub reboot_on_error: bool,
 }
index f43b12f161a2310431670582777b4bb7932ef994..922773aef4878135d85885549b12e4f277a0529d 100644 (file)
@@ -15,7 +15,6 @@ use proxmox_auto_installer::{
     answer::Answer,
     log::AutoInstLogger,
     udevinfo::UdevInfo,
-    utils,
     utils::{parse_answer, LowLevelMessage},
 };
 
@@ -83,13 +82,6 @@ fn main() -> ExitCode {
         }
     };
 
-    match utils::run_cmds("Pre", &answer.global.pre_commands) {
-        Ok(_) => (),
-        Err(err) => {
-            error!("Error when running Pre-Commands: {}", err);
-            return exit_failure(answer.global.reboot_on_error);
-        }
-    };
     match run_installation(&answer, &locales, &runtime_info, &udevadm_info, &setup_info) {
         Ok(_) => info!("Installation done."),
         Err(err) => {
@@ -97,13 +89,9 @@ fn main() -> ExitCode {
             return exit_failure(answer.global.reboot_on_error);
         }
     }
-    match utils::run_cmds("Post", &answer.global.post_commands) {
-        Ok(_) => (),
-        Err(err) => {
-            error!("Error when running Post-Commands: {}", err);
-            return exit_failure(answer.global.reboot_on_error);
-        }
-    };
+
+    // TODO: (optionally) do a HTTP post with basic system info, like host SSH public key(s) here
+
     ExitCode::SUCCESS
 }