Skip to content

About

Signed FreeBSD packages for JailOps, built with PkgOps and served as a pkg repository from pkg.jailops.net.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

jailops-packages

Signed FreeBSD packages for JailOps and a few related tools, built with PkgOps (no FreeBSD builder, no ports tree) and served as a pkg(8) repository from GitHub Pages at https://pkg.jailops.net/${ABI}/latest.

  • FreeBSD 15.1 and later only, amd64 and aarch64 (FreeBSD:15:amd64, FreeBSD:15:aarch64). Every package declares a minimum release of 15.1; pkg itself refuses it on 15.0.
  • The ABIs served are the ones the manifests name (sh scripts/abis.sh prints them): FreeBSD 15 until a manifest lists FreeBSD:16:amd64 and FreeBSD:16:aarch64. A new major is those two names in the manifests and in the abis: line of pkgops-repo.yaml, which scripts/check-pkgops.sh keeps equal to that list; the workflows and the update check read the list, so nothing else changes. 15.1 and 15.2 share one ABI, one set of packages.

Use it

As root on a FreeBSD 15.1+ host with sh as the shell, paste this one block. It fetches the signing key into a temporary directory and compares its sha256 with the fingerprint in the first line. On a difference it stops, and nothing on the host has changed: no key, no repository configuration. Only after the comparison does it put the key and the repository configuration in place, update the catalog and install jailops.

sh -eu <<'JAILOPS_TRUST' && pkg install -r jailops jailops
FINGERPRINT=b9fb3c980044dbd7a37c6e53e6a17510b054ba3af65e538eb2eae0f14be26a70
tmp=$(mktemp -d -t jailops-trust.XXXXXXXX)
trap 'rm -rf "$tmp"' EXIT
fetch -qo "$tmp/jailops.pub" https://pkg.jailops.net/jailops.pub
if [ "$(sha256 -q "$tmp/jailops.pub")" != "$FINGERPRINT" ]; then
  echo "jailops.pub does not have the fingerprint $FINGERPRINT: nothing was changed" >&2
  exit 1
fi
cat > "$tmp/jailops.conf" <<'EOF'
jailops: {
  url: "https://pkg.jailops.net/${ABI}/latest",
  signature_type: "pubkey",
  pubkey: "/usr/local/etc/pkg/keys/jailops.pub",
  enabled: yes
}
EOF
mkdir -p /usr/local/etc/pkg/keys /usr/local/etc/pkg/repos
install -m 0644 "$tmp/jailops.pub" /usr/local/etc/pkg/keys/jailops.pub
install -m 0644 "$tmp/jailops.conf" /usr/local/etc/pkg/repos/jailops.conf
pkg update -r jailops
JAILOPS_TRUST

The fingerprint is the sha256 of the public key file. It is also published at https://pkg.jailops.net/jailops.fingerprint and committed as KEY_FINGERPRINT, but trust the one in this README on GitHub, not only what the same web server told you. To install something else, replace the last word of the first line with the package name: pkg search -r jailops . lists the packages (the table below says what each one is).

(No mirror_type: the repository is plain HTTPS, not an SRV mirror set.) Package names and origins (jailops/<name>) do not collide with FreeBSD ports; pkg picks the highest version across all enabled repositories, so keep it that way.

Packages

package what it is
jailops-client jailops and jailops-sync, the command line client and fleet tool. Depends on git-lite.
isms The isms ISMS platform: one Go binary with the Vue interface embedded, an rc.d service, /usr/local/etc/isms/server.env (mode 0600, owner isms). Needs PostgreSQL (not installed). Nothing is generated for you: the install message lists the exact commands (secret, signing key, migrations).
unisupply unisupply, Go supply chain analysis (CLI).
age-plugin-sshagent age plugin deriving identities from ssh-agent signatures.
incus-sync GitOps fleet manager for Incus. On FreeBSD it is a client of remote Linux Incus hosts; Incus itself does not run on FreeBSD.
docker-auth docker_auth, the token authentication and authorization server of the Docker registry token protocol (works with docker-registry from the ports): an rc.d service (docker_auth), user docker_auth, a configuration that denies everyone until you add users and rules, and no key (the install message lists the steps).

