]> git.proxmox.com Git - proxmox-offline-mirror.git/log
proxmox-offline-mirror.git
11 days agodocs: fix command arguments for syncing a medium master
Daniel Kral [Mon, 26 Aug 2024 15:11:07 +0000 (17:11 +0200)]
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>
2 weeks agostyle fixup
Wolfgang Bumiller [Fri, 30 Aug 2024 09:20:55 +0000 (11:20 +0200)]
style fixup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 weeks agoverifier: add ability to verify with keyrings
Shannon Sterz [Thu, 8 Aug 2024 14:25:18 +0000 (16:25 +0200)]
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>
2 weeks agoreplace manual matching with const unwrap_any_object_schema()
Wolfgang Bumiller [Wed, 28 Aug 2024 12:54:20 +0000 (14:54 +0200)]
replace manual matching with const unwrap_any_object_schema()

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 weeks agorequire schema 3.1.4 for const unwrap_any_object_schema
Wolfgang Bumiller [Wed, 28 Aug 2024 12:55:06 +0000 (14:55 +0200)]
require schema 3.1.4 for const unwrap_any_object_schema

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 weeks agoremove lazy_static dependency
Maximiliano Sandoval [Wed, 14 Aug 2024 07:23:47 +0000 (09:23 +0200)]
remove lazy_static dependency

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 weeks agofix a dead_code warning
Wolfgang Bumiller [Wed, 28 Aug 2024 12:26:19 +0000 (14:26 +0200)]
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>
8 weeks agobuild: execute dh-cargo-built-using
Fabian Grünbichler [Wed, 10 Jul 2024 11:57:23 +0000 (13:57 +0200)]
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>
8 weeks agobuild: use cargo wrapper
Fabian Grünbichler [Wed, 10 Jul 2024 11:57:22 +0000 (13:57 +0200)]
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>
2 months agoupdate to proxmox-sys 0.6
Maximiliano Sandoval [Tue, 16 Jul 2024 07:07:18 +0000 (09:07 +0200)]
update to proxmox-sys 0.6

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agovarious clippy fixes
Fabian Grünbichler [Wed, 10 Jul 2024 09:58:49 +0000 (11:58 +0200)]
various clippy fixes

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 months agopool: remove unused imports
Stoiko Ivanov [Tue, 9 Jul 2024 10:47:05 +0000 (12:47 +0200)]
pool: remove unused imports

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 months agopool: gc: remove empty directories under link_dir
Stoiko Ivanov [Tue, 9 Jul 2024 10:47:04 +0000 (12:47 +0200)]
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>
2 months agopool: unlink_file: fix check for empty directory
Stoiko Ivanov [Tue, 9 Jul 2024 10:47:03 +0000 (12:47 +0200)]
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>
2 months agopool: drop superfluous check for impossible path combination
Stoiko Ivanov [Tue, 9 Jul 2024 10:47:02 +0000 (12:47 +0200)]
pool: drop superfluous check for impossible path combination

