Self-hosted repositories and official signatures
5 minute read
Share a lab repository by distributing its images and catalog. Barn 1.5.0 supports filename-based builds and ML-DSA-87 verification. Barn 1.4.0 uses repo.yaml for builds and Minisign for official catalogs.
Create and use a lab repository
Place your images under repo/images/, for example lab-pg-1-arm64.qcow2. Run these commands on a host with qemu-img:
The first command writes catalog.json. Barn takes the image name, version and architecture from each filename and defaults to UEFI. An existing repo.yaml still selects the repository contents. A local repository can be unsigned and use your original image files.
To share it, serve catalog.json and images/ over HTTPS. Set the address on the client and activate the catalog. Run the same barn update when the repository changes.
barn update --repo ./repo refreshes only that directory. Explicitly selected local and custom HTTPS repositories can be unsigned. Plain HTTP requires a valid ML-DSA-87 signature. Both 1.4 and 1.5 clients check image SHA-256 digests and byte counts from a schema 3 catalog.
Official images and packages
Use barn up or barn update with the official repository as usual. New clients verify catalog.json.sig with their built-in key. The maintainer publishes a separate catalog.json.minisig over the same catalog for 1.4.0 clients.
Internal mirrors of the official repository should copy both signature files with the catalog. Users who cached that mirror’s catalog in Barn 1.4.0 can refresh it after upgrading with barn update --repo <mirror>.
Initial script installations rely on HTTPS. For independent verification, get the public key through a trusted channel and use OpenSSL 3.5 or later to check the release manifest. Then check the installer and platform archive against that manifest. Use your existing installation channel for upgrades.
Generate and store the maintainer key
Barn signs its official image catalogs and CLI release manifests with one ML-DSA-87 key. Run the Bash commands below from the Barn source root with OpenSSL 3.5 or later and ML-DSA support.
First-time generation and public fingerprint
The official key was generated on December 3, 2026. Restore the same key when moving to another machine. The commands below document initial provisioning and stop if the private key already exists. Backup and recovery
The private key is a passphrase-free PKCS#8 PEM. Anyone who can read it can sign as Barn. Keep it on the maintainer’s machine with disk encryption, a mode 0700 directory and a mode 0600 file. Only the exported public key goes into the source tree and build machines.
Get the public key from a trusted release commit. This command calculates SHA-256 over its DER-encoded SubjectPublicKeyInfo. The fingerprint for the official key introduced on December 3, 2026 is 5b108c30d99f93a28184fef362367dc63d4f7c1c2e56c2e0d89c7e3e1f17a262. New Barn clients display the short ID 583F7D5BAA0D16C5 in catalog state. Public key in v1.5.0
Backup and recovery
Keep a second copy of the private key on a separate encrypted removable volume. Unlock and mount it first, then replace /Volumes/BarnBackup with its actual mount point. Both cmp commands exit silently on success. They check that the backup is byte-identical and that it yields the public key embedded in the client. Eject the volume and store it offline.
To move to a new signing machine, obtain internal/image/official-key.pem from a trusted release commit and restore from the removable volume. The commands check the public key first and preserve any existing private key at the destination. Recover the original key from backup after a disk failure. A compromised key or loss of all copies requires distributing a client that trusts a replacement key.
Sign and publish as the maintainer
From the Barn source root, select the image repository and the signing directory. Recompute the image digests and check that the catalog matches the repository.
Reuse an existing catalog.json.minisig if it verifies. When the repository changes, first increase the revision and run barn repo build "$repo", then recreate the legacy signature with the original 1.4.0 key using make catalog-sign CATALOG_KEY="$keydir/barn-catalog-active-20261126.key" CATALOG_FILE="$repo/catalog.json". The tool reads the legacy key’s passphrase from CATALOGSIGN_PASSWORD. Sign those same catalog bytes with the new key.
Upload new images to both mirrors and verify their sizes and SHA-256 digests before publishing the same catalog.json.sig, catalog.json.minisig and catalog.json at each repository root. Synchronize the embedded catalog, revision, timestamp and packaging/image-repository/repo.yaml, then run make catalog-check. On each mirror it verifies both signatures, compares the remote catalog with the embedded bytes and checks every stable image’s length. Use go run ./tools/catalogcheck -verify-bytes to stream and hash every stable image on both mirrors.
Once the official CLI draft is ready, run ./packaging/sign-release.sh /absolute/draft "$HOME/.config/barn/signing/official.pem" /absolute/signed. Upload the resulting release.json, checksums.txt and checksums.txt.sig together to that draft, then verify and publish it with make release-publish RELEASE_TAG="$tag". Release sequence