Commit Graph

247 Commits

Author SHA1 Message Date
Christoph Heiss
483acf3376 pom: add support for ceph squid 19.x release
Ceph Squid has been available through all of our Ceph repositories since
October 2024 [0], so it should be mirror-able through POM as well.

Reported in the forum [1].

[0] https://forum.proxmox.com/threads/ceph-19-2-squid-stable-release-and-ceph-17-2-quincy-soon-to-be-eol.156433/
[1] https://forum.proxmox.com/threads/ceph-squid-not-availbale-in-proxmox-offline-mirror.164230/

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2025-03-27 16:32:15 +01:00
Fabian Grünbichler
e7242f1219 d/control: update B-D
using debcargo deb-dependencies

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2025-03-13 14:15:17 +01:00
Fabian Grünbichler
a48e736f12 d/control: switch to Static-Built-Using
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2025-03-13 14:07:28 +01:00
Maximiliano Sandoval
648bac09cc cargo: run fmt
See the following links for the 2024 edition formatting changes:
- https://doc.rust-lang.org/edition-guide/rust-2024/rustfmt-formatting-fixes.html
- https://doc.rust-lang.org/edition-guide/rust-2024/rustfmt-version-sorting.html

These format changes come exclusively from the edition and not from
upgrading rustfmt to 1.85.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2025-03-03 13:26:41 +01:00
Maximiliano Sandoval
b9f06d1e43 cargo: update to edition 2024
This requires 1.85.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2025-03-03 13:26:41 +01:00
Maximiliano Sandoval
84b473978f mirror: remove redundant ref in if-let pattern
Discovered by `cargo fix --edition`.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2025-03-03 13:26:41 +01:00
Fabian Grünbichler
17de3e6a36 d/rules: mark as executable
to avoid dpkg-source complaining

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2025-02-12 10:28:39 +01:00
Maximiliano Sandoval
3f77845cc2 cargo: update proxmox-schema dep to 4.0
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2025-02-12 10:28:17 +01:00
Maximiliano Sandoval
3bcbbb298e cargo: use shorter version format for sequoia-openpgp
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2025-02-12 10:28:17 +01:00
Maximiliano Sandoval
0778b9944a verifier: elide lifetimes when possible
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2025-01-14 09:01:10 +01:00
Fabian Grünbichler
3325e6c325 partially-fix #5958: doc: add additional example for debug packages
our repositories don't override their section to debug, and they can get quite
big..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-12-09 19:51:47 +01:00
Maximiliano Sandoval
25d5e5e640 cargo: update proxmox-subscription to version 0.5.0
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-12-05 09:38:04 +01:00
Thomas Lamprecht
e422022f2c d/lintian-overrides: ignore overly long X-Cargo-Built-Using fielt
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-09-06 18:04:02 +02:00
Thomas Lamprecht
a5f6a9c191 bump version to 0.6.7
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-09-06 18:03:33 +02:00
Thomas Lamprecht
49a8d26eb2 update proxmox-router to version 3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-09-06 18:03:33 +02:00
Daniel Kral
d4a4d278b3 docs: fix command arguments for syncing a medium
Fixes a minor error in the documentation about syncing a medium, where
the id for a medium is falsely provided with a `--id <id>` argument.

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
2024-09-06 17:37:02 +02:00
Wolfgang Bumiller
069897c77f style fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-30 11:20:55 +02:00
Shannon Sterz
12ada78b95 verifier: add ability to verify with keyrings
some vendors don't just provide a single certificate but an entire
keyring for their repositories. apt can handle those gracefully, so
should we. this commit adds the ability to verify a repository's
signatures with a keyring.

we use `PacketParserEOF` to check if a stream of packets is likely a
single certificate or a keyring. if it is a keyring, we try to verify a
message with all certificates in the ring and only fail if no
certificate can verify the message.

Reported-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
2024-08-30 11:01:43 +02:00
Wolfgang Bumiller
f9b052b135 replace manual matching with const unwrap_any_object_schema()
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-28 15:02:45 +02:00
Wolfgang Bumiller
451129ce9b require schema 3.1.4 for const unwrap_any_object_schema
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-28 15:01:41 +02:00
Maximiliano Sandoval
db9cee44e6 remove lazy_static dependency
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-08-28 14:26:49 +02:00
Wolfgang Bumiller
65e9da96fb fix a dead_code warning
It's a guard for the file lock which is meant to just stick around
until dropped, it does not need to be otherwise used.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-08-28 14:26:20 +02:00
Fabian Grünbichler
c6f21980f3 build: execute dh-cargo-built-using
this ensures the X-Cargo-Built-Using (and soon, Static-Built-Using) substvars
are actually filled with contents, and allow to find out which rustc version
and dependency versions were used to build a particular binary package.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-07-22 19:03:07 +02:00
Fabian Grünbichler
2cd3578c0d build: use cargo wrapper
for package builds to ensure all common flags are actually set.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-07-22 19:03:07 +02:00
Maximiliano Sandoval
9ca8c35ab5 update to proxmox-sys 0.6
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-07-17 10:34:33 +02:00
Fabian Grünbichler
15254c1755 various clippy fixes
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-07-10 11:58:49 +02:00
Stoiko Ivanov
089314eaa7 pool: remove unused imports
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2024-07-10 11:31:08 +02:00
Stoiko Ivanov
24c697e8cd pool: gc: remove empty directories under link_dir
garbage collection currently is quite aggressive in removing all files
under the link_dir, which are not a hard-link to a checksum file.
removing directories that remain empty below the link_dir should thus
not too dangerous.

without this patch, removing a snapshot on a mirror, running gc there,
and syncing everything to a medium, leaves the medium with an
hierarchy of empty directories below the removed snapshot (the files
get cleaned up the directories remain).