commit c598cb154ef3fa6e1a8af840ded40f713d973d3d 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>
2 months agobump proxmox-apt to 0.11 and adapt to changes.
Stoiko Ivanov [Tue, 9 Jul 2024 10:47:01 +0000 (12:47 +0200)]
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>
2 months agobump proxmox-time to 2.0
Stoiko Ivanov [Mon, 24 Jun 2024 19:57:11 +0000 (21:57 +0200)]
bump proxmox-time to 2.0

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 months agomove .cargo/config to .cargo/config.toml
Fabian Grünbichler [Thu, 20 Jun 2024 10:28:13 +0000 (12:28 +0200)]
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>
2 months agobuild: force debug symbols in release build
Fabian Grünbichler [Thu, 20 Jun 2024 08:04:20 +0000 (10:04 +0200)]
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>
4 months agobump version to 0.6.6
Thomas Lamprecht [Fri, 19 Apr 2024 07:01:54 +0000 (09:01 +0200)]
bump version to 0.6.6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoupdate proxmox-apt to 0.10.9
Thomas Lamprecht [Fri, 19 Apr 2024 07:01:09 +0000 (09:01 +0200)]
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>
6 months agobump version to 0.6.5
Thomas Lamprecht [Wed, 21 Feb 2024 11:15:55 +0000 (12:15 +0100)]
bump version to 0.6.5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoverifier: elide explicit lifetime
Maximiliano Sandoval [Wed, 14 Feb 2024 09:27:30 +0000 (10:27 +0100)]
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>
6 months agoremove needless borrows
Maximiliano Sandoval [Wed, 14 Feb 2024 09:27:29 +0000 (10:27 +0100)]
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>
6 months agod/rules: export version related environment variables for docs build
Thomas Lamprecht [Wed, 21 Feb 2024 11:08:16 +0000 (12:08 +0100)]
d/rules: export version related environment variables for docs build

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agod/control: udpdate build-dependencies
Thomas Lamprecht [Wed, 21 Feb 2024 11:02:44 +0000 (12:02 +0100)]
d/control: udpdate build-dependencies

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agocargo: update proxmox-schema dependency to 3
Thomas Lamprecht [Mon, 12 Feb 2024 16:20:41 +0000 (17:20 +0100)]
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>
8 months agodocs: update copyright years
Thomas Lamprecht [Tue, 9 Jan 2024 10:18:00 +0000 (11:18 +0100)]
docs: update copyright years

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agobump version to 0.6.4
Fabian Grünbichler [Tue, 9 Jan 2024 08:34:47 +0000 (09:34 +0100)]
bump version to 0.6.4

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
8 months agocleanup: replace duplicate code with call to mirror_dir()
Fabian Grünbichler [Tue, 9 Jan 2024 08:24:09 +0000 (09:24 +0100)]
cleanup: replace duplicate code with call to mirror_dir()

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
8 months agomirror: Use PathBuf instead of strings for paths
Maximiliano Sandoval R [Tue, 21 Nov 2023 13:50:31 +0000 (14:50 +0100)]
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>
8 months agoset MSRV to 1.70
Fabian Grünbichler [Tue, 9 Jan 2024 08:17:05 +0000 (09:17 +0100)]
set MSRV to 1.70

needed for std::io::IsTerminal

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
8 months agouse IsTerminal whenever possible
Maximiliano Sandoval R [Fri, 17 Nov 2023 13:37:20 +0000 (14:37 +0100)]
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>
8 months agodocs: offline-media: Use correct config subcommand
Maximiliano Sandoval [Wed, 22 Nov 2023 09:49:40 +0000 (10:49 +0100)]
docs: offline-media: Use correct config subcommand

There is no `config medium` subcommand.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
8 months agobuild: encode minimum proxmox-subscription version
Fabian Grünbichler [Tue, 9 Jan 2024 08:09:35 +0000 (09:09 +0100)]
build: encode minimum proxmox-subscription version

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
8 months agoweak crypto: fix RSA config option
Fabian Grünbichler [Mon, 8 Jan 2024 08:41:05 +0000 (09:41 +0100)]
weak crypto: fix RSA config option

it accidentally re-used the config flag for DSA, instead of its own. seems like
there aren't too many of these repos around anymore (thankfully).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
8 months agodocs: add an auto dark mode to the docs
Stefan Sterz [Fri, 15 Dec 2023 10:52:29 +0000 (11:52 +0100)]
docs: add an auto dark mode to the docs

this adds the dark mode from the proxmox backup server to the offline
mirror for a more consistent appearance of the documentation across
all products.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
9 months agooffline mirror binary: rustfmt clean up
Stefan Sterz [Wed, 29 Nov 2023 14:51:16 +0000 (15:51 +0100)]
offline mirror binary: rustfmt clean up

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
9 months agohelper: improve handling of multiple keys when activating them
Stefan Sterz [Wed, 29 Nov 2023 14:51:15 +0000 (15:51 +0100)]
helper: improve handling of multiple keys when activating them

this commit fixes a behavior where pom would applied any subscription
key that matched the provided product. it did not check whether the
server id of the activated subscription matched the current system.
this commit fixes that and only allows applying subscriptions for the
current system.

it also adds a couple of ux improvements:

- the `offline-key` sub-command now does not require the `--product`
  parameter anymore. if there are multiple keys with different
  products for the same server we will try to activate them all. the
  assumption is that the user added all keys intentionally (e.g. a
  combo pbs+pve system) and would like to activate them all at once.
  since this only makes the api more permissive this shouldn't be a
  breaking change.