Services are installed disabled. Enable with sysrc NAME_enable=YES, then service NAME start; each package prints its next steps when it is installed. The git-lite dependency comes from the official repository (the full git would pull in perl and python, about 1 GB; jailops-sync only needs the core git commands, which git-lite has, tested on FreeBSD 15.1).

Contribute a package

New packages and fixes are welcome: CONTRIBUTING.md points to the steps.

Problems

Open an issue at https://github.com/jailops/jailops-packages/issues with pkg -vv | head -40, uname -U and the exact command and output. Bugs in a program itself belong to the program's own repository (linked above).


Maintainers

Documentation for maintainers:

How it works

main/<pkg>/pkgops.yaml     what goes into the package (PkgOps manifest)
main/<pkg>/upstream.yaml   where the source comes from: repo, tag prefix, tarball URL, sha256, prebuild step, token;
pkgops-repo.yaml           policy: ABIs and minimum release 15.1 (refused otherwise)
prune.yaml                 extra prune entries (normally none): the publish keeps only the newest two versions of each package by itself
scripts/                   check, fetch-source, prebuild, build-pkg, baseline, changed, split-plan, verify-site, site-files,
                           bump-version, keygen, check-actions-pinned, verify-build-record, expect-packages, check-site-size, prune-plan (the retention
                           plan), versions-index.py (versions.json)
.github/workflows/         build-and-publish.yml, check-updates.yml (scripts: .github/scripts/)
tests/                     offline tests (update check, versions.json, baseline cache and its verification, changed packages,
                           build records, the trust block, workflow rules): sh tests/run.sh
KEY_FINGERPRINT            sha256 of the public signing key (not secret; the publish job refuses another key, and the
                           baseline is verified with the key that has it)
PKGOPS_VERSION             the pinned pkgops release (see the file)

A push to master runs build-and-publish.yml:

  1. build job: scripts/check-pkgops.sh, install the pinned pkgops, scripts/baseline.sh (pkgops fetch --pubkey from the live site, its signed catalogs verified with the key whose sha256 is KEY_FINGERPRINT, or from the GitHub Releases archive when the site has no key or index), scripts/changed.sh --pairs (the packages and ABIs whose current version is missing from the baseline index, and nothing else: touching files, scripts or the pin builds nothing, and a published file of the other ABI is never rebuilt), scripts/build-pkg.sh (fetch source with sha256 check, prebuild, pkgops build --abi for the missing ABIs, and a build record: commit, toolchain, and the name, version, ABI, size and sha256 of every file), then an unsigned pkgops repo + pkgops verify in the runner. This job has no secret. On master a package that cannot be built stops the run (BUILD_STRICT=1); a pull request builds what it can. Pull requests and other branches stop here: no signing, no publishing. A package whose upstream.yaml names a token_env is built by the master-only job build-private (GitHub Environment source, the only place JAILOPS_SOURCE_TOKEN exists), never in a pull request.
  2. publish job (master only, GitHub Environment signing): first everything that is downloaded or checked: the built packages, checked against their build records (scripts/verify-build-record.sh), the cache, the baseline again (verified as above), pkgops verify-archive (the baseline agrees with the archive), and scripts/expect-packages.sh (every package of main/ is in the repository about to be signed, and a file built now is the file already published). Only then one step writes the key to $RUNNER_TEMP with umask 077, runs scripts/site-files.sh (public key jailops.pub, jailops.fingerprint, CNAME, index.html, all derived from the secret on every run) and pkgops repo --policy --prune --key, and removes the key; an if: always() step removes it again. Then pkgops verify, scripts/verify-site.sh (no package vanished, strict: a package that is not ready fails too), scripts/versions-index.py (versions.json, below), pkgops archive push (every .pkg into GitHub Releases), and the site as the Pages artifact. Order, permissions per job and action pins are checked by scripts/check-pkgops.sh (docs/supply-chain.md).
  3. deploy job: actions/deploy-pages, then a wait (at most 12 minutes) until pkgops-index.json on the live site, with and without a cache-busting query, has the generated time of the index this run published. A green run therefore means the site is live, and the baseline of the next run cannot read an older index. The site is an artifact; no binary is ever in git or a gh-pages branch.

