Repository navigation
Proxy FreeBSD pkg repositories - #545
Merged
Merged
Conversation
Catalogues (meta.conf, packagesite and data) carry their signature
inside the archive and go through the metadata cache byte for byte.
Packages under Hashed/ have the content hash in their name, so they go
to the artifact cache as pkg:bsd/freebsd/{name}@{version}. Other files,
including the bootstrap files under Latest/, are passed through.
pkg.freebsd.org is the built-in freebsd repository; more mirrors go
under upstream.freebsd.
Closes git-pkgs#536
The FreeBSD config cases get their own test, and the dashboard entry moves into a helper.
Package files outside Hashed/, such as All/{name}-{version}.pkg from
repositories built without pkg repo --hash and the bootstrap
Latest/pkg.pkg, were relayed without any checks. They are still passed
through uncached, since their names can be reused for rebuilds, but a
versioned name is now checked against the denylist first, and while a
scanner covers freebsd they are refused, because only cached artifacts
can be scanned.
andrew
approved these changes
Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #536.
FreeBSD pkg repositories are served at
/freebsd/{name}/, withpkg.freebsd.orgas the built-infreebsdrepository and more mirrors underupstream.freebsd. The rest of the path goes to the mirror unchanged, so ports, pkgbase and poudriere repositories all work. Clients overrideurland setmirror_type: "none". Signature settings stay as they are.meta,meta.conf,packagesiteanddataas.pkg,.txzor.tzst) carry their signature inside the archive. They go through the metadata cache and are served byte for byte.Hashed/(All/Hashed/for ports,Hashed/for pkgbase) have the content hash in the file name and never change. They go to the artifact cache aspkg:bsd/freebsd/{name}@{version}, using the type from Add bsd PURL type for FreeBSD packages purl#49 (purl bumped to v0.1.23). Retention supportsfreebsd.Two changes from the plan in the issue:
Latest/pkg.pkgandpkg.pkg.sigare passed through rather than cached. The.sigis rewritten with every repository build whilepkg.pkgchanges less often, so caching them separately could pair a package with the wrong signature, the problem Arch solves for databases. Bootstrap is rare enough that I'd leave it for later.Hashed/.Also: dashboard instructions, README, config example, configuration docs, the request metrics label and
pkgas a known client.Testing
Handler tests cover the path classification, name and version parsing, catalogues and hashed packages served from the cache while the upstream is down, packages cached per ABI,
Latest/and unhashed files not cached, and the retention key.I also ran it end to end with a FreeBSD 15.1 aarch64 VM, with
FreeBSD-ports,FreeBSD-ports-kmodsandFreeBSD-basepointed at the proxy and their signature settings unchanged.pkg updateverified all three catalogues, andpkg installfetched a ports package (tree) and pkgbase packages through it, stored aspkg:bsd/freebsd/tree@2.3.2and so on. With the proxy cut off from the upstream and pkg's local cache cleared,pkg update -fand reinstalling both kinds of packages still worked. pkg sendsUser-Agent: pkg/2.8.4, which shows up as clientpkg.FreeBSD 15 splits the old
FreeBSDrepository intoFreeBSD-ports,FreeBSD-ports-kmodsandFreeBSD-base; the README shows both layouts.Package files outside
Hashed/(unhashed repositories,Latest/pkg.pkg) stay uncached, but a versioned name is checked against the denylist first, and while a scanner covers freebsd they are refused, since only cached artifacts can be scanned.