- if the `offline-key` sub-command encounters multiple subscription
  keys with the same product and server id, it only activates the one
  with the due date furthest in the future. this makes sense in a
  scenario where a user simply adds new subscription keys to their
  key medium without removing older ones (perhaps older subscriptions
  haven't even expired just yet).
- the interactive `setup` sub-command now only offers keys that have a
  matching server id. it also orders them in such a way that the top
  most key for a given product has the next due date furthest in the
  future.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
9 months agotype: move `ProductType` enum to `proxmox-subscription`
Stefan Sterz [Wed, 29 Nov 2023 14:51:14 +0000 (15:51 +0100)]
type: move `ProductType` enum to `proxmox-subscription`

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
9 months agobump version to 0.6.3
Thomas Lamprecht [Sat, 25 Nov 2023 16:22:35 +0000 (17:22 +0100)]
bump version to 0.6.3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 months agoadd missing subscription setting for ceph enterprise repos
Stefan Sterz [Tue, 21 Nov 2023 14:48:18 +0000 (15:48 +0100)]
add missing subscription setting for ceph enterprise repos

when setting up a ceph enterprise repo we didn't add a subscription
for it. this commit adds a pve subscription so that pom can properly
authenticate itself when mirroring the ceph enterprise repos.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
9 months agoadd support for ceph reef
Stefan Sterz [Tue, 21 Nov 2023 14:48:17 +0000 (15:48 +0100)]
add support for ceph reef

since it's the new default ceph release, add support for setting up
the ceph reef repos in the `setup` command.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
10 months agodocs: fix copied env variable documentation
Fabian Grünbichler [Wed, 15 Nov 2023 10:32:50 +0000 (11:32 +0100)]
docs: fix copied env variable documentation

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
11 months agoadd docs/ and package outputs to gitignore
Thomas Lamprecht [Thu, 12 Oct 2023 15:01:56 +0000 (17:01 +0200)]
add docs/ and package outputs to gitignore

and sort while at it

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agocargo: update dependencies
Thomas Lamprecht [Thu, 12 Oct 2023 15:01:35 +0000 (17:01 +0200)]
cargo: update dependencies

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
13 months agodocs: fix bullseye references
Fabian Grünbichler [Fri, 4 Aug 2023 09:07:16 +0000 (11:07 +0200)]
docs: fix bullseye references

the current version of POM is released for Debian 12 "Bookworm", update the
docs accordingly.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
14 months agoadd non-free-firmware to bookworm default components
Stefan Sterz [Mon, 17 Jul 2023 14:01:36 +0000 (16:01 +0200)]
add non-free-firmware to bookworm default components

this adds the non-free-firmware component introduced with debian
bookworm [1] to the default components for bookworm mirrors. since
this new component is a subset [2] of the previous "non-free"
component add it here too to keep the same set of packages available.

[1]: https://wiki.debian.org/Firmware#Debian_12_.28bookworm.29_and_later
[2]: https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.en.html#non-free-split

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
14 months agobump version to 0.6.2
Thomas Lamprecht [Thu, 29 Jun 2023 13:04:16 +0000 (15:04 +0200)]
bump version to 0.6.2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
14 months agobump proxmox-apt dependency to 0.10.3
Thomas Lamprecht [Thu, 29 Jun 2023 13:02:55 +0000 (15:02 +0200)]
bump proxmox-apt dependency to 0.10.3

to get the component fixup for Debian security repo also for the
bookworm suite

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
14 months agobuildsys: fixup update-dcontrol somewhat
Thomas Lamprecht [Thu, 29 Jun 2023 13:02:15 +0000 (15:02 +0200)]
buildsys: fixup update-dcontrol somewhat

still not really doing the right thing, just want a "update
d/control" helper...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
14 months agod/rules: patch out wrongly linked libraries from ELFs
Thomas Lamprecht [Sat, 17 Jun 2023 09:24:25 +0000 (11:24 +0200)]
d/rules: patch out wrongly linked libraries from ELFs

Adapted from proxmox-backup's 198ebc6c ("d/rules: patch out wrongly
linked libraries from ELFs")

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 months agobump version to 0.6.1
Thomas Lamprecht [Fri, 16 Jun 2023 07:29:44 +0000 (09:29 +0200)]
bump version to 0.6.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 months agoadd support for bookworm enterprise ceph repo
Stefan Sterz [Mon, 12 Jun 2023 13:37:15 +0000 (15:37 +0200)]
add support for bookworm enterprise ceph repo

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>
15 months agoadd bookworm to the list of releases
Stefan Sterz [Mon, 12 Jun 2023 13:37:14 +0000 (15:37 +0200)]
add bookworm to the list of releases

add support for bookworm based proxmox products and debian
repositories/

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
15 months agobump version to 0.6.0
Thomas Lamprecht [Tue, 30 May 2023 11:56:26 +0000 (13:56 +0200)]
bump version to 0.6.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 months agobuildsys: derive upload dist automatically
Thomas Lamprecht [Tue, 30 May 2023 11:56:15 +0000 (13:56 +0200)]
buildsys: derive upload dist automatically

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 months agobuildsys: introduce accumulative DEBS variable as convenience
Thomas Lamprecht [Tue, 30 May 2023 11:55:19 +0000 (13:55 +0200)]
buildsys: introduce accumulative DEBS variable as convenience

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 months agobuildsys: use correct DEB_HOST_ARCH
Thomas Lamprecht [Tue, 30 May 2023 11:54:43 +0000 (13:54 +0200)]
buildsys: use correct DEB_HOST_ARCH

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 months agobuildsys: improve DSC target & add sbuild convenience target
Thomas Lamprecht [Tue, 30 May 2023 11:52:28 +0000 (13:52 +0200)]
buildsys: improve DSC target & add sbuild convenience target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 months agod/control: add missing ${misc:Depends}
Thomas Lamprecht [Tue, 30 May 2023 11:51:35 +0000 (13:51 +0200)]
d/control: add missing ${misc:Depends}

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 months agofixup! makefile: convert to use simple parenthesis
Thomas Lamprecht [Tue, 30 May 2023 11:51:07 +0000 (13:51 +0200)]
fixup! makefile: convert to use simple parenthesis

15 months agoavoid debcargo on build
Thomas Lamprecht [Tue, 30 May 2023 11:48:40 +0000 (13:48 +0200)]
avoid debcargo on build

Switch over to a more manual build oriented on proxmox-backup and
pve-lxc-syscalld.

nothing against debcargo directly, but currently it's really tailored
to Debians re-package upstream crate needs, and that shows.

Once we can generate control files from it without requiring all
build dependencies, and potentially some other stuff fixed, we could
re-introduce it.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 months agodrop librust-proxmox-offline-mirror-dev package
Thomas Lamprecht [Tue, 30 May 2023 11:45:10 +0000 (13:45 +0200)]
drop librust-proxmox-offline-mirror-dev package

was only auto-generated by debcargo/dh-cargo but we never uploaded it
nor used it anywhere FWICT

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 months agod/control: define compat level via build-depends and raise to 13
Thomas Lamprecht [Tue, 30 May 2023 11:10:47 +0000 (13:10 +0200)]
d/control: define compat level via build-depends and raise to 13

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 months agoupdate dependencies for current bookworm state
Thomas Lamprecht [Tue, 30 May 2023 11:10:36 +0000 (13:10 +0200)]
update dependencies for current bookworm state

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 months agomakefile: convert to use simple parenthesis
Thomas Lamprecht [Tue, 30 May 2023 10:24:45 +0000 (12:24 +0200)]
makefile: convert to use simple parenthesis

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 months agodebian: wrap-and-sort -tkn
Thomas Lamprecht [Tue, 30 May 2023 09:24:36 +0000 (11:24 +0200)]
debian: wrap-and-sort -tkn

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agocargo fmt
Thomas Lamprecht [Mon, 24 Apr 2023 09:46:56 +0000 (11:46 +0200)]
cargo fmt

seems I forgot to save the vim buffer after running this inline..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agofix #4614: add note about key requirements to mirror docs
Fabian Grünbichler [Tue, 18 Apr 2023 08:58:57 +0000 (10:58 +0200)]
fix #4614: add note about key requirements to mirror docs

and reference the key part of the documentation.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
16 months agosetup wizard: add subscription keys
Fabian Grünbichler [Tue, 18 Apr 2023 08:58:56 +0000 (10:58 +0200)]
setup wizard: add subscription keys

to make it a bit easier to configure access to the enterprise repositories.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
 [ T: added missing use statement for format_err ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agofix compat with proxmox-router
Fabian Grünbichler [Mon, 17 Apr 2023 12:32:59 +0000 (14:32 +0200)]
fix compat with proxmox-router

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
17 months agodrop already finished TODO
Fabian Grünbichler [Thu, 6 Apr 2023 11:54:20 +0000 (13:54 +0200)]
drop already finished TODO

we did settle on 'pom' as key prefix in the end.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
17 months agoconfig: properly skip serializing empty weak_crypto
Fabian Grünbichler [Thu, 6 Apr 2023 11:53:43 +0000 (13:53 +0200)]
config: properly skip serializing empty weak_crypto

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
17 months agofix #4261: allow GC for all configured mirrors
Fabian Grünbichler [Tue, 4 Apr 2023 11:21:15 +0000 (13:21 +0200)]
fix #4261: allow GC for all configured mirrors

by making the --id parameter optional, and structuring the output accordingly.
since pools are per base-dir, GC only needs to run once per base-dir instead of
for each mirror entry.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
17 months agopool: drop redundant quote for paths..
Fabian Grünbichler [Tue, 4 Apr 2023 11:21:14 +0000 (13:21 +0200)]
pool: drop redundant quote for paths..

a Path(Buf)'s Debug formatting already contains double quotes, no need to quote
it a second time..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
17 months agofix #4632: allow escape hatches for legacy repositories
Fabian Grünbichler [Tue, 4 Apr 2023 07:48:21 +0000 (09:48 +0200)]
fix #4632: allow escape hatches for legacy repositories

there are still repositories out there that are using things like DSA/RSA-1024
and SHA1, so let's allow POM users to opt into accepting those insecure
cryptographic parameters, but keep the default settings secure.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
17 months agoimprove GPG error messages
Fabian Grünbichler [Tue, 4 Apr 2023 07:48:20 +0000 (09:48 +0200)]
improve GPG error messages

e.g., when encoutering a key that is self-signed with SHA-1 (which is not that
uncommon for non-distro repositories that have an old key), instead of the
following:

----8<----
Fetching Release/Release.gpg files
-> GET 'https://download.ceph.com/debian-quincy//dists/bullseye/Release.gpg'..
-> GET 'https://download.ceph.com/debian-quincy//dists/bullseye/Release'..
Verifying 'Release(.gpg)' signature using provided repository key..
Subkey of 08B73419AC32B4E966C1A330E84AC2C0460F3994 not bound: No binding signature at time 2022-10-17T22:41:10Z
Error: encountered 1 error(s)
---->8----

which only gives us a rought idea that something is wrong with a key signature,
we now get the following:

----8<----
Fetching Release/Release.gpg files
-> GET 'https://download.ceph.com/debian-quincy//dists/bullseye/Release.gpg'..
-> GET 'https://download.ceph.com/debian-quincy//dists/bullseye/Release'..
Verifying 'Release(.gpg)' signature using provided repository key..

Subkey of 08B73419AC32B4E966C1A330E84AC2C0460F3994 not bound: No binding signature at time 2022-10-17T22:41:10Z
Caused by:
0: Policy rejected non-revocation signature (PositiveCertification) requiring second pre-image resistance
1: SHA1 is not considered secure since 2023-02-01T00:00:00Z

Error: No valid signature found.
---->8----

which shows us that the key signature was rejected because it's SHA-1, and the
(default and currently only) policy doesn't allow that (anymore).

the output is also improved in case the Release file is signed multiple times
and none of the signatures are accepted.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
17 months agoactually include version in user-agent
Fabian Grünbichler [Fri, 3 Mar 2023 11:18:59 +0000 (12:18 +0100)]
actually include version in user-agent

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
18 months agoupdate d/control
Fabian Grünbichler [Fri, 3 Mar 2023 11:16:26 +0000 (12:16 +0100)]
update d/control

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
18 months agoupdate proxmox-http to 0.8
Fabian Grünbichler [Fri, 3 Mar 2023 09:51:45 +0000 (10:51 +0100)]
update proxmox-http to 0.8

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
19 months agod/control: update
Thomas Lamprecht [Tue, 7 Feb 2023 14:41:59 +0000 (15:41 +0100)]
d/control: update

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
19 months agobump version to 0.5.1-1
Thomas Lamprecht [Tue, 7 Feb 2023 14:35:54 +0000 (15:35 +0100)]
bump version to 0.5.1-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
19 months agodocs: document `ALL_PROXY` environment variable
Lukas Wagner [Thu, 19 Jan 2023 10:40:41 +0000 (11:40 +0100)]
docs: document `ALL_PROXY` environment variable

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
19 months agofix #4445: mirror: subscription: add proxy support
Lukas Wagner [Thu, 19 Jan 2023 10:40:40 +0000 (11:40 +0100)]
fix #4445: mirror: subscription: add proxy support

This commit adds support for HTTP proxies, configurable via the
ALL_PROXY environment variable.

For example:
  $ ALL_PROXY="localhost:3128" proxmox-offline-mirror mirror <...>

Note: `ureq` seems to use HTTP CONNECT for *all* connections, including
HTTP on port 80. Proxies need to be configured to allow that - Squid by
default allows CONNECT only for HTTPS on port 443.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
20 months agoadd missing build dependencies
Fabian Grünbichler [Thu, 5 Jan 2023 13:19:10 +0000 (14:19 +0100)]
add missing build dependencies

found by building with sbuild in a clean chroot.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
20 months agoupdate to nix 0.26.1
Fabian Grünbichler [Thu, 5 Jan 2023 13:18:59 +0000 (14:18 +0100)]
update to nix 0.26.1

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
20 months agoupdate d/control
Fabian Grünbichler [Thu, 5 Jan 2023 09:19:28 +0000 (10:19 +0100)]
update d/control

after debcargo update

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
22 months agobump version to 0.5.0-1
Thomas Lamprecht [Sat, 22 Oct 2022 15:01:11 +0000 (17:01 +0200)]
bump version to 0.5.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
22 months agoguided setup: add Quincy as supported release for bullseye
Thomas Lamprecht [Sat, 22 Oct 2022 14:37:01 +0000 (16:37 +0200)]
guided setup: add Quincy as supported release for bullseye

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
22 months agomirror wizard: remove stray ':' from filter query
Fabian Grünbichler [Fri, 21 Oct 2022 11:11:37 +0000 (13:11 +0200)]
mirror wizard: remove stray ':' from filter query

the query helper already adds the final ':'.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
22 months agoclippy fixup
Wolfgang Bumiller [Fri, 21 Oct 2022 11:00:35 +0000 (13:00 +0200)]
clippy fixup

It's internal to the fn and the types are all written out
and visible so it's arguably fine this way.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
22 months agohelper: add status command
Fabian Grünbichler [Wed, 21 Sep 2022 11:04:07 +0000 (13:04 +0200)]
helper: add status command

similar to `proxmox-offline-mirror medium status <ID>`, but limited to
the information that is stored on the medium itself. this command can be
used to get a quick overview over what's on a medium, or for automated
setup of the contained repositories.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
22 months agohelper: make mountpoint non-optional
Fabian Grünbichler [Wed, 21 Sep 2022 11:04:06 +0000 (13:04 +0200)]
helper: make mountpoint non-optional

the default/fallback was a remnant from a no-longer-employed
"copy-helper-to-medium" deployment strategy.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
22 months agocargo fmt
Wolfgang Bumiller [Fri, 21 Oct 2022 10:49:43 +0000 (12:49 +0200)]
cargo fmt

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
22 months agodocs: add section/package filters
Fabian Grünbichler [Fri, 21 Oct 2022 09:12:44 +0000 (11:12 +0200)]
docs: add section/package filters

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
22 months agomirror setup: query filters in guided mode
Fabian Grünbichler [Fri, 21 Oct 2022 09:12:43 +0000 (11:12 +0200)]
mirror setup: query filters in guided mode

with a somewhat sensible default of filtering the games and debug
sections - which already reduces a mirror of PVE + Debian bullseye by
about 27% (105GB->77GB).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
22 months agomirror: also filter {component}/{section}
Fabian Grünbichler [Fri, 21 Oct 2022 09:12:42 +0000 (11:12 +0200)]
mirror: also filter {component}/{section}

so that a single filter 'games' covers all related sections for a stock
Debian repository.

this also has the side-effect that package downloads are now batched by
component.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
22 months agomirror, pool: fix comment text width
Thomas Lamprecht [Thu, 20 Oct 2022 12:32:14 +0000 (14:32 +0200)]
mirror, pool: fix comment text width

rustfmt ignores those...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agomirror: refactor fetch_binary/source_packages
Fabian Grünbichler [Tue, 18 Oct 2022 09:20:40 +0000 (11:20 +0200)]
mirror: refactor fetch_binary/source_packages

and pull out some of the progress variables into a struct.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>