PKGOPS_VERSION must be a pkgops release with fetch --pubkey (the first one after 0.2.0). With an older pin the build job warns NOT VERIFIED and the publish job stops in the baseline step, before the key exists, and publishes nothing.

Packages that are already published are never rebuilt: the published index is the only trigger (a package is built when its version is not in it), so a change to a script, the pin or a workflow rebuilds nothing, and a real change to a package bumps its version (scripts/check-pkgops.sh insists on it). Their files come from the baseline. A concurrency group (publish) serialises publishes. Nothing in the archive is deleted automatically and a published file never changes: no --replace. Older versions leave the site by the retention policy (docs/RETENTION.md), not the archive. Builds are reproducible per package (SOURCE_DATE_EPOCH = commit time of main/<pkg>), so a re-run never produces a second file for one version.

Why the baseline is cached and why the cache cannot change the result

Every run needs the published site as its baseline (a deploy replaces the whole site; it holds the newest two versions of every package, older ones are in the archive), and that grows with every package and release. Downloading all of it twice per run (build job, publish job) is wasteful, so scripts/baseline.sh restores the previously published .pkg files from the GitHub Actions cache (.baseline-cache, package files only, laid out like the site) and lets pkgops fetch download only what it does not already have. The cache is a pure optimisation: the live index (pkg.jailops.net, or the Releases archive) is fetched every time and alone decides what exists. pkgops fetch keeps a cached file only when its size and sha256 match that index and replaces any other one; afterwards the script deletes every .pkg in the working site that the index does not list (a pruned version, an old build, a foreign file; pkgops repo would otherwise reindex them back in) and every *.part, then verifies each listed file's sha256 again. An empty, missing, stale or poisoned cache therefore gives the same site as no cache, and the signing key never goes near it (the cache path is .baseline-cache only; it is saved only by the publish job on master, never for a pull request, and not on first_run). The run prints baseline summary: reused N, downloaded N, removed as stale N, bytes downloaded N. Offline test: tests/test-baseline.sh.

Remaining cost, honestly: the Pages artifact still contains the whole site on every deploy (GitHub Pages replaces the site as a whole; the published site is limited to 1 GB), so every upload is the size of the site. The retention policy (docs/RETENTION.md, scripts/prune-plan.sh --generate) keeps the site below that limit by itself: the publish keeps only the newest two versions of every package, older ones leave the site in the same run and stay in the Releases archive, and a site of 900 MB or more fails the publish before the deploy. Moving the package files out of Pages is NOT done now. The cache keys (baseline-<PKGOPS_VERSION hash>-<run id>, restored by prefix, so a new PkgOps version starts clean); the entries are evicted after 7 days unused or when the repository's cache quota is full, which only means a cold download.