using WalkDir::content_first() seems better than to check for
emptiness after each file-removal [0]

[0] https://docs.rs/walkdir/latest/walkdir/struct.WalkDir.html#method.contents_first

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2024-07-10 11:31:08 +02:00
Stoiko Ivanov
2089e5d4b0 pool: unlink_file: fix check for empty directory
path.is_empty() checks for the empty-path, not an empty directory [0].
as the check that the path is below the link_dir happens anyways in
the if we can directly call std::fs::remove_dir (which is even safer
than the std::fs::remove_dir_all call used in pool::remove_dir()).

the oversight seems to have been in place since the intial commit. I
ran across the issue when removing many snapshots of a Debian Bookworm
repository, syncing this to a medium, and still having a vast amount
of empty directories left behind (as debian has one directory per
package), which in turn increases the sync run-time.

[0] https://docs.rs/nix/latest/nix/trait.NixPath.html#tymethod.is_empty

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2024-07-10 11:31:08 +02:00
Stoiko Ivanov
c92573acd1 pool: drop superfluous check for impossible path combination
commit c598cb154e changed the pool
layout to have the pool directory (.pool for a mirror) on the same
level as the link directory (instead of below), to enable pool-sharing
across multiple mirrors.

the condition will never be true, drop the if statement to avoid
confusion in the future.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2024-07-10 11:31:08 +02:00
Stoiko Ivanov
305b9e1b2b bump proxmox-apt to 0.11 and adapt to changes.
The recent changes to proxmox-apt along with the introduction of the
proxmox_apt_apit_types crate led to the following changes.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2024-07-10 11:15:34 +02:00
Stoiko Ivanov
bd85cf4b59 bump proxmox-time to 2.0
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2024-06-25 10:57:01 +02:00
Fabian Grünbichler
3a1277ec00 move .cargo/config to .cargo/config.toml
the old location has been deprecated for a while, and rustc 1.78 will start to warn about it.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-20 12:28:13 +02:00
Fabian Grünbichler
a5a6d2aed0 build: force debug symbols in release build
they then get stripped into their own package anyway, but without this we don't
get debug symbols at all with rustc >= 1.77

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-20 10:04:20 +02:00
Thomas Lamprecht
b2846c2899 bump version to 0.6.6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-19 09:02:12 +02:00
Thomas Lamprecht
f1ef7f8c42 update proxmox-apt to 0.10.9
To allow repos that have packages without priority field in the index

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-19 09:01:10 +02:00
Thomas Lamprecht
7428e311da bump version to 0.6.5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-02-21 12:52:19 +01:00
Maximiliano Sandoval
373a3ed3e0 verifier: elide explicit lifetime
Fixes the clippy lint:

```
warning: the following explicit lifetimes could be elided: 'msg
  --> src/helpers/verifier.rs:93:32
   |
93 | pub(crate) fn verify_signature<'msg>(
   |                                ^^^^
94 |     msg: &'msg [u8],
   |           ^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
   = note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
   |
93 ~ pub(crate) fn verify_signature(
94 ~     msg: &[u8],
   |
```

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-02-21 12:13:33 +01:00
Maximiliano Sandoval
a3fe642062 remove needless borrows
Fixes the clippy lint
```
warning: the borrowed expression implements the required traits
   --> src/medium.rs:143:9
    |
143 |         &statefile(base),
    |         ^^^^^^^^^^^^^^^^ help: change this to: `statefile(base)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
    = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
```

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-02-21 12:13:30 +01:00
Thomas Lamprecht
5d183d04a6 d/rules: export version related environment variables for docs build
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-02-21 12:08:16 +01:00
Thomas Lamprecht
dd15694845 d/control: udpdate build-dependencies
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-02-21 12:02:44 +01:00
Thomas Lamprecht
550e4ccb05 cargo: update proxmox-schema dependency to 3
We have relatively small usage of the schema here, so no code change
required.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-02-12 17:20:42 +01:00
Thomas Lamprecht
94ce586afa docs: update copyright years
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-01-09 11:18:00 +01:00
Fabian Grünbichler
6c3e71ae89 bump version to 0.6.4
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-01-09 09:34:47 +01:00
Fabian Grünbichler
5a72d9fa0d cleanup: replace duplicate code with call to mirror_dir()
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-01-09 09:24:09 +01:00
Maximiliano Sandoval R
edf3cb2d6e mirror: Use PathBuf instead of strings for paths
Joining the strings might results in a double `//` in a path. This was
experienced in a ticket at our customer support in the following error:

    Error: unable to read
    "/var/lib/proxmox-offline-mirror/mirrors//.pool/sha256/<SOME_HASH>"
    - Input/output error (os error 5) after downloading ±60GB of data.

Suggested-by: Stefan Sterz <s.sterz@proxmox.com>
Signed-off-by: Maximiliano Sandoval R <m.sandoval@proxmox.com>
2024-01-09 09:22:10 +01:00
Fabian Grünbichler
f0ca1f3796 set MSRV to 1.70
needed for std::io::IsTerminal

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-01-09 09:17:05 +01:00
Maximiliano Sandoval R
5f7004f8dd use IsTerminal whenever possible
Continuation of https://lists.proxmox.com/pipermail/pbs-devel/2023-November/007078.html.

Signed-off-by: Maximiliano Sandoval R <m.sandoval@proxmox.com>

FG: adapted context

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-01-09 09:16:22 +01:00
Maximiliano Sandoval
971ec747dc docs: offline-media: Use correct config subcommand
There is no `config medium` subcommand.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-01-09 09:12:19 +01:00
Fabian Grünbichler
8fdb6bc67f build: encode minimum proxmox-subscription version
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-01-09 09:09:35 +01:00