From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 87A661FF16B for ; Thu, 14 Nov 2024 21:57:02 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 727F937EF8; Thu, 14 Nov 2024 21:57:02 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Date: Thu, 14 Nov 2024 21:56:52 +0100 Message-Id: <20241114205652.3522223-1-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.048 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [answer.rs, main.rs] Subject: [pve-devel] applied: [PATCH installer] auto-install: rename 'posthook' to 'post-installation-webhook' 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" Webhooks are nowadays pretty clear in what they do generally, so the updated name should paint a clearer picture about what this is about and avoid confusion with a under-development feature that executes a admin provided program after the installation on the target system, which could be also seen as "posthook". Signed-off-by: Thomas Lamprecht --- proxmox-auto-installer/src/answer.rs | 2 +- proxmox-post-hook/src/main.rs | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/proxmox-auto-installer/src/answer.rs b/proxmox-auto-installer/src/answer.rs index c23f1f3..73e5869 100644 --- a/proxmox-auto-installer/src/answer.rs +++ b/proxmox-auto-installer/src/answer.rs @@ -21,7 +21,7 @@ pub struct Answer { #[serde(rename = "disk-setup")] pub disks: Disks, #[serde(default)] - pub posthook: Option, + pub post_installation_webhook: Option, } impl Answer { diff --git a/proxmox-post-hook/src/main.rs b/proxmox-post-hook/src/main.rs index 198e0c9..ae373d8 100644 --- a/proxmox-post-hook/src/main.rs +++ b/proxmox-post-hook/src/main.rs @@ -1,9 +1,9 @@ //! Post installation hook for the Proxmox installer, mainly for combination //! with the auto-installer. //! -//! If a `[posthook]` section is specified in the given answer file, it will -//! send a HTTP POST request to that URL, with an optional certificate fingerprint -//! for usage with (self-signed) TLS certificates. +//! If a `[post-installation-webhook]` section is specified in the given answer file, it will send +//! a HTTP POST request to that URL, with an optional certificate fingerprint for usage with +//! (self-signed) TLS certificates. //! In the body of the request, information about the newly installed system is sent. //! //! Relies on `proxmox-chroot` as an external dependency to (bind-)mount the @@ -155,7 +155,7 @@ impl Default for PostHookInfoMeta { } } -/// All data sent as request payload with the post-hook POST request. +/// All data sent as request payload with the post-installation-webhook POST request. /// /// NOTE: The format is versioned through `format_info.version` (`$format-info.version` in the /// resulting JSON), ensure you update it when this struct or any of its members gets modified. @@ -616,18 +616,18 @@ fn with_chroot Result>(callback: F) -> Result { result } -/// Reads the answer file from stdin, checks for a configured post-hook URL (+ optional certificate -/// fingerprint for HTTPS). If configured, retrieves all relevant information about the installed -/// system and sends them to the given endpoint. +/// Reads the answer file from stdin, checks for a configured post-installation-webhook URL (+ +/// optional certificate fingerprint for HTTPS). If configured, retrieves all relevant information +/// about the installed system and sends them to the given endpoint. fn do_main() -> Result<()> { let answer = Answer::try_from_reader(std::io::stdin().lock())?; if let Some(PostNotificationHookInfo { url, cert_fingerprint, - }) = &answer.posthook + }) = &answer.post_installation_webhook { - println!("Found posthook; sending POST request to '{url}'."); + println!("Found post-installation-webhook; sending POST request to '{url}'."); let info = with_chroot(|target_path| PostHookInfo::gather(target_path, &answer))?; @@ -637,7 +637,7 @@ fn do_main() -> Result<()> { serde_json::to_string(&info)?, )?; } else { - println!("No posthook found; skipping"); + println!("No post-installation-webhook configured; skipping"); } Ok(()) @@ -647,7 +647,7 @@ fn main() -> ExitCode { match do_main() { Ok(()) => ExitCode::SUCCESS, Err(err) => { - eprintln!("\nError occurred during posthook:"); + eprintln!("\nError occurred during post-installation-webhook:"); eprintln!("{err:#}"); ExitCode::FAILURE } -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel