Commit Graph
2864 Commits
Author SHA1 Message Date
Hansjoerg Maurer bcb34b7140 Test architecture variant package persistence 2026-11-05 21:00:37 +01:00
Hansjoerg Maurer 38290613f3 Handle architecture variants in package reference lists 2026-11-05 21:00:37 +01:00
Hansjoerg Maurer 248296ddbf Add package identity support for architecture variants 2026-11-05 21:00:37 +01:00
André Roth f72347a0a8 Merge pull request #1650 from Rascalov/mirror-update-max-versions
Add `-max-versions` to get the N most recent versions of a package.
2026-11-05 13:29:10 +01:00
André Roth 151f67a294 fix merge conflicts 2026-11-05 12:51:13 +01:00
Rascalov 300837fe06 tests: cover mirror update -max-versions in system and unit tests 2026-11-05 11:22:28 +01:00
Rascalov 0609ac257a mirror update: clarify -max-versions output 2026-11-05 11:22:28 +01:00
Rascalov 78cd0c71ca docs: document mirror update -max-versions 2026-11-05 11:22:28 +01:00
Rascalov d7e58623a9 deb: add tests for keeping the N most recent versions 2026-11-05 11:22:28 +01:00
Rascalov 5bc1047ba8 mirror update: add -max-versions to keep the N most recent versions 2026-11-05 11:21:36 +01:00
André Roth 296e901cb6 Merge pull request #1633 from barnumbirr/concurrent-index-renames
deb: rename published indexes concurrently
2026-11-04 13:38:01 +01:00
Martin Simon b80f151b6d deb: make the index rename concurrency configurable
publishRenameConcurrency (publish_rename_concurrency in YAML) sets how
many index files RenameFiles renames at once. It defaults to 4, the
value that was hard-coded, and 1 renames them one at a time. Values
below 1 are treated as 1, since a semaphore with no capacity would
never admit a rename.

The setting is global rather than per publishing endpoint because the
renames run against every storage backend, not only S3.
2026-11-04 12:24:18 +01:00
Martin Simon c531cac535 deb: rename published indexes concurrently
RenameFiles walks renameMap one entry at a time. Every rename is a round trip,
and on an S3 backend RenameFile is a CopyObject followed by a DeleteObject, so
a publish that rewrites a dozen indexes spends most of its wall clock waiting
on them in sequence.

Bounded at four in flight, matching the default used for concurrent package
uploads. The first error is returned rather than the last, and the remaining
renames still run, so a failure does not leave part of the set staged behind a
half-finished switch.

Measured against MinIO behind a proxy adding 50ms each way, publishing a
repository whose Contents is dominated by one package carrying 19,500 files:
publish update drops from 2703ms to 1624ms median, n=5 either side, a 40% cut.
The published object set and its sizes are identical before and after.

RenameFiles had no test coverage. It has four cases now: every entry renamed,
the concurrency limit respected, a failure reported without abandoning the
rest, and an empty rename map.
2026-11-04 12:24:18 +01:00
André Roth 6f95fdca32 Merge pull request #1660 from barnumbirr/complete-default-config
conf: document the config keys missing from aptly.conf and the man page
2026-11-04 12:12:19 +01:00
André Roth 5eb3a8dc93 Merge pull request #1661 from barnumbirr/fix-misspelled-config-keys
conf: fix two misspelled keys in the default aptly.conf
2026-11-04 12:10:55 +01:00
Martin Simon 5b9a1a73fa conf: document gpg_keys, and the three keys the man page lacks
gpg_keys was missing from debian/aptly.conf, and the man page had no
entry for ppaBaseURL, enablePprofEndpoint or gpgKeys. The wording
follows the existing template comments where there is one.
2026-11-03 14:01:36 +01:00
Martin Simon 8c655504d2 conf: fix two misspelled keys in the default aptly.conf
debian/aptly.conf spelled dep_follow_all_variants as
dep_follow_allvariants and dep_verboseresolve as dep_verbose_resolve.
The YAML loader ignores unknown keys, so setting either to true in a
config written from this template had no effect.
2026-11-03 13:57:08 +01:00
Martin Simon 925996b8da conf: document acquire_by_hash_algorithms in the default aptly.conf
The key added in #1626 was missing from debian/aptly.conf, which aptly
writes out as ~/.aptly.conf on first run, so new installs never saw it.
2026-11-03 13:53:52 +01:00
André Roth 519602b3e8 Merge pull request #1626 from barnumbirr/configurable-by-hash-algorithms
Make the set of Acquire-By-Hash algorithms configurable
2026-11-03 13:44:00 +01:00
Martin Simon 0fcc80db7d Add the new config key to the YAML config-show gold file
Same reason as the JSON one: ConfigShowYAMLTest snapshots `aptly config
show` in YAML form. Checked all three gold files under t02_config this
time rather than the one CI named. CreateConfigTest_gold is a commented
template rather than struct output, so it is unaffected, and it passes.
2026-11-03 13:13:18 +01:00
Martin Simon 74ff0194db Add the new config key to the config-show gold file
ConfigShowTest snapshots the output of `aptly config show`, which now
carries acquireByHashAlgorithms with its default. The other three system
files mentioning "architectures" are inputs rather than expected output,
which is why only this one test failed.
2026-11-03 13:13:18 +01:00
Martin Simon e58bab9587 Make the set of Acquire-By-Hash algorithms configurable
Acquire-By-Hash entries are written for MD5Sum, SHA1, SHA256 and SHA512,
hardcoded in two places in deb/index_files.go. Every algorithm is a full
set of index copies on each publish, and on S3-like storage each of those
is a network round trip rather than a link.

Measured on an R2-backed archive of 25 packages across three suites, one
`aptly publish update` per suite:

  Acquire-By-Hash off   38 S3 requests
  Acquire-By-Hash on   222 S3 requests   (88 HeadObject, 83 CopyObject,
                                          35 DeleteObject, 13 PutObject)

Modern apt verifies with SHA256; MD5Sum and SHA1 are deprecated and
Debian has been phasing them out of Release files for years. Publishers
who do not need them are paying three quarters of that for nothing, with
no way to say so.

acquireByHashAlgorithms in aptly.conf now selects the set. An empty or
absent value keeps all four, so existing configurations are unaffected.
The order entries are written in comes from the code rather than the
config, so the directories created in one loop and the entries written in
another cannot disagree. An unrecognised name is an error rather than
something to skip: skipping a typo would produce "no by-hash entries for
that algorithm", which looks exactly like having configured it away.

Set per publish invocation from the config, the way SkipBz2 already is,
rather than persisted on the publish point.

Pre-existing test failures on this tree are unchanged by this commit:
deb goes 173->177 passed with the same 11 failures, utils keeps its one
(TestCompress), s3 stays green.
2026-11-03 13:13:18 +01:00
André Roth db3e062edc Merge pull request #1637 from luanmdang/api-metrics-listener
api: add metrics-only listener
2026-11-03 12:52:46 +01:00
Luan Dang 0d23d32840 test: handle HEAD metrics response cleanup 2026-11-03 11:42:38 +01:00
Luan DangandCopilot Autofix powered by AI 198c801f00 Refactor TestHeadMetrics for improved testing
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-11-03 11:42:38 +01:00
Luan Dang 328120f80a api: add metrics-only listener 2026-11-03 11:42:38 +01:00
André Roth 431f75c109 Merge pull request #1646 from twaik/fix-version-split-last-hyphen
deb: split Debian revision at the last hyphen
2026-11-03 10:38:54 +01:00
André Roth 70f423adaa Merge pull request #1603 from jmunson/jmunson/enable-pprof
Expose net/http/pprof handlers
2026-11-02 20:01:01 +01:00
James Munson 2d72d1f0d5 Expose net/http/pprof handlers under /api/debug/pprof/* when the new
enablePprofEndpoint (JSON) / enable_pprof_endpoint (YAML) config option
is true. The endpoint is disabled by default.
2026-11-02 15:14:35 +01:00
André Roth 81d119f421 deb: rebase changes 2026-11-02 14:59:52 +01:00
Twaik Yont 242a0d4010 deb: split Debian revision at the last hyphen
Per Debian Policy, the version is split at the last hyphen:
https://www.debian.org/doc/debian-policy/ch-controlfields.html#version

Add tests for the ordering of '+', which is a regular non-letter sorted by its ASCII value (see Comparing version numbers on the same page).
2026-11-02 14:48:41 +01:00
André Roth eaf9453897 Merge pull request #1601 from jaymzh/debian-version
Fix version parsing, validate debian package version
2026-11-02 10:11:20 +01:00
Phil Dibowitz 21487d4b5d Fix version parsing, validate debian package version
This patch adds validation to the version pasing logic (parseVersion) to
not allow packages to be registered which apt wouldn't accept anyway.

It then propogates validation errors through CompareVersions, the way
in which parseVersion gets called, so that appropriate decisions can be
made.

New packages with invalid versions are not accepted.

For any pre-exisiting packages with invalid versions, as much care is
taken as possible to log warnings, and not use those packages.

This PR is loosely bnased on one by by Aaron Foster
<afoster@cloudflare.com> though it has largely been written at this
point.

Signed off with internal and external emails for clarity, but commit
is under personal email where we typically do open source contributions
from.

Signed-off-by: Phil Dibowitz <pdibowitz@cloudflare.com>
Signed-off-by: Phil Dibowitz <pdibowitz@ipom.com>
2026-11-01 14:25:17 -08:00
André Roth 0b55b09eb2 Merge pull request #1659 from aptly-dev/fix/tmp-suffix
publish s3: remove tmp suffix for testing
2026-11-01 17:03:11 +01:00
André Roth 10e748a097 publish s3: remove tmp suffix for testing 2026-11-01 16:14:10 +01:00
André Roth 28609a918e Merge pull request #1629 from daniel-pinder/pgp-accept-multisigned-releases 2026-11-01 14:45:00 +01:00
André Roth 29db8333c5 recreate test keys with faketime 2026-11-01 13:26:36 +01:00
Daniel Pinder 59ff63de62 pgp: accept multi-signed releases when the keyring holds only some signers
Debian co-signs each suite's InRelease with more than one archive key, so
gpgv reports a good signature from the key you trust and NO_PUBKEY for the
others, exiting 2. Both verifiers treat that as failure, which means
mirroring Debian requires importing every key Debian happens to sign with.
apt does not require this: it is fatal only when there is no good signature
or a BADSIG.

Adopt that rule for unknown signers. When gpgv exits non-zero the status
stream is parsed per NEWSIG block and the result is a success only when the
process exited, at least one block is a good signature from a held key, at
least one block is an unknown issuer (ERRSIG reason 9 with NO_PUBKEY), and
nothing else appears. BADSIG, EXPSIG, EXPKEYSIG and REVKEYSIG from a held
key still fail, as does any unexplained failure. The exit-zero path is
unchanged.

KEYEXPIRED and KEYREVOKED are deliberately not disqualifiers: doc/DETAILS
notes KEYEXPIRED is emitted for an expired subkey even when that subkey was
not used, so treating it as a verdict rejects valid signatures.

checkDetachedSignature gets the equivalent change for the internal verifier.
2026-11-01 13:26:36 +01:00
André Roth a65c2cd850 Merge pull request #1602 from andrewshadura/deb-tmp-uniq
deb publish: Create unique temporary files each time
2026-11-01 12:45:23 +01:00
André Roth 5775d2e31c Merge pull request #1656 from aptly-dev/fix/mirror-rename
mirror: fix rename
2026-11-01 10:36:13 +01:00
André Roth f668b1016f Merge pull request #1647 from aptly-dev/fix/swagger-validation
Documentation cleanup: fix validation error and config file headings
2026-11-01 10:35:50 +01:00
André Roth bddfed27e5 swagger: fix validation error 2026-11-01 02:30:33 +01:00
André Roth cd22f09fc1 doc: fix comment order in aptly.conf 2026-11-01 02:30:33 +01:00
André Roth cd365b2899 mirror: fix rename 2026-11-01 02:30:11 +01:00
André Roth add8d82b44 Merge pull request #1658 from aptly-dev/dependabot/go_modules/github.com/klauspost/compress-1.18.7
build(deps): bump github.com/klauspost/compress from 1.18.2 to 1.18.7
2026-11-01 01:27:03 +01:00
André Roth ffe77f7b1e Merge pull request #1657 from aptly-dev/dependabot/go_modules/github.com/go-jose/go-jose/v4-4.1.6
build(deps): bump github.com/go-jose/go-jose/v4 from 4.1.4 to 4.1.6
2026-11-01 01:24:13 +01:00
André Roth 65a8237574 Merge pull request #1642 from filbranden/fix-download-url-opaque
Show the full URL in download error messages
2026-11-01 00:50:52 +01:00
dependabot[bot] fba40f12bd build(deps): bump github.com/klauspost/compress from 1.18.2 to 1.18.7
Bumps [github.com/klauspost/compress](https://github.com/klauspost/compress) from 1.18.2 to 1.18.7.
- [Release notes](https://github.com/klauspost/compress/releases)
- [Commits](https://github.com/klauspost/compress/compare/v1.18.2...v1.18.7)

---
updated-dependencies:
- dependency-name: github.com/klauspost/compress
  dependency-version: 1.18.7
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-31 23:50:33 +00:00
dependabot[bot] 9c37e279dd build(deps): bump github.com/go-jose/go-jose/v4 from 4.1.4 to 4.1.6
Bumps [github.com/go-jose/go-jose/v4](https://github.com/go-jose/go-jose) from 4.1.4 to 4.1.6.
- [Release notes](https://github.com/go-jose/go-jose/releases)
- [Commits](https://github.com/go-jose/go-jose/compare/v4.1.4...v4.1.6)

---
updated-dependencies:
- dependency-name: github.com/go-jose/go-jose/v4
  dependency-version: 4.1.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-31 23:50:18 +00:00
André Roth 3c46f7976b Merge pull request #1624 from chipflake/api-codename
api/publish: allow setting custom Codename on the Release file
2026-11-01 00:36:28 +01:00