]> git.proxmox.com Git - proxmox-offline-mirror.git/log
proxmox-offline-mirror.git
4 days agobump version to 0.6.6 master
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 days 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
5 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>
6 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>
6 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>
8 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>
9 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>
9 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>
9 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>
9 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>
9 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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

10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
13 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>
13 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>
14 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>
14 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>
14 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>
14 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>
15 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>
15 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>
15 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>
18 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>
18 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>
18 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>
18 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>
18 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>
18 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>
18 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>
18 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>
18 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>
18 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>
18 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>
18 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>
18 months agofix #4264: only require either Release or InRelease
Fabian Grünbichler [Tue, 18 Oct 2022 09:20:39 +0000 (11:20 +0200)]
fix #4264: only require either Release or InRelease

strictly speaking InRelease is required, and Release optional, but that
might not be true for older repositories. treat failure to fetch either
as non-fatal, provided the other is available.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
18 months agomirror: implement source packages mirroring
Fabian Grünbichler [Tue, 18 Oct 2022 09:20:38 +0000 (11:20 +0200)]
mirror: implement source packages mirroring

similar to the binary package one, but with one additional layer since
each source package consists of 2-3 files, not a single .deb file.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
18 months agomirror: add exclusion of packages/sections
Fabian Grünbichler [Tue, 18 Oct 2022 09:20:37 +0000 (11:20 +0200)]
mirror: add exclusion of packages/sections

to keep the size of mirror snapshots down by excluding unnecessary files
(e.g., games data, browsers, debug packages, ..).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
18 months agocargo: update proxmox-apt to 0.9.3
Thomas Lamprecht [Wed, 19 Oct 2022 14:22:42 +0000 (16:22 +0200)]
cargo: update proxmox-apt to 0.9.3

to get new source index support and 'section' struct field in
preparation of new features

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
18 months agod/debcargo.toml: add missing B-D
Fabian Grünbichler [Tue, 18 Oct 2022 08:23:15 +0000 (10:23 +0200)]
d/debcargo.toml: add missing B-D

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
18 months agobuildsys: avoid that build directory is created by phony target
Thomas Lamprecht [Mon, 17 Oct 2022 06:33:28 +0000 (08:33 +0200)]
buildsys: avoid that build directory is created by phony target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
18 months agocli: allow listing snapshots of all mirrors
Fabian Grünbichler [Wed, 21 Sep 2022 08:12:42 +0000 (10:12 +0200)]
cli: allow listing snapshots of all mirrors

and slightly change the output format accordingly.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
18 months agomedium: add diff command
Fabian Grünbichler [Wed, 21 Sep 2022 08:12:41 +0000 (10:12 +0200)]
medium: add diff command

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
18 months agosnapshots: add diff command
Fabian Grünbichler [Wed, 21 Sep 2022 08:12:40 +0000 (10:12 +0200)]
snapshots: add diff command

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
18 months agopool: add diff and list helpers
Fabian Grünbichler [Wed, 21 Sep 2022 08:12:39 +0000 (10:12 +0200)]
pool: add diff and list helpers

one for diffing two relative paths within a pool (e.g., for comparing
snapshots), one for diffing two pools (e.g., for diffing mirror and
mirror on medium), and one for listing paths.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
19 months agoclippy fixups
Wolfgang Bumiller [Fri, 23 Sep 2022 12:29:23 +0000 (14:29 +0200)]
clippy fixups

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
19 months agoerror handling cleanup
Wolfgang Bumiller [Fri, 23 Sep 2022 12:24:49 +0000 (14:24 +0200)]
error handling cleanup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
19 months agomirror: collect and summarize warnings
Fabian Grünbichler [Fri, 23 Sep 2022 10:33:52 +0000 (12:33 +0200)]
mirror: collect and summarize warnings

the output can get quite long and warnings can easily be missed
otherwise.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
19 months agofix #4259: mirror: add ignore-errors option
Fabian Grünbichler [Fri, 23 Sep 2022 10:33:51 +0000 (12:33 +0200)]
fix #4259: mirror: add ignore-errors option

to make fetching errors from broken repositories non-fatal.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
19 months agobump version to 0.4.0-1
Thomas Lamprecht [Fri, 16 Sep 2022 12:26:02 +0000 (14:26 +0200)]
bump version to 0.4.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
19 months agocli: add `mirror snapshot create-all` command
Fabian Grünbichler [Fri, 16 Sep 2022 10:35:35 +0000 (12:35 +0200)]
cli: add `mirror snapshot create-all` command

that creates a new snapshot for each configured mirror, collecting the
results and printing a summary at the end. this should be suitable for
usage in a cron job or timer-triggered unit, with no output on stderr
for 100% OK execution runs.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
19 months agocli: extract subscription key helper
Fabian Grünbichler [Fri, 16 Sep 2022 10:35:34 +0000 (12:35 +0200)]
cli: extract subscription key helper

for re-use in the (not-yet-created) create-all command.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
19 months agomirror: add --dry-run parameter
Fabian Grünbichler [Fri, 16 Sep 2022 10:35:33 +0000 (12:35 +0200)]
mirror: add --dry-run parameter

in dry-run mode, creating a snapshot will download (but not persist) the
Release files and any indices referenced within, but not download the
package files themselves. instead, any URLs that would still need to be
fetched are printed, and the statistics about to-be-fetched files and
bytes is updated accordingly.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
19 months agocargo: bump proxmox-apt dependency to 0.9.2
Thomas Lamprecht [Fri, 16 Sep 2022 12:20:37 +0000 (14:20 +0200)]
cargo: bump proxmox-apt dependency to 0.9.2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>