manifold-mrepo builds repositories of Manifold images.
It takes component bundles from an incoming directory, imports them and publishes a
static tree of files that any web server can serve as a Manifold repository.
The tree holds the images as zchunk files, so clients only download what
changed, together with their manifests and an AppStream catalog.
The minirepo tools also creates a small database to speed up imports and index generation.
- Python 3.12 or newer, with SQLAlchemy 2, click, zstandard, blake3 and PyGObject
- libmanifold with its GObject Introspection data, and AppStream 1.2.2 or newer with its compose library
ssh-keygen
$ pip install .To run it from the source tree instead, use python3 -m manifold_mrepo.
A repository is a directory with a configuration file, manifold-repo.toml.
data/manifold-repo.toml.example lists all settings. A minimal one:
[repository]
id = "example"
summary = "Example applications and their runtimes"
url = "https://example.org/manifold"
signing-key = "keys/repo"Clients show the summary to their users, and also who publishes the repository if you
name them with publisher-name and, optionally, publisher-email.
The repository is signed with signing-key, which can be a key file, the name of a key
of manifold key new, or the fingerprint of a key in ssh-agent:
$ ssh-keygen -t ed25519 -f keys/repoInstead of naming it with signing-key, you can also put the private key into the
$MREPO_SIGNING_KEY environment variable, for example from a secret of a CI system.
Whenever that variable is set, its key is used, even if signing-key names a different one.
Bundles have to be signed by a key that the repository trusts. Copy the public keys
of the uploaders to the trusted-keys/ subdirectory (relative to the config file location).
Put bundles into incoming/, then import and publish them:
$ manifold-mrepo import
$ manifold-mrepo publishmanifold-mrepo update does both. An imported bundle is removed from incoming/. A
bundle that is rejected is moved to incoming/rejected/, next to a file that says why.
publish only writes a new tree if something changed, or if the root index is close to
its expiry date. Run manifold-mrepo update from a timer, daily for example, so the root
index never expires. Changes to manifold-repo.toml alone do not count, so run
manifold-mrepo publish --force after editing it.
Importing only adds images, and publish only writes the indexes for what the
database lists. Nothing is ever removed by either of them, a bit like objects in git.
manifold-mrepo cleanup deals with the garbage, run it whenever the server has time for it
to clean up anything that was schedules for removal:
$ manifold-mrepo cleanup
$ manifold-mrepo publishIt prunes the index down to the newest revision of the newest keep-versions versions
of every application, and does the same for other component too as long as nothing
depends on the older revisions anymore.
The pruned images leave the index with the next publication, and stay downloadable for grace-days
after that, for clients that still have an older index. Once that time is over, cleanup deletes their
files, along with any file that a rejected bundle left behind.
Images are by far the largest files of a repository. A channel can name another
location for them with image-url-prefix, for example any kind of object storage
(or the release assets of a GitHub project):
[channels.main]
image-url-prefix = "https://github.com/example/images/releases/download/images"
omit-local-images = trueClients try that location first, with a / and the file name of the image appended to
the prefix. We only rely on it once we found the same file there, so upload the images
after importing them, and publish after that:
$ manifold-mrepo import
$ manifold-mrepo external-pending --link-to uploads/
$ # upload everything in uploads/
$ manifold-mrepo publishWith omit-local-images, cleanup deletes the images we found there from the public
tree, once the published index names that location, and the repository keeps no copy
of them. They have to stay at that location then, and
manifold-mrepo cleanup --recheck-external checks that they still are.
manifold-mrepo list-external lists every image that has to stay there, including
those that left the index but are still in their grace period. Anything else can be removed.