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

2 Commits

Author SHA1 Message Date
unkin-agent d7e6ec43ff 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
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.
2026-08-11 22:39:30 +10:00
unkin-agent a35f260b74 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
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
2026-08-11 22:00:49 +10:00