public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-offline-mirror v2 0/2] POM support bookworm releases and ceph enterprise repo
@ 2023-06-12 13:37 Stefan Sterz
  2023-06-12 13:37 ` [pbs-devel] [PATCH proxmox-offline-mirror v2 1/2] add bookworm to the list of releases Stefan Sterz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stefan Sterz @ 2023-06-12 13:37 UTC (permalink / raw)
  To: pbs-devel

these two patches add support for the bookworm-based proxmox releases
and also the ceph enterprise repo.

changes since v1:

* adapted the keys that the setup wizzard uses to match those actually
  used by debian now that bookworm has been released.

Stefan Sterz (2):
  add bookworm to the list of releases
  add support for bookworm enterprise ceph repo

 src/bin/proxmox-offline-mirror.rs | 72 ++++++++++++++++++++++++++++---
 1 file changed, 66 insertions(+), 6 deletions(-)

-- 
2.30.2





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

* [pbs-devel] [PATCH proxmox-offline-mirror v2 1/2] add bookworm to the list of releases
  2023-06-12 13:37 [pbs-devel] [PATCH proxmox-offline-mirror v2 0/2] POM support bookworm releases and ceph enterprise repo Stefan Sterz
@ 2023-06-12 13:37 ` Stefan Sterz
  2023-06-12 13:37 ` [pbs-devel] [PATCH proxmox-offline-mirror v2 2/2] add support for bookworm enterprise ceph repo Stefan Sterz
  2023-06-16  8:05 ` [pbs-devel] applied-series: [PATCH proxmox-offline-mirror v2 0/2] POM support bookworm releases and ceph enterprise repo Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Sterz @ 2023-06-12 13:37 UTC (permalink / raw)
  To: pbs-devel

add support for bookworm based proxmox products and debian
repositories/

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
---
 src/bin/proxmox-offline-mirror.rs | 35 ++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/src/bin/proxmox-offline-mirror.rs b/src/bin/proxmox-offline-mirror.rs
index 8398db4..e2282d7 100644
--- a/src/bin/proxmox-offline-mirror.rs
+++ b/src/bin/proxmox-offline-mirror.rs
@@ -44,6 +44,7 @@ impl Display for Distro {
 }
 
 enum Release {
+    Bookworm,
     Bullseye,
     Buster,
 }
@@ -51,6 +52,7 @@ enum Release {
 impl Display for Release {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         match self {
+            Release::Bookworm => write!(f, "bookworm"),
             Release::Bullseye => write!(f, "bullseye"),
             Release::Buster => write!(f, "buster"),
         }
@@ -131,6 +133,19 @@ fn derive_debian_repo(
         skip_sections,
     };
     let url = match (release, variant) {
+        (Release::Bookworm, DebianVariant::Main) => "http://deb.debian.org/debian bookworm",
+        (Release::Bookworm, DebianVariant::Security) => {
+            "http://deb.debian.org/debian-security bookworm-security"
+        }
+        (Release::Bookworm, DebianVariant::Updates) => {
+            "http://deb.debian.org/debian bookworm-updates"
+        }
+        (Release::Bookworm, DebianVariant::Backports) => {
+            "http://deb.debian.org/debian bookworm-backports"
+        }
+        (Release::Bookworm, DebianVariant::Debug) => {
+            "http://deb.debian.org/debian-debug bookworm-debug"
+        }
         (Release::Bullseye, DebianVariant::Main) => "http://deb.debian.org/debian bullseye",
         (Release::Bullseye, DebianVariant::Security) => {
             "http://deb.debian.org/debian-security bullseye-security"
@@ -159,6 +174,14 @@ fn derive_debian_repo(
 
     let url = format!("{url} {components}");
     let key = match (release, variant) {
+        (Release::Bookworm, DebianVariant::Security) => {
+            "/usr/share/keyrings/debian-archive-bookworm-security-automatic.gpg"
+        }
+        (Release::Bookworm, DebianVariant::Updates) |
+        (Release::Bookworm, DebianVariant::Backports) => {
+            "/usr/share/keyrings/debian-archive-bookworm-automatic.gpg"
+        }
+        (Release::Bookworm, _) => "/usr/share/keyrings/debian-archive-bookworm-stable.gpg",
         (Release::Bullseye, DebianVariant::Security) => {
             "/usr/share/keyrings/debian-archive-bullseye-security-automatic.gpg"
         }
@@ -191,7 +214,11 @@ fn action_add_mirror(config: &SectionConfigData) -> Result<Vec<MirrorConfig>, Er
         ];
         let dist = read_selection_from_tty("Select distro to mirror", distros, None)?;
 
-        let releases = &[(Release::Bullseye, "Bullseye"), (Release::Buster, "Buster")];
+        let releases = &[
+            (Release::Bookworm, "Bookworm"),
+            (Release::Bullseye, "Bullseye"),
+            (Release::Buster, "Buster"),
+        ];
         let release = read_selection_from_tty("Select release", releases, Some(0))?;
 
         let mut add_debian_repo = false;
@@ -224,6 +251,7 @@ fn action_add_mirror(config: &SectionConfigData) -> Result<Vec<MirrorConfig>, Er
                 }
 
                 let releases = match release {
+                    &Release::Bookworm => vec![(CephRelease::Quincy, "Quincy (17.x)")],
                     Release::Bullseye => {
                         vec![
                             (CephRelease::Octopus, "Octopus (15.x)"),
@@ -250,6 +278,7 @@ fn action_add_mirror(config: &SectionConfigData) -> Result<Vec<MirrorConfig>, Er
                     read_string_from_tty("Enter repository components", Some("main test"))?;
 
                 let key = match release {
+                    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",
                 };
@@ -281,6 +310,9 @@ fn action_add_mirror(config: &SectionConfigData) -> Result<Vec<MirrorConfig>, Er
 
                 // TODO enterprise query for key!
                 let url = match (release, variant) {
+                    (Release::Bookworm, ProxmoxVariant::Enterprise) => format!("https://enterprise.proxmox.com/debian/{product} bookworm {product}-enterprise"),
+                    (Release::Bookworm, ProxmoxVariant::NoSubscription) => format!("http://download.proxmox.com/debian/{product} bookworm {product}-no-subscription"),
+                    (Release::Bookworm, ProxmoxVariant::Test) => format!("http://download.proxmox.com/debian/{product} bookworm {product}test"),
                     (Release::Bullseye, ProxmoxVariant::Enterprise) => format!("https://enterprise.proxmox.com/debian/{product} bullseye {product}-enterprise"),
                     (Release::Bullseye, ProxmoxVariant::NoSubscription) => format!("http://download.proxmox.com/debian/{product} bullseye {product}-no-subscription"),
                     (Release::Bullseye, ProxmoxVariant::Test) => format!("http://download.proxmox.com/debian/{product} bullseye {product}test"),
@@ -297,6 +329,7 @@ fn action_add_mirror(config: &SectionConfigData) -> Result<Vec<MirrorConfig>, Er
                 };
 
                 let key = match release {
+                    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.30.2





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

* [pbs-devel] [PATCH proxmox-offline-mirror v2 2/2] add support for bookworm enterprise ceph repo
  2023-06-12 13:37 [pbs-devel] [PATCH proxmox-offline-mirror v2 0/2] POM support bookworm releases and ceph enterprise repo Stefan Sterz
  2023-06-12 13:37 ` [pbs-devel] [PATCH proxmox-offline-mirror v2 1/2] add bookworm to the list of releases Stefan Sterz
@ 2023-06-12 13:37 ` Stefan Sterz
  2023-06-16  8:05 ` [pbs-devel] applied-series: [PATCH proxmox-offline-mirror v2 0/2] POM support bookworm releases and ceph enterprise repo Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Sterz @ 2023-06-12 13:37 UTC (permalink / raw)
  To: pbs-devel

the bookworm release of proxmox ve comes along with a new ceph
enterprise repo. this commit adds support for this new repo for
bookworm-based releases.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
---
 src/bin/proxmox-offline-mirror.rs | 37 ++++++++++++++++++++++++++-----
 1 file changed, 32 insertions(+), 5 deletions(-)

diff --git a/src/bin/proxmox-offline-mirror.rs b/src/bin/proxmox-offline-mirror.rs
index e2282d7..f5be2c0 100644
--- a/src/bin/proxmox-offline-mirror.rs
+++ b/src/bin/proxmox-offline-mirror.rs
@@ -1,4 +1,5 @@
 use std::fmt::Display;
+use std::matches;
 use std::path::Path;
 
 use anyhow::{bail, format_err, Error};
@@ -274,8 +275,36 @@ fn action_add_mirror(config: &SectionConfigData) -> Result<Vec<MirrorConfig>, Er
                     Some(releases.len() - 1),
                 )?;
 
-                let components =
-                    read_string_from_tty("Enter repository components", Some("main test"))?;
+                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 variant =
+                        read_selection_from_tty("Select repository variant", variants, Some(0))?;
+
+                    match variant {
+                        ProxmoxVariant::Enterprise => (
+                            "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(),
+                        ),
+                    }
+                } else {
+                    (
+                        "http://download.proxmox.com/debian/ceph",
+                        read_string_from_tty("Enter repository components", Some("main test"))?,
+                    )
+                };
 
                 let key = match release {
                     Release::Bookworm => "/etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg",
@@ -291,9 +320,7 @@ fn action_add_mirror(config: &SectionConfigData) -> Result<Vec<MirrorConfig>, Er
                     CephRelease::Quincy => "quincy",
                 };
 
-                let url = format!(
-                    "http://download.proxmox.com/debian/ceph-{ceph_release} {release} {components}"
-                );
+                let url = format!("{base_url}-{ceph_release} {release} {components}");
                 let suggested_id = format!("ceph_{ceph_release}_{release}");
 
                 (url, key.to_string(), suggested_id, SkipConfig::default())
-- 
2.30.2





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

* [pbs-devel] applied-series: [PATCH proxmox-offline-mirror v2 0/2] POM support bookworm releases and ceph enterprise repo
  2023-06-12 13:37 [pbs-devel] [PATCH proxmox-offline-mirror v2 0/2] POM support bookworm releases and ceph enterprise repo Stefan Sterz
  2023-06-12 13:37 ` [pbs-devel] [PATCH proxmox-offline-mirror v2 1/2] add bookworm to the list of releases Stefan Sterz
  2023-06-12 13:37 ` [pbs-devel] [PATCH proxmox-offline-mirror v2 2/2] add support for bookworm enterprise ceph repo Stefan Sterz
@ 2023-06-16  8:05 ` Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2023-06-16  8:05 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Stefan Sterz

Am 12/06/2023 um 15:37 schrieb Stefan Sterz:
> these two patches add support for the bookworm-based proxmox releases
> and also the ceph enterprise repo.
> 
> changes since v1:
> 
> * adapted the keys that the setup wizzard uses to match those actually
>   used by debian now that bookworm has been released.
> 
> Stefan Sterz (2):
>   add bookworm to the list of releases
>   add support for bookworm enterprise ceph repo
> 
>  src/bin/proxmox-offline-mirror.rs | 72 ++++++++++++++++++++++++++++---
>  1 file changed, 66 insertions(+), 6 deletions(-)
> 


applied series, thanks!




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

end of thread, other threads:[~2023-06-16  8:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12 13:37 [pbs-devel] [PATCH proxmox-offline-mirror v2 0/2] POM support bookworm releases and ceph enterprise repo Stefan Sterz
2023-06-12 13:37 ` [pbs-devel] [PATCH proxmox-offline-mirror v2 1/2] add bookworm to the list of releases Stefan Sterz
2023-06-12 13:37 ` [pbs-devel] [PATCH proxmox-offline-mirror v2 2/2] add support for bookworm enterprise ceph repo Stefan Sterz
2023-06-16  8:05 ` [pbs-devel] applied-series: [PATCH proxmox-offline-mirror v2 0/2] POM support bookworm releases and ceph enterprise repo Thomas Lamprecht

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