From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 6E1FD1FF183 for ; Wed, 27 Aug 2025 16:25:33 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8097E1C134; Wed, 27 Aug 2025 16:25:34 +0200 (CEST) From: Shannon Sterz To: pbs-devel@lists.proxmox.com Date: Wed, 27 Aug 2025 16:24:58 +0200 Message-ID: <20250827142458.293270-1-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.2 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1756304694513 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.025 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. [proxmox.com, proxmox-offline-mirror.rs] Subject: [pbs-devel] [PATCH proxmox-offline-mirror] mirror: add support for trixie repositories X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" Signed-off-by: Shannon Sterz --- src/bin/proxmox-offline-mirror.rs | 99 +++++++++++++++++++++---------- 1 file changed, 69 insertions(+), 30 deletions(-) diff --git a/src/bin/proxmox-offline-mirror.rs b/src/bin/proxmox-offline-mirror.rs index 6a5063a..9aaf058 100644 --- a/src/bin/proxmox-offline-mirror.rs +++ b/src/bin/proxmox-offline-mirror.rs @@ -46,6 +46,7 @@ impl Display for Distro { } enum Release { + Trixie, Bookworm, Bullseye, Buster, @@ -54,6 +55,7 @@ enum Release { impl Display for Release { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { + Release::Trixie => write!(f, "trixie"), Release::Bookworm => write!(f, "bookworm"), Release::Bullseye => write!(f, "bullseye"), Release::Buster => write!(f, "buster"), @@ -135,6 +137,17 @@ fn derive_debian_repo( skip_sections, }; let url = match (release, variant) { + (Release::Trixie, DebianVariant::Main) => "http://deb.debian.org/debian trixie", + (Release::Trixie, DebianVariant::Security) => { + "http://deb.debian.org/debian-security trixie-security" + } + (Release::Trixie, DebianVariant::Updates) => "http://deb.debian.org/debian trixie-updates", + (Release::Trixie, DebianVariant::Backports) => { + "http://deb.debian.org/debian trixie-backports" + } + (Release::Trixie, DebianVariant::Debug) => { + "http://deb.debian.org/debian-debug trixie-debug" + } (Release::Bookworm, DebianVariant::Main) => "http://deb.debian.org/debian bookworm", (Release::Bookworm, DebianVariant::Security) => { "http://deb.debian.org/debian-security bookworm-security" @@ -176,6 +189,13 @@ fn derive_debian_repo( let url = format!("{url} {components}"); let key = match (release, variant) { + (Release::Trixie, DebianVariant::Security) => { + "/usr/share/keyrings/debian-archive-trixie-security-automatic.gpg" + } + (Release::Trixie, DebianVariant::Updates) | (Release::Trixie, DebianVariant::Backports) => { + "/usr/share/keyrings/debian-archive-trixie-automatic.gpg" + } + (Release::Trixie, _) => "/usr/share/keyrings/debian-archive-trixie-stable.gpg", (Release::Bookworm, DebianVariant::Security) => { "/usr/share/keyrings/debian-archive-bookworm-security-automatic.gpg" } @@ -217,6 +237,7 @@ fn action_add_mirror(config: &SectionConfigData) -> Result, Er let dist = read_selection_from_tty("Select distro to mirror", distros, None)?; let releases = &[ + (Release::Trixie, "Trixie"), (Release::Bookworm, "Bookworm"), (Release::Bullseye, "Bullseye"), (Release::Buster, "Buster"), @@ -238,7 +259,9 @@ fn action_add_mirror(config: &SectionConfigData) -> Result, Er read_selection_from_tty("Select repository variant", variants, Some(0))?; let default_components = match release { - Release::Bookworm => "main contrib non-free non-free-firmware", + Release::Bookworm | Release::Trixie => { + "main contrib non-free non-free-firmware" + } _ => "main contrib non-free", }; @@ -259,6 +282,7 @@ fn action_add_mirror(config: &SectionConfigData) -> Result, Er } let releases = match release { + Release::Trixie => vec![(CephRelease::Squid, "Squid (19.x)")], Release::Bookworm => vec![ (CephRelease::Quincy, "Quincy (17.x)"), (CephRelease::Reef, "Reef (18.x)"), @@ -286,41 +310,46 @@ fn action_add_mirror(config: &SectionConfigData) -> Result, Er Some(releases.len() - 1), )?; - let (base_url, components) = if matches!(release, Release::Bookworm) { - let variants = &[ - (ProxmoxVariant::Enterprise, "Enterprise repository"), - (ProxmoxVariant::NoSubscription, "No-Subscription repository"), - (ProxmoxVariant::Test, "Test repository"), - ]; + let (base_url, components) = + if matches!(release, Release::Bookworm | Release::Trixie) { + let variants = &[ + (ProxmoxVariant::Enterprise, "Enterprise repository"), + (ProxmoxVariant::NoSubscription, "No-Subscription repository"), + (ProxmoxVariant::Test, "Test repository"), + ]; - let variant = - read_selection_from_tty("Select repository variant", variants, Some(0))?; + let variant = read_selection_from_tty( + "Select repository variant", + variants, + Some(0), + )?; - match variant { - ProxmoxVariant::Enterprise => { - use_subscription = Some(ProductType::Pve); - ( - "https://enterprise.proxmox.com/debian/ceph", - "enterprise".to_string(), - ) + match variant { + ProxmoxVariant::Enterprise => { + use_subscription = Some(ProductType::Pve); + ( + "https://enterprise.proxmox.com/debian/ceph", + "enterprise".to_string(), + ) + } + ProxmoxVariant::NoSubscription => ( + "http://download.proxmox.com/debian/ceph", + "no-subscription".to_string(), + ), + ProxmoxVariant::Test => ( + "http://download.proxmox.com/debian/ceph", + "test".to_string(), + ), } - ProxmoxVariant::NoSubscription => ( + } else { + ( "http://download.proxmox.com/debian/ceph", - "no-subscription".to_string(), - ), - ProxmoxVariant::Test => ( - "http://download.proxmox.com/debian/ceph", - "test".to_string(), - ), - } - } else { - ( - "http://download.proxmox.com/debian/ceph", - read_string_from_tty("Enter repository components", Some("main test"))?, - ) - }; + read_string_from_tty("Enter repository components", Some("main test"))?, + ) + }; let key = match release { + Release::Trixie => "/etc/apt/trusted.gpg.d/proxmox-release-trixie.gpg", Release::Bookworm => "/etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg", Release::Bullseye => "/etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg", Release::Buster => "/etc/apt/trusted.gpg.d/proxmox-release-buster.gpg", @@ -353,6 +382,15 @@ fn action_add_mirror(config: &SectionConfigData) -> Result, Er // TODO enterprise query for key! let url = match (release, variant) { + (Release::Trixie, ProxmoxVariant::Enterprise) => format!( + "https://enterprise.proxmox.com/debian/{product} trixie {product}-enterprise" + ), + (Release::Trixie, ProxmoxVariant::NoSubscription) => format!( + "http://download.proxmox.com/debian/{product} trixie {product}-no-subscription" + ), + (Release::Trixie, ProxmoxVariant::Test) => { + format!("http://download.proxmox.com/debian/{product} trixie {product}test") + } (Release::Bookworm, ProxmoxVariant::Enterprise) => format!( "https://enterprise.proxmox.com/debian/{product} bookworm {product}-enterprise" ), @@ -390,6 +428,7 @@ fn action_add_mirror(config: &SectionConfigData) -> Result, Er }; let key = match release { + Release::Trixie => "/etc/apt/trusted.gpg.d/proxmox-release-trixie.gpg", Release::Bookworm => "/etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg", Release::Bullseye => "/etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg", Release::Buster => "/etc/apt/trusted.gpg.d/proxmox-release-buster.gpg", -- 2.47.2 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel