Add deb (Debian/apt) local and remote repository support #111

Merged
benvin merged 2 commits from benvin/deb-local-remote into master 2026-08-11 23:21:08 +10:00
Member

Brings Debian/apt to artifactapi with feature parity to the existing rpm support (local + remote), so .deb packages can be hosted as a flat apt repo and a Debian/Ubuntu mirror can be cached through the proxy.

  • Adds deb to the package-type enum and registers a new internal/provider/deb provider.
  • Classifies .deb blobs immutable and the apt index surface (Packages, Release, InRelease, dists/, by-hash) mutable so the caching engine revalidates it.
  • Parses the .deb in pure Go (ar archive to control.tar.{gz,xz,zst} to ./control), storing the raw control stanza plus computed size/md5/sha256 as deb_metadata.
  • Serves a flat apt repo (deb [trusted=yes] .../ ./): generates Packages, Packages.gz and an unsigned Release (returns 404 for InRelease/Release.gpg), mirroring rpm unsigned repodata / gpgcheck=0 trust model.
  • Proxies a remote mirror via UpstreamURL/ContentType/AuthHeaders (HTTP Basic).
  • Adds the deb_metadata table to migrate(), DB access methods, a MinimalDeb pure-Go fixture, unit tests, and a dockere2e TestLocalDebRepo.
Brings Debian/apt to artifactapi with feature parity to the existing rpm support (local + remote), so `.deb` packages can be hosted as a flat apt repo and a Debian/Ubuntu mirror can be cached through the proxy. - Adds `deb` to the package-type enum and registers a new `internal/provider/deb` provider. - Classifies `.deb` blobs immutable and the apt index surface (`Packages`, `Release`, `InRelease`, `dists/`, by-hash) mutable so the caching engine revalidates it. - Parses the `.deb` in pure Go (ar archive to `control.tar.{gz,xz,zst}` to `./control`), storing the raw control stanza plus computed size/md5/sha256 as `deb_metadata`. - Serves a flat apt repo (`deb [trusted=yes] .../ ./`): generates `Packages`, `Packages.gz` and an unsigned `Release` (returns 404 for `InRelease`/`Release.gpg`), mirroring rpm unsigned repodata / gpgcheck=0 trust model. - Proxies a remote mirror via `UpstreamURL`/`ContentType`/`AuthHeaders` (HTTP Basic). - Adds the `deb_metadata` table to `migrate()`, DB access methods, a `MinimalDeb` pure-Go fixture, unit tests, and a `dockere2e` `TestLocalDebRepo`.
unkin-agent added 1 commit 2026-08-11 22:03:01 +10:00
feat: deb (Debian/apt) local and remote repository support
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
a35f260b74
Adds a deb provider with feature parity to rpm for local and remote repos,
so .deb packages can be hosted (flat apt repo generated on upload) and a
Debian/Ubuntu mirror can be cached through the proxy.

- add PackageDeb to the package-type enum
- new internal/provider/deb: Classify (.deb immutable, Packages/Release/dists
  mutable), ValidateUpload to pool/<file>, pure-Go .deb parse (ar -> control.tar
  gz/xz/zst -> ./control), and a flat-repo LocalIndexer serving Packages,
  Packages.gz and an unsigned Release ([trusted=yes], mirroring rpm gpgcheck=0)
- remote proxy path: UpstreamURL/ContentType/AuthHeaders via BasicHeaders
- DebMetadata struct + store interfaces on provider; deb_metadata table in
  migrate() and Insert/Delete/List DB methods
- blank-import the deb provider in the server
- testsupport.MinimalDeb pure-Go fixture builder
- unit tests (classify, control parse across gz/xz/zst, Packages/Release
  generation, validate) and a dockere2e TestLocalDebRepo
unkin-agent added 1 commit 2026-08-11 22:39:38 +10:00
fix(deb): normalize apt flat-repo ./ dist prefix in local index
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
d7e6ec43ff
Real apt appends the flat-repo dist "./" verbatim, requesting <repo>/./Packages
(and ./Release, ./InRelease). ServeLocalIndex matched the literal filename and
404d, breaking the documented `deb ... <repo>/ ./` one-liner; curl/browsers
pre-normalize /./ which masked it. Collapse the dot-segment via a small
normalizeIndexPath helper before matching, a no-op for pool/*.deb lookups.
benvin merged commit 60f008debc into master 2026-08-11 23:21:08 +10:00
benvin deleted branch benvin/deb-local-remote 2026-08-11 23:21:08 +10:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/artifactapi#111