Go builds use GOTOOLCHAIN=auto (workflow-level env:, and build-pkg.sh sets it; check-pkgops.sh fails without it), actions/setup-go (stable) and actions/setup-node 24 for the web builds. The Go, Node, npm and pkgops versions that built a package are in its build record (dist/records/*.json, in the job's artifact), so a file that differs from a published one can be traced to the toolchain that made it.

versions.json: the published versions, for web pages

Every publish also writes https://pkg.jailops.net/versions.json: the newest version of every package, per ABI and across ABIs. jailops.net reads it to show the published version of a package, so a new package version appears on the site without anyone editing it. Anyone may read it; pkg.jailops.net is served by GitHub Pages, which answers every file with Access-Control-Allow-Origin: * and a short cache.

  • Informational, not signed. pkg(8) never reads it, and nothing here decides anything from it: the baseline, the changed packages and the site verification use pkgops-index.json and the signed catalogs (check-pkgops.sh fails when one of those scripts mentions versions.json). It is never a baseline: pkgops fetch does not fetch it and every publish writes it anew. Trust the signed repository, not this file.
  • Source: the repository's own catalogs, <ABI>/latest/packagesite.pkg (packagesite.yaml, the newest version of each package), read right after pkgops verify --pubkey verified them; every entry must also be in pkgops-index.json, or the run fails before anything is deployed. The build job writes it from its unsigned assembly too, so a pull request tests the step. By hand: python3 scripts/versions-index.py site (a tar that reads zstd). Tests: tests/test-versions-index.sh.
  • Schema 1 (a change that breaks readers raises schema; added keys do not):
{
 "schema": 1,
 "generated_at": "2026-11-04T12:00:00Z",
 "repository": "https://pkg.jailops.net/${ABI}/latest",
 "abis": ["FreeBSD:15:aarch64", "FreeBSD:15:amd64"],
 "packages": {
  "isms": {
   "version": "0.9.0",
   "origin": "jailops/isms",
   "comment": "the package's one-line comment",
   "www": "the package's www",
   "abis": {"FreeBSD:15:aarch64": "0.9.0", "FreeBSD:15:amd64": "0.9.0"}
  }
 }
}

version is the highest version across the ABIs in pkg's order (epoch, version, _revision), and origin, comment and www are that entry's; a package's abis lists only the ABIs that have it, with the version each one has. generated_at is the time of the publish run (UTC).

Add a package in 5 minutes

See docs/ADD-A-PACKAGE.md: copy the nearest main/<pkg>, edit two files, run sh scripts/check-pkgops.sh, build it locally, push to master.

Releases, bumps, and packaging fixes

  • New upstream version: check-updates.yml (daily 06:00 UTC, or Run workflow) takes, per source group, the highest non-draft, non-prerelease release with a plain N.N.N version (by version sort, not by date; the tags when the repository has no release) and only ever goes forward. It opens one pull request per bump (branch bump-<group>-<version>, label update) that runs scripts/bump-version.sh VERSION PKG...: version (a _N revision is reset), sha256 of the tarball and the dependency versions between sibling packages. Commits go through the Contents API (Verified). The PR body has the release notes URL, the compare link and, from bump_note: in upstream.yaml, a warning line (isms, jailops: read before merging). The build workflow is dispatched on the branch (a PR opened with the workflow token may not start pull_request runs): it builds and verifies, never signs or publishes. Nothing is merged automatically; merging to master publishes. By hand: sh scripts/bump-version.sh 0.2.0 jailops-client jailops jailops-backupd.
    • Idempotent: an open PR (or a leftover branch whose PR was closed on purpose) for the same bump is detected and left alone; when a newer upstream appears the older bump PR is commented, closed and its branch deleted, superseded by the new one.
    • One unreachable upstream (private without token, renamed) does not stop the others: it is listed in the summary. Run workflow with strict to fail at the end when any was unreachable (a PR that could not be opened always fails the run).
    • Summary on the run page: a table of every package (in repo, upstream latest, status: up to date / bump PR opened / bump PR already open / upstream unreachable / pinned PENDING sha256), the PKGOPS_VERSION line, and the age of the last publish (generated in https://pkg.jailops.net/pkgops-index.json; skipped when the site does not exist yet).
    • PKGOPS_VERSION: the same run checks the latest release of jailops/jailops-pkgops and opens a one-line PR (bump-pkgops-pin-<version>). The publish job runs that pkgops with the signing key, so the PR text says: read the changelog (linked) first; the PR build already runs the new version (unsigned). A commit SHA pin is not checked.
    • Monthly (1st, 06:30 UTC; or Run workflow with collisions): our package names against packagesite.pkg of https://pkg.freebsd.org/FreeBSD:15:amd64/latest/; a collision fails the job. If the catalog cannot be fetched or unpacked (needs tar with zstd/xz) it only warns, unless strict; then check by hand: pkg search -x '^name$' on a FreeBSD host.
    • Optional secret UPDATE_TOKEN (used as GH_TOKEN in the check job only, never printed) instead of the workflow token.
    • Tests, offline (fake GitHub API on localhost, Go YAML parse of the workflows): sh tests/run.sh; run it after touching .github/scripts/ or the workflow. Needs jq, python3, go with gopkg.in/yaml.v3 in the module cache.
  • A packaging-only change (rc.d, config, files, script): sh scripts/bump-version.sh --revision PKG makes 0.1.0_1. A published version is immutable: check-pkgops.sh BASE fails when main/<pkg>/ changed and the version did not (a change of comment lines of pkgops.yaml alone is allowed: comments never reach the package).
  • The first release of a source: set sha256: PENDING until the tag exists, then sh scripts/bump-version.sh --pin PKG.... A package whose sha256 is PENDING (or whose token secret is missing) is skipped, with its group, with a warning, in a pull request; on master the build fails (BUILD_STRICT=1).
  • jailops, jailops-client, jailops-backupd are built from jailops/jailops, a public repository: token_env: is empty in the three upstream.yaml files. A source that needs a token names JAILOPS_SOURCE_TOKEN in token_env: and is built by the master-only job build-private (docs/supply-chain.md, "The source token").

Prune (what leaves the site)

The publish job prunes by itself in every master run: only the newest two versions of every package and ABI stay on the site (docs/RETENTION.md). Older versions leave GitHub Pages and stay in the Releases archive. Nothing is committed and nobody runs anything. Look at the site with:

sh scripts/prune-plan.sh --size     # how big the live site is
sh scripts/prune-plan.sh            # what the next publish would drop (writes nothing)

prune.yaml is only for an administrator's extra entries, normally none: another selection (pkgops prune --plan --from https://pkg.jailops.net --older-than 90d -n looks first, -n writes nothing; --name hello --version 0.1.0 writes an entry into prune.yaml, which is committed in a pull request). Pruning the newest version of a package needs force: true. A package deleted from main/ is not dropped by the retention policy (the baseline keeps what the live index lists): list its versions in prune.yaml (force: true for the newest), and make sure no package that stays on the site depends on it, because the publish job refuses a site with a missing jailops/... dependency. The archive keeps every file. Rolling back is described in docs/RETENTION.md. Deleting from the archive is a separate, confirmed command (pkgops archive prune ... --confirm "delete from archive").

One-time setup

  1. Create the repository github.com/jailops/jailops-packages, default branch master; push this tree.
  2. Settings, Pages: Source = GitHub Actions. Custom domain pkg.jailops.net (the workflow also writes CNAME); enforce HTTPS once the certificate is issued.
  3. Cloudflare DNS: CNAME pkg -> jailops.github.io, public (proxy off or on, but never behind Cloudflare Access): pkg clients cannot do an Access login. Check that https://pkg.jailops.net/jailops.pub answers without a login.
  4. Make the signing key yourself: sh scripts/keygen.sh (needs pkgops on PATH). It writes the key outside the repository (~/.config/jailops-packages/jailops-repo.key), KEY_FINGERPRINT and the README fingerprint. Back the key up.
  5. Settings, Environments, New environment signing: deployment branches master only; required reviewers are your choice (docs/supply-chain.md). Add the secret PKG_REPO_KEY there (gh secret set PKG_REPO_KEY --env signing --repo jailops/jailops-packages < ~/.config/jailops-packages/jailops-repo.key). Never a repository-level secret, never in a pull request. Commit KEY_FINGERPRINT and README.md. The YAML cannot prove these settings exist: confirm them with the commands in docs/supply-chain.md.
  6. Optional: UPDATE_TOKEN, a repository secret (a token that may open PRs and start workflows, for check-updates.yml), and, only for a package whose source is private, the Environment source (deployment branches master only) with the secret JAILOPS_SOURCE_TOKEN in it.
  7. Publish the pkgops tag v0.1.0 in jailops/jailops-pkgops (PKGOPS_VERSION is always a release tag), tag jailops/jailops v0.1.0 and run sh scripts/bump-version.sh --pin pkgops jailops-client jailops jailops-backupd.
  8. First publish only: Actions, "Build and publish", Run workflow with first_run = true (there is no site and no archive to take a baseline from). Every later run without it fails when no baseline can be fetched, so nothing can vanish.
  9. Branch protection on master is yours to decide (you push straight to master). The workflows do not need it to run, but whoever can push to master can change the workflow that holds the signing key: see docs/supply-chain.md.
  10. The admin UI (pkgops serve --source ...): a GitHub App installed on this repository only (Contents and Actions read-write, Metadata read), the private key on the host that runs pkgops serve (0600), the service on a separate admin hostname behind Cloudflare Access (self-hosted application, AUD tag, allow list). See PkgOps docs/admin.md. The admin hostname must never be pkg.jailops.net.

Local work

sh scripts/check-pkgops.sh                                   # manifests, policy, workflows, immutability: sh scripts/check-pkgops.sh BASE_REF
# a package from its tarball:
SOURCE_DATE_EPOCH=1700000000 sh scripts/build-pkg.sh unisupply            # dist/<ABI>/<name>-<version>.pkg
# from a local checkout instead (development only, refused in Actions, announced loudly, not verified):
SRC_JAILOPS=~/src/jailops SRC_JAILOPS_CLIENT=~/src/jailops SRC_JAILOPS_BACKUPD=~/src/jailops sh scripts/build-pkg.sh jailops-client jailops jailops-backupd
# a repository with a THROWAWAY key (never the real one):
pkgops key generate --out /tmp/t/t.key && pkgops repo --repo /tmp/site --policy pkgops-repo.yaml --prune prune.yaml --key /tmp/t/t.key dist
pkgops verify /tmp/site/FreeBSD:15:amd64/latest --pubkey /tmp/t/t.pub

Environment: SRC_<PKG> (package name upper-cased, - to _), JAILOPS_SOURCE_TOKEN, DIST_DIR, SOURCE_DATE_EPOCH, NPM_CI_ARGS, BUILD_STRICT, BUILD_LABEL (name of the build record), EXPECT_COMMIT and VERIFY_SITE_STRICT (the publish job), BASELINE_FIRST_RUN, NO_DOWNLOAD (bump). Tools: a POSIX sh, curl, tar, jq (or python3), Go, Node 24 for the web builds. *.key, *.pem, site/, dist/, main/*/src/, main/*/build/ are in .gitignore; check-pkgops.sh fails if key material is in the tree.

Open decisions

  • jailops source: make jailops/jailops public or keep the token; retire its own rsync/VM release pipeline when this repository is live.
  • Package names: jailops, jailops-client, jailops-backupd, pkgops, isms, unisupply, age-plugin-sshagent and incus-sync were searched in the official FreeBSD package repository on 2026-10-26 (pkg 2.8.4, FreeBSD 15.1) and none exists there; search again before the first publish, because the ports tree moves.
  • GitHub tarballs are not guaranteed byte-stable; a sha256 mismatch fails the build (re-pin deliberately).
  • Pages limits (1 GB site, bandwidth): the retention policy keeps the site small (docs/RETENTION.md); many more packages than today may need a different host (docs/RETENTION.md, "If the site still grows too fast").

About

Signed FreeBSD packages for JailOps, built with PkgOps and served as a pkg repository from pkg.jailops.net.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages