6 Build Node Guide
liquibyte edited this page 2026-11-27 18:07:51 -06:00

Build Node Guide

A build node is a computer that builds packages for a Folio site. The site itself never compiles anything: it keeps a queue of builds, and build nodes take them one at a time, build them and hand the result back. A site needs at least one node; without one, every build stays queued.

Anyone the site's administrators trust can lend a node. This page is for that person: it explains what a node does, how to set one up, where its files are, and what it prints.

Words used on this page:

Word Means
site the Folio site the node builds for, here dur.example.org
forge where a project's git repository lives, here forge.example.org
release a version of the distribution, such as excalibur or ceres
processor type what Debian calls an architecture: amd64, arm64 and so on
build one project, at one commit, for one release and one processor type
build system a small, separate Devuan system that a build runs inside
build user the ordinary user account on the node that runs folio-node (this page calls it builder)

What a node does

folio-node repeats these steps until it is stopped:

  1. It asks the site, over SSH, for the oldest waiting build it may take. If there is none, it waits a minute and asks again.
  2. It fetches the project's source from the forge the project lives on, at exactly the commit the site named. A fetch that has not finished after half an hour, or that gets less than 1000 bytes a second for a minute, is given up, and the build goes back to the queue.
  3. If the project has no packaging (no debian/ folder), it writes it. To find out which packages the build needs, it looks in that release's list of every file in every package. Then it makes the source package. Each of these steps runs in a throwaway sandbox of its own, which cannot see the node's keys or settings (see The sandbox before the build). A debian/ folder with a link in it is refused. A pkg-config module the build cannot do without, which no package of the release has and none of the site's, makes the build failed here, before sbuild.
  4. It builds the package with sbuild, inside a build system for that release, as the build user. Nothing runs as root. If sbuild cannot install what the build needs, the node reads from apt's words what that was, looks each name up in the release's list of packages (dists/RELEASE/main/binary-ARCH/Packages.xz from the mirror if the package xz-utils is installed, else Packages.gz, kept for a week like the list of files), and hands in waiting with that list (a file missing). The site decides whether it waits for one of its own packages or cannot build there.
  5. While it builds, it tells the site once a minute that it is still at it. Every build, the steps before sbuild and sbuild itself, is held to the node's limits on time, memory, processes and disk (see Limits).
  6. It hands the packages and the full log back to the site.

The node's keys can do only this: take a build, say it is still building, hand in a result. They cannot vote, import, or change anything else on the site.

A node signs what it claims and hands in. A node has two keys, as a person does. Its SSH key lets it in, through a door of its own (folio-node-door). Its GPG key signs each claim and each result, in the same signed request a person's change comes in, with the account node:NAME. The site checks it exactly as it checks a person's: the node that came in is the one that signed, the request is for this site, it was signed within five minutes of the site's clock, its nonce was not used before, and the signature is the node's key's. A result's request names the sha256 of the tar archive the node sends, and the site checks the archive against it before it unpacks anything. Anything unsigned, or signed wrongly, is refused, and counts as not handed in.

What a result may hold. The archive holds plain files only, in no folder, and only what a build hands in: log, message, missing, and files whose names end in .deb, .changes, .buildinfo, .dsc, or a source tar (.tar.gz, .tar.xz, .tar.bz2, .tar.lzma, .tar.lz, .tar.zst, each also with .asc after it). Each name is checked whole: letters, digits and . _ + ~ - only, not starting with . or -, no .., no /. One member that breaks this refuses the whole result, and nothing of it is unpacked; the site then unpacks only the names it checked, as files of its own (the result has a file with an unusable name: NAME or the result has a file a build does not hand in: NAME; see Troubleshooting). folio-node hands in only such files.

A removed package's builds. When a package is removed from the site (an accepted request NAME delete, or a merge), its builds that are not done are marked superseded, with the note its package was removed. A node building one is told stop at its next alive, and a result handed in afterwards is not taken (build N: its package was removed, then build N is no longer wanted; nothing was taken).

The site keeps the signed claim and the signed result beside the build (claim-request, result-request and result.tar, the archive as it came) and names the result when it publishes the build (published-result = build NUMBER request NONCE node NAME FINGERPRINT in the build's job). So anyone with a backup can check, with folio-audit, that each published package came from a node whose key the site had recorded.

alive is not signed: it only says the node is still at a build it holds. Someone with the node's SSH key alone could keep a build from going to another node; nothing more.

What decides which builds a node gets

The node's own release does not matter. A node running Devuan excalibur builds for ceres, daedalus or any other release the site asks for. Each build says which release it is for, and the node makes a build system for that release.

Nor does its distribution, but the node needs the keys of each one it builds for. A site can build for releases of other distributions made the same way as its own (Debian beside Devuan; see Settings Reference). Each build names its distribution, the mirror, and the package of that distribution's archive keys. The node makes the build system from that mirror and checks it with that distribution's keys alone (mmdebstrap --keyring), never with every key apt on the node trusts: so a mirror of one distribution cannot pass off what another's key signed. The keys are the file /usr/share/keyrings/DIST-archive-keyring.gpg that the distribution's keyring package installs (devuan-keyring, debian-archive-keyring, ubuntu-keyring), or the file the node's settings name (keyring-DIST). A node without them hands the build back: this node has no keys for debian (...): install debian-archive-keyring, or set keyring-debian = FILE.

The processor type does matter. The site gives a node only builds for the processor types it was let in for (amd64 unless the administrator said otherwise, see step 4). Nothing else is compared: not the release, not the node's speed, not what it built before. The one exception: a build made to check another one (the setting verify, see More than one node) never goes to the node that made the first.

The build systems. For each release and processor type the node makes one build system with mmdebstrap, packed into a single file, and keeps it for 7 days. Builds in those 7 days start from that file; after that, the next build for that release makes a fresh one. A build system (or list of files) not made again for 14 days is for a release the site no longer builds, and the node deletes it: when it starts, and before it makes a new build system. Each build unpacks its own copy, and the copy is thrown away when the build ends, so one build cannot leave anything behind for the next.

Building without root. mmdebstrap and sbuild run in their "unshare" mode. Inside the build system, the build sees itself as root, because installing packages needs that. Outside, that "root" is the build user and nothing more. The other user numbers inside the build system map to a range of spare user numbers that the build user is given in /etc/subuid and /etc/subgid (step 2). So a build can install what it needs inside its own system, and cannot touch anything on the node that the build user could not touch already.

inside the build system          on the node
-----------------------          -----------------------------
root (0)                   ->    builder (for example 1001)
every other user           ->    a spare number from builder's range
                                 in /etc/subuid and /etc/subgid
                                 (100000 and up)

The sandbox before the build

Before sbuild starts, the node acts on the project's own files: it fetches them, checks debian/, writes the packaging, fetches the original source and makes the source package. Each of these steps runs in a throwaway sandbox of its own, made with unshare (from util-linux) in new user, mount, process, IPC and host-name namespaces, as sbuild's own does. Inside it, the step is "root" of its namespace, without any capability and unable to gain one; outside, it is the build user. It sees:

In the sandbox What it is
/usr, /etc (and /bin, /lib and so on, which lead into /usr) the node's system, read-only
/dev/null, /dev/zero, /dev/full, /dev/random, /dev/urandom those devices only
/proc its own processes only (none, in a container that does not allow a new /proc)
/work the build's own folder for these steps, the only place it can write
/tmp a folder of the build's own, beside /work
/folio/... only for writing the packaging: folio-debianize and the lists of files it reads, read-only

It never sees the node's SSH key, its GPG keyring, its settings, its cache, other builds or any home folder. Each step has the network only if it needs it:

Step Network Given read-only
fetching the source (git clone) yes, https only nothing
the commit (git checkout), then removing .git no nothing
checking debian/ for links no nothing
writing the packaging (no debian/ folder) no folio-debianize, the release's and the site's lists of files
the version for the release (a site with a suffix such as +devuan6) no nothing
reading the addresses in debian/watch (3.0 (quilt)) no nothing
uscan, fetching the original source (3.0 (quilt)) yes, https only nothing
dpkg-source -b, making the source package no nothing

git is held to https by GIT_ALLOW_PROTOCOL. uscan is held to https in two ways: a debian/watch that names any address that is not https:// is refused before uscan runs (the build is failed), and uscan is given a proxy for http and ftp that does not exist, so that a redirect from https to anything else fails too. uscan may take as long as fetching the source does (FOLIO_NODE_FETCH_TIME).

What the node itself fetches (the release's and the site's lists of files, the site's keys) is fetched outside the sandbox, over https, and never steered by the project.

To see it on your node, run folio-node check as the build user. It prints the limits, then, for the steps without the network and for those with it, whether the sandbox can see the node's key, keyring, settings and cache:

What a step before the build sees of this node's own files:
   the steps without the network: cannot see /home/builder/.ssh/folio-node
   ...
The sandbox hides all of them.

A node that cannot make the sandbox does not build at all (see If something goes wrong).

Limits

Every build is held to four limits, set in the node's settings file (step 5). A build that reaches one is failed, with a message that names the limit. That is the package's trouble, not the node's: it does not count as an error, and the build is not put back in the queue. rebuild tries it again, for example on a node with higher limits.

Setting Default What it limits How it is held to
limit-time 4h the whole build, from the fetch to the end of sbuild timeout: each step and sbuild are given what is left of the build's time, and then stopped (killed half a minute later if they do not stop)
limit-memory 4G the memory of each program of the build prlimit --as: the address space of each program. Several programs at once may use more than that in all
limit-processes 1024 processes and threads at once prlimit --nproc: in a step's sandbox, those in it; for sbuild, those of the build itself (dpkg-buildpackage and all it runs), counted in sbuild's own namespace: sbuild writes a small program, /usr/local/bin/folio-node-limits, into the build's throwaway system and runs the build with it (the node gives sbuild a settings file of its own, SBUILD_CONFIG, on top of yours)
limit-disk 20G the build's folder in the node's cache, and the folder sbuild unpacks its build system in (/tmp/folio-node-UID/NUMBER, under TMPDIR if set) the folders are measured every 10 seconds (du), and the build is stopped once it holds more; prlimit --fsize stops any single file larger at once. Between two measures a build can write more than the limit for a few seconds

limit-time is written 4h, 90m or 600s (a number alone is hours); limit-memory and limit-disk 4G or 512M (a number alone is GB; GB and MB are taken too); limit-processes as a number. A value the node cannot read stops it at once, saying which line is wrong.

The node holds to these as an ordinary user, without root and without systemd. It does not use cgroups: on Devuan without systemd they belong to root. So memory is limited for each program, not for the build in all, and disk is measured, not reserved.

A build that reached a limit shows, at the end of the node's line and on the build's page:

Message Limit
failed (the build took longer than 4 hours) limit-time
failed (the build used more than 4 GB of memory) limit-memory: a program of the build said it could not have more memory
failed (the build ran more than 1024 processes at once) limit-processes: a program said it could not start another
failed (the build used more than 20 GB of disk space) limit-disk

Its log ends with This build reached a limit of this node: MESSAGE. (The node's settings say how much a build may have: limit-time, limit-memory, limit-processes and limit-disk.)

Once a build's time is up, the node stops telling the site it is at that build: if the node itself were stuck, the site would give the build to another node after fifteen minutes.

What the node connects to

A node only makes outgoing connections. Nothing connects to it, so it needs no open port and can sit behind a home router.

                    +------------------+
                    |    build node    |
                    +------------------+
                      |        |      |
           SSH and    | HTTPS  |      |  HTTPS
           HTTPS      | (git)  |      |
                      v        v      v
   +-----------------+  +-------+  +-----------------------------+
   | site            |  | forge |  | distribution mirror         |
   | dur.example.org |  |       |  | https://pkgmaster.devuan    |
   |                 |  |       |  | .org/merged, unless the     |
   |                 |  |       |  | site names another          |
   +-----------------+  +-------+  +-----------------------------+
To How What for
the site SSH, as folio@dur.example.org with the node's key asking for work, saying it is still building, handing in the result
the site HTTPS, its address followed by /apt the site's own packages: one project of the site may need another to build. For a site with its own certificate authority, see A site with its own certificate authority
the forge git over https only (http and git are refused) the project's source
the distribution's mirror HTTPS the build system, the packages a build needs, and the release's list of files
wherever a project's debian/watch points HTTPS only for a project with its own packaging in the 3.0 (quilt) format: the original source

The site tells the node, with each build, which mirror to use and where its own archive is.

What you need

You need Why
A computer running Devuan that can stay on builds can arrive at any time
Some free disk: about 170 MB per release (its build system is 140 to 170 MB, its file list about 20 MB), so about 700 MB for a site that builds four releases, plus room for one build (limit-disk, 20 GB unless set otherwise) the build systems, kept for 7 days, and one build at a time
An ordinary user for the builds (builder here) builds never run as root
Outgoing connections to the site, the forge and the distribution's mirror see the table above
The file folio-node_0.1_all.deb from whoever built Folio (see the Owner Install Guide, Part 1)
An administrator of the site to let the node's key in

The node can be the same computer as the site, as long as the build user is another user than folio.

Setting up a node

Steps 1 and 2 are done with sudo on the node. Steps 3, 5 and 6 are done as the build user on the node. Step 4 is done by an administrator of the site, on their own computer.

1. Install the program

On the node, as a user who may use sudo:

sudo apt install ./folio-node_0.1_all.deb

This installs folio-node and what it needs:

Package What it is for
sbuild builds packages in a build system
mmdebstrap makes the build systems
devuan-keyring lets mmdebstrap check the packages from Devuan's mirror
debian-archive-keyring (recommended) the same for Debian's, for a site that builds Debian's releases too
uidmap lets an ordinary user use spare user numbers (newuidmap, newgidmap)
dpkg-dev, devscripts make the source package; uscan fetches original sources
git fetches the project from the forge
curl fetches lists from the mirror and the site
zstd packs the build systems
ca-certificates lets curl and git check HTTPS addresses
openssh-client talks to the site
gnupg signs the node's claims and results with its GPG key
util-linux (on every system already) unshare, pivot_root, setpriv and prlimit: the sandbox and the limits

You should see apt list these packages and finish without errors.

2. Make the build user ready

On the node, with sudo:

  1. If there is no build user yet, make one:

    sudo adduser builder
    
  2. Check that the user has a range of spare user numbers:

    grep builder /etc/subuid /etc/subgid
    

    You should see one line from each file, like /etc/subuid:builder:100000:65536. That means: the user builder may use the 65536 numbers from 100000 on. If a file has no line for the user, add one:

    sudo usermod --add-subuids 100000-165535 --add-subgids 100000-165535 builder
    

    Pick a range no other user in those files has.

3. Make the node's keys

A node has two keys of its own: an SSH key, which lets it in, and a GPG key, which signs every claim and result it sends. Both are for this node alone, and both have no passphrase.

On the node, as the build user:

  1. The SSH key:

    ssh-keygen -t ed25519 -N "" -f ~/.ssh/folio-node
    

    -N "" means no passphrase. -f names the file. You now have ~/.ssh/folio-node (the private key, which stays on the node) and ~/.ssh/folio-node.pub (the public key, which you send).

  2. The GPG key, in a keyring of its own (not your own ~/.gnupg), only for signing, running out in two years:

    mkdir -m 700 ~/.folio-node-gnupg
    GNUPGHOME=~/.folio-node-gnupg gpg --batch --passphrase '' \
        --quick-gen-key "build node NAME <node@dur.example.org>" ed25519 sign 2y
    GNUPGHOME=~/.folio-node-gnupg gpg --armor --export >~/folio-node.asc
    GNUPGHOME=~/.folio-node-gnupg gpg --with-colons --list-keys | grep -m 1 '^fpr' | cut -d: -f10
    

    The last line prints the key's fingerprint: you write it into the node's settings in step 5. ~/folio-node.asc is the public key, which you send.

Why no passphrase. The node works unattended: nobody is at the keyboard to type one, at any hour. A person's GPG key has a passphrase because it can do everything that person may do. A node's keys can do only what the node does: take builds for its processor types and hand in results for the builds it holds. That is why a node's key without a passphrase is acceptable, and a person's is not.

If the node is stolen, or a copy of the build user's files is: whoever has them has both keys, and can claim builds and hand in results as that node, signed as the node would sign them, until an administrator switches the node off (folio admin node disable NAME) or gives it a new GPG key (folio admin node key NAME < new.asc). Every result the stolen keys signed stays beside its build, with its node's name, so the administrator can find each one and build it again (rebuild). On a site with verify = required, nothing is published until a second node has built the very same files, so one stolen node alone publishes nothing.

4. Get the node let in

  1. Send both public keys, folio-node.pub and folio-node.asc, and a name for the node (3 to 32 lower-case letters, digits, or . _ + -) to an administrator of the site.

  2. The administrator runs, on their own computer, both keys on standard input, the SSH key's line first:

    cat folio-node.pub folio-node.asc | folio admin node add NAME
    

    (Letting a node in is a change, so the administrator gives it with the folio command, signed with their own GPG key.) The site records the node's GPG key as nodes/NAME/pgp.asc, and its fingerprint as the line pgp = in nodes/NAME/node.

    For a node that builds for other processor types, they name them after the node's name, for example cat folio-node.pub folio-node.asc | folio admin node add NAME arm64. Without them, it is amd64. They should see The build node NAME may come in (it builds for: amd64), and signs with the GPG key FINGERPRINT.

    Without the GPG key, the site refuses: send both of the build node's keys: the one line of its SSH .pub file, then its GPG public key (cat node.pub node.asc | folio admin node add NAME ...). A node signs every claim and result with its GPG key; without one the site takes nothing from it.

    A node let in before nodes had GPG keys has none, and the site takes neither its claims nor its results until it has one. Make the node its GPG key (step 3, point 2), and have an administrator add it:

    folio admin node key NAME < folio-node.asc
    

    They should see The build node NAME signs with the GPG key FINGERPRINT from now on. The same command gives a node a new key, after its old one ran out or was lost.

  3. Check, on the node, as the build user:

    ssh -i ~/.ssh/folio-node folio@dur.example.org help
    

    The first time, ssh shows the fingerprint of the site's key and asks whether to trust it. Compare it with the fingerprints on the site's home page (under "Take part"), or with curl -fsS --proto '=https' https://dur.example.org/ssh-host-keys | ssh-keygen -l -f -. Answer yes only if it is among them. You should see You are the build node NAME (for: amd64). Commands: and the node's commands. (folio-node itself does not use what ssh noted here: it fetches the site's keys on its own, see step 5.)

5. Tell the node where the site is

On the node, as the build user, make the folder:

mkdir -p ~/.config/folio-node

Then write the file ~/.config/folio-node/site with a text editor:

ssh = folio@dur.example.org
port = 22
key = /home/builder/.ssh/folio-node
web = https://dur.example.org
pgp = FINGERPRINT
gnupg = /home/builder/.folio-node-gnupg
site-key-fpr = SITE-FINGERPRINT

Each line is name = value, with one space on each side of the =.

Line Means If left out
ssh what the node gives to ssh to reach the site required
port the site's SSH port 22
key the node's private key file, with its full path ssh's own choice of key
web the address of the site's pages. It must start with https:// required: the node does not start (unless FOLIO_NODE_HOST_KEYS is set, see below)
pgp the fingerprint of the node's GPG key (step 3) required: the node does not start
gnupg the keyring that holds that key the GNUPGHOME the node runs with, or else gpg's own (~/.gnupg)
site-key-fpr the site's own key: its master's fingerprint, 40 or 64 hexadecimal digits, as the site's home page and its setup.sh show it (check it with the site's owner). The node gives a build the site's archive only with the archive's key file (ARCHIVE/archive-keyring.gpg, the keys apt checks the archive with, not the record's) and only if its master is this one required: the node does not build (folio-node check shows the fingerprint the site's archive key has now, to compare)
site-ca the site's own certificate authority: its certificate, a PEM file, with its full path. Only for a site whose https certificate is not from a public authority (see A site with its own certificate authority) the system's certificate authorities
site-ca-sha256 that certificate's SHA-256 fingerprint (AB:CD:...), as you confirmed it with the site's owner required with site-ca: without it the node does not start
limit-time how long a build may take in all 4h (see Limits)
limit-memory how much memory each program of a build may have 4G
limit-processes how many processes and threads a build may run at once 1024
limit-disk how much disk a build may use 20G
keyring-DIST the file of the archive keys of the distribution DIST (devuan, debian, ...), with its full path, for one whose keys are not where its keyring package puts them /usr/share/keyrings/DIST-archive-keyring.gpg

Most nodes need no limit- lines. A node with little memory or disk sets them lower; a node that builds very large projects sets them higher, for example:

limit-time = 8h
limit-memory = 8G
limit-disk = 60G

The site's SSH keys

Before it connects, the node fetches the site's own SSH keys from the site's pages: WEB/ssh-host-keys, for example https://dur.example.org/ssh-host-keys, over https only (curl --proto =https). https vouches for that file as it does for the pages. The node keeps the keys in ~/.cache/folio-node/known_hosts and has ssh trust those keys and no others (StrictHostKeyChecking=yes). A server that shows another key is refused before anything is sent. There is no "trust it the first time".

When it starts, the node prints the fingerprints:

2026-01-31 10:15:02 the site's SSH keys, from https://dur.example.org/ssh-host-keys:
2026-01-31 10:15:02    SHA256:CVYpUBmHbjdlUaVvk8umRnNrjXGFe2lKBsY3sDS5+vs dur.example.org (ED25519)

They are the ones on the site's home page. The keys are fetched each time the node starts, and again after a server showed a key they do not hold. If they cannot be fetched when the node starts, the keys fetched before are used; if there are none yet, the node stops.

If the site's pages list other keys than the ones kept (the site's owner changed them, after a break-in or a move, or someone who can answer for the site's https name), the node does not take them by itself. It stops:

folio-node: the site's pages (https://dur.example.org/ssh-host-keys) list other SSH keys than the ones this node trusts for it, so the site was not contacted. If the site's owner told you that its keys changed (after a break-in, or a move), compare the new fingerprints with the ones the owner gives you, and trust them with: folio-node trust-host-keys. Otherwise someone may be between this node and the site

Compare the new fingerprints with the ones the site's owner gives you, then, as the build user:

folio-node trust-host-keys

It shows the keys trusted until now and the ones listed now, and asks Trust the new keys? Type yes, or anything else to keep the old ones:. Only yes puts them in place (The site's new SSH keys are trusted from now on).

A site with its own certificate authority

Almost every site's https certificate comes from a public certificate authority, and a node needs nothing more. A site whose certificate comes from an authority of its own (a site for trying Folio out, or one inside an organisation) gives the node that authority's certificate, and the node trusts it the same way the folio command does (see the Member Guide):

  1. Get the certificate (often ca.crt or ca.pem, never its key) from the site's owner, and put it on the node, for example as ~/.config/folio-node/site-ca.pem.

  2. Show its fingerprint:

    openssl x509 -noout -fingerprint -sha256 -in ~/.config/folio-node/site-ca.pem
    

    You should see sha256 Fingerprint=AB:CD:.... Compare it with the fingerprint the site's owner gives you, in a way you trust (in person, on the phone, or in a message signed with their GPG key), not over the same connection the file came by.

  3. Only if they are the same, add both lines to the node's settings:

    site-ca = /home/builder/.config/folio-node/site-ca.pem
    site-ca-sha256 = AB:CD:...
    

    The fingerprint may be written in either case, with colons or without, or as openssl prints it (sha256 Fingerprint=AB:CD:...).

  4. Run folio-node check. You should see

    The site's own certificate authority (from /home/builder/.config/folio-node/site):
       site-ca = /home/builder/.config/folio-node/site-ca.pem, whose fingerprint is site-ca-sha256 = AB:CD:...
       trusted alone for dur.example.org: the node's fetches from there, git for a source there, and apt in the build system for this site's archive; every other host keeps the system's authorities
    

What the node then trusts it for, and only for the site's host name (the host in web =):

What How
the node's own fetches from the site: its SSH keys, its archive's key and lists curl -q --cacert FILE --capath /dev/null: that authority alone, no other
git, for a project whose source is on the site's host (a forge on the same server) git -c http.sslCAInfo=... -c http.sslCAPath=/dev/null, with the checked certificate given read-only to the fetch's sandbox
apt in the build system, for the site's archive a command sbuild runs in the build system before it updates apt's lists writes the checked certificate to /etc/folio-node/site-ca.pem there and one line of apt's settings, Acquire::https::HOST::CAInfo "/etc/folio-node/site-ca.pem"; in /etc/apt/apt.conf.d/60folio-node-site-ca

The distribution's mirror, debian/watch addresses and every other host keep the system's certificate authorities, and nothing else trusts the site's. There is no fallback to plain http and no setting that turns the check off. The file is checked against site-ca-sha256 when the node starts, before each fetch with it, and at the start of each build; a file that changed is refused, and a build is not started with it.

6. Run it

On the node, as the build user:

  1. See that the sandbox works on this computer, and which limits the node holds builds to:

    folio-node check
    

    Under The site's key, it should show the line you wrote, site-key-fpr = SITE-FINGERPRINT: the site's archive is given to a build only with a key whose master is this one. If it says site-key-fpr is MISSING, add the line (step 5). The last line should be The sandbox hides all of them.

  2. Do one build, to see that everything works:

    folio-node once
    

    The first build for a release takes a few minutes longer: the node makes the build system and fetches the release's list of files. You should see lines like these:

    2026-01-31 10:15:02 folio-node: building for folio@dur.example.org
    2026-01-31 10:15:02 the site's SSH keys, from https://dur.example.org/ssh-host-keys:
    2026-01-31 10:15:02    SHA256:CVYpUBmHbjdlUaVvk8umRnNrjXGFe2lKBsY3sDS5+vs dur.example.org (ED25519)
    2026-01-31 10:15:02 build 12: hello 1.0 for excalibur/amd64
    2026-01-31 10:16:10 build 12: succeeded
    

    The time is in UTC. The last line is what the site took when the result was handed in. If there is nothing to build, the last line is nothing to build and the program stops. once ends with an exit status other than 0 if the node had trouble of its own, or the result was not taken.

  3. Keep it running:

    folio-node run
    

    After each build it asks for the next one at once. When there is nothing to build, it asks again every minute. It runs until you stop it with Ctrl+C.

  4. To start it with the computer, run crontab -e as the build user and add this line:

    @reboot folio-node run >>$HOME/folio-node.log 2>&1
    

    @reboot means "once, each time the computer starts". The rest sends what the node prints into folio-node.log in the build user's home.

Where everything is on the node

/usr/bin/folio-node                       the program
/usr/share/folio-node/folio-debianize     writes packaging for a project without any

/home/builder/
  .ssh/folio-node                         the node's private key
  .ssh/folio-node.pub                     its public key
  .folio-node-gnupg/                      the keyring with the node's GPG key
  folio-node.asc                          its public key
  .ssh/known_hosts                        the site's host key, as ssh noted it at the
                                          check in step 4 (folio-node does not use it)
  .config/folio-node/site                 where the site is (step 5)
  .cache/folio-node/
    known_hosts                           the site's SSH keys, fetched from its pages
                                          each time the node starts (step 5)
    chroots/RELEASE-ARCH.tar.zst          one build system per release and processor type,
                                          made again after 7 days
    contents/RELEASE-ARCH.idx             which package holds which header, library and
                                          pkg-config file, from the release's list of
                                          files; fetched again after 7 days
    contents/RELEASE-ARCH.names           the names of the release's packages, and the
                                          names they provide, from its list of packages
                                          (only after apt could not install what a build
                                          needs); fetched again after 7 days
    work/job                              the facts of the build being done
    work/claim.err                        what ssh said the last time it asked for work
    work/NUMBER/                          one build while it runs. Deleted when the build ends
      box/                                what the steps before the build see as /work:
                                          the source, the source package
      boxtmp/                             what they see as /tmp
      out/                                what sbuild built
      result/                             the log, and what is handed in
  folio-node.log                          what the node printed, if started from crontab

/tmp/folio-node-UID/NUMBER/               sbuild's own build system for one build, unpacked
                                          (under TMPDIR if that is set; outside the home,
                                          so that sbuild's other users can reach it).
                                          Deleted when the build ends, and when the
                                          node starts

Everything under .cache/folio-node can be deleted when the node is not running; it is made again when needed. A build system or list of files not made again for 14 days (a release the site no longer builds for) is deleted by the node itself, when it starts and before it makes a new build system. One still in use is made again after 7 days, so such a file was last used more than a week before. The node prints Deleted PATH (not used for more than a week).

Settings through the environment

These are read when folio-node starts. Most nodes need none of them.

Variable Default Changes
FOLIO_NODE_CONF ~/.config/folio-node/site which settings file is read
FOLIO_NODE_CACHE ~/.cache/folio-node where build systems, lists and builds are kept
FOLIO_NODE_PAUSE 60 seconds to wait before asking again when there was nothing to build or the site could not be reached
FOLIO_DEBIANIZE the installed folio-debianize which program writes packaging
FOLIO_NODE_PROTOCOLS https which kinds of address git may fetch a project's source from, separated by : (the value of git's GIT_ALLOW_PROTOCOL). Only https is safe: over http or git, someone between the node and the forge can hand it other source. Change it only to try Folio out, never on a node that builds for real
FOLIO_NODE_HOST_KEYS none a file with the site's SSH keys (the lines of ssh-host-keys), read instead of fetching them from the pages. For a site whose pages are not on https, as when trying Folio out on one computer. The file must come from the site's own computer, not over the network
FOLIO_NODE_FETCH_TIME 1800 seconds a fetch of a project's source may take at most. A fetch is also given up when the forge sends less than 1000 bytes a second for a minute

For example, to keep the cache on another disk:

FOLIO_NODE_CACHE=/srv/cache/folio-node folio-node run

What the node prints at the end of a build

The node prints The site then shows Means
build N: succeeded succeeded the packages were built and handed in
build N: failed (the package did not build) failed the project itself did not build. The build's log on the site says why
build N: failed (the commit COMMIT is not on the forge) failed the forge answered, but the commit that was imported is not in the repository (it was removed, for example by a forced push)
build N: failed (debian/FILE is a link; files in debian/ must be real files) failed the project's own debian/ folder holds a link (or is one). A link there could lead to the node's own files when something outside a sandbox reads the packaging, sbuild included. The site refuses such a project when it imports it; this is in case it did not
build N: failed (debian/watch names an address that is not https (ADDRESS); the original source is fetched over https only) failed a project in the 3.0 (quilt) format whose debian/watch names an http://, ftp:// or other address (a commented-out line counts too). Make every address there https://
build N: failed (the build took longer than 4 hours), (the build used more than 4 GB of memory), (the build ran more than 1024 processes at once), (the build used more than 20 GB of disk space) failed the build reached one of the node's limits (the numbers are the node's own). It does not count against the node
build N: failed (the source package could not be made) failed the source was fetched but could not be turned into a source package. The log says why
build N: failed (needs wpe-webkit-2.0.pc, which daedalus does not provide) failed a project without packaging cannot do without that pkg-config module, and no package of the release has it, nor any of the site's. Found before sbuild runs. The log says This cannot be built for daedalus: it needs wpe-webkit-2.0.pc, which no package of daedalus has, nor any of this site's.
build N: failed (needs libwpewebkit-2.0-dev, which daedalus does not have) failed sbuild could not install that package, the release has no package of that name (nor one that provides it), and none of the site's packages builds it. It can never build there. Several are named together: needs a, b and c, ...; alternatives as a or b
build N: failed (needs NAME (>= 2.0), which daedalus has but cannot install (apt: ...)) failed the release has it, but apt could not install it (a version that is too old, or what it needs in turn). In brackets: what apt said
build N: waiting (waiting for NAME, from this site, to be published for daedalus in main; it is built again once it is) waiting the build needs a package one of the site's own projects builds, and the site has not published it for that release yet (in main, for a package in main). The site queues the build again by itself once it is published
build N: waiting (needs NAME, which daedalus does not have) as the site decides what the node found, when the site's answer did not say more (a site from before this was added)
build N: waiting (built again: NAME was published while it was being built) queued what the build needs is one of the site's own packages, and it was published while this build was being built: the site queued it again at once
build N: error (...); it is back in the queue queued the node had trouble of its own. The site put the build back in the queue. In run mode the node waits five minutes before it asks again, and it may be given the same build. The build's page says how many tries are left: (attempt 1 of 3 without a result; 2 left)
build N: error (...); it was tried 3 times without a result, so the site counts it as failed failed the third attempt at this build that ended in the node's own trouble, or with no word from its node. The site does not put it back again: it is failed, with the note tried 3 times without a result; last: ..., and its uploader is told as for any failed build. rebuild makes a new build, which starts counting again
build N: no longer wanted superseded, or queued while it was building, a newer commit replaced the build, its package was removed from the site, or the site gave the build back to the queue. Nothing is handed in
build N: no longer wanted; the site took nothing superseded, or queued the same, found out only when the result was handed in
build N: STATE (...), but the result could not be handed in: ... building, then queued the end of the line is what ssh or the site said. The node treats it as its own trouble: run waits five minutes, once ends with exit status 1

The messages in brackets after error are:

Message Means
the source could not be fetched from ADDRESS git clone of the project's address failed: the forge is down or cannot be reached from the node, or the repository is private, or the forge sent less than 1000 bytes a second for a minute. The log has git's own message
fetching the source from ADDRESS timed out after N seconds the forge took the connection, but the fetch had not finished after N seconds (FOLIO_NODE_FETCH_TIME, 1800 if not set): the forge stopped answering, or is far too slow. The log says Fetching the source from ADDRESS timed out after N seconds (the forge stopped answering, or is far too slow). (If the build's own time, limit-time, ran out first, the build is failed instead: the build took longer than ....)
fetching the original source (debian/watch) timed out after N seconds uscan had not fetched the original source after N seconds (FOLIO_NODE_FETCH_TIME): where debian/watch points stopped answering, or is far too slow
the build system for RELEASE could not be made mmdebstrap failed. The log on the site shows its output
this node has no keys for DIST (FILE): install PACKAGE, or set keyring-DIST = FILE the build is for a release of a distribution whose archive keys the node does not have. Install that package on the node (or name the file of its keys in the settings), and the build is taken again. The build goes back to the queue
the site named no distribution and keys this node can use for RELEASE the site's job named a distribution or a keyring package that is not a plain name. The build goes back to the queue; tell the site's administrators
the build system could not be set up (STAGE) sbuild stopped at STAGE, before building
sbuild could not start sbuild stopped without saying where
the list of files in RELEASE could not be fetched from MIRROR for a project without packaging: the release's Contents-ARCH.gz could not be fetched, or came cut short. What the build needs cannot be told from what the release lacks without it, so this is never taken as "the release does not have it"
the list of files in this site's RELEASE/PART could not be fetched the same for the site's own archive (a part it has no list for yet, which it answers with 404, holds nothing, and is no trouble)
the list of packages in RELEASE could not be fetched from MIRROR, to tell what the build lacks sbuild could not install what the build needs, and the release's list of packages could not be fetched to tell what is missing
what the build needs could not be fetched (from MIRROR, or from this site) apt could not download what the build needs (Failed to fetch): the mirror's trouble, not the package's
what the build needs could not be installed, and apt did not say what was missing (see the log) sbuild stopped while installing what the build needs, and the log has none of apt's lines about it
this site's archive could not be reached at ARCHIVE: ... before sbuild, the node could not fetch the archive's dists/RELEASE/InRelease (an answer other than the file or 404). The end is what curl said; curl: (60) SSL certificate problem means the site's certificate is not from an authority the node trusts for it (see A site with its own certificate authority). Without the archive the build would go on as if the site had no packages, so it is not started. (A 404, an archive with nothing for that release yet, is no trouble)
this site's archive key could not be fetched from ARCHIVE/archive-keyring.gpg: ... the same, for the archive's key
the archive key at ARCHIVE/archive-keyring.gpg is not the site's key, so the archive is not trusted: its master is X, and the site's key is Y (site-key-fpr in ...) the archive's key has another master than the one the node's settings name: the line is wrong, or someone answers for the site who is not the site. The build goes back to the queue; ask the site's owner
apt in the build system could not fetch this site's archive: Failed to fetch ... while sbuild set the build system up, apt could not fetch the site's archive, or not trust it (Failed to fetch, GPG error, The repository ... is not signed); the rest is apt's own words. The build had none of the site's packages, so whatever became of it, it is the node's error. certificate verify failed there: the site has its own certificate authority, and the node's settings do not give it (site-ca, site-ca-sha256). Only apt's lines before the build's own command count, not what a package's build prints
the site's certificate authority file FILE is not the certificate whose fingerprint is in the node's settings (site-ca-sha256) at the start of a build, the site-ca file was no longer the certificate confirmed: see the next table

A build that a node took and has not mentioned for fifteen minutes goes back into the queue. The site checks this whenever any node asks for work. That counts as an attempt without a result, as an error does: the third one makes the build failed. A node that asks for work while the site still has it down as building something (it was stopped and started again) gives that build back without its counting.

If something goes wrong

The lines below that start with folio-node: and are about GPG keys or the clock, and the site's refusals (they start with folio:), come at the end of another line: the site could not be reached: ... when the node asks for work, or build N: STATE (...), but the result could not be handed in: ... when it hands a build in.

What you see Why, and what to do
folio-node: no settings: write /home/builder/.config/folio-node/site (see the top of this script) step 5 was not done, or the file is elsewhere
folio-node: /home/builder/.config/folio-node/site has no 'ssh = ...' line the ssh line is missing, or has no space on each side of the =
folio-node: /home/builder/.config/folio-node/site has no 'web = https://...' line: add the address of the site's pages (for example web = https://dur.example.org). The node fetches the site's SSH keys from there before it connects. the web line is missing (settings written before it was needed): add it, step 5
folio-node: the site's web address in ... must start with https:// (it is: ...) the web line has http:// or no scheme: the keys are fetched over https only
folio-node: the site's web address in ... is not a plain https address: ... the web line holds something an address of pages does not (a blank, @, ?, for example)
folio-node: the site's SSH keys could not be fetched from https://.../ssh-host-keys: ..., so the site was not contacted the web line is wrong, the pages cannot be reached, or the site publishes no keys yet (its owner runs folio-install again). The end of the line is what curl said. curl: (60) SSL certificate problem: the site's certificate comes from an authority of its own, which the node's settings do not give (A site with its own certificate authority)
folio-node: what https://.../ssh-host-keys holds is not a list of SSH keys, so the site was not contacted the web line leads to something else than the site's pages
the site's SSH keys could not be fetched from ...; the keys fetched before are used the pages could not be reached at that moment. Nothing needs doing, unless the site has new keys
the site's SSH key does not match the keys it publishes at https://.../ssh-host-keys: nothing was sent. Someone may be between this node and the site, or the site's keys changed: ask the site's owner. the server the node reached showed a key the site does not publish. The node never goes on: in run it fetches the keys again and tries once a minute, once stops. Ask the site's owner; do not work around it
folio-node: the site's certificate authority file FILE is not the one whose fingerprint is in ... (site-ca-sha256 = X; the file's is Y). So it is not trusted, and nothing is fetched from the site with it: check the file and the fingerprint with the site's owner the site-ca file is not the certificate whose fingerprint site-ca-sha256 holds: it changed, or one of the two lines is wrong. Nothing was fetched. Find out why, and confirm the file and the fingerprint with the site's owner again (A site with its own certificate authority)
folio-node: the site's certificate authority file FILE (site-ca in ...) is not one certificate: ... So it is not trusted, and nothing is fetched from the site with it the file cannot be read, holds a private key or several certificates, or is not a certificate in PEM form. Give the authority's certificate alone
folio-node: ... has site-ca but no 'site-ca-sha256 = FINGERPRINT' line: ..., ... has site-ca-sha256 but no 'site-ca = FILE' line: ... the two lines go together: add the missing one
folio-node: site-ca in ... must be a full path, starting with / (it is: ...), folio-node: site-ca-sha256 in ... is not a SHA-256 fingerprint (64 hexadecimal digits, AB:CD:...): ... correct the line
folio-node: the site's own certificate authority is trusted for the site's host name alone, and ... does not give a plain one (in web = https://HOST): ... with site-ca, the web line (or, without it, the ssh line) must name the site by a host name or address of letters, digits, dots and dashes
folio-node: sbuild is not installed (or another program) install the package again: step 1
folio-node: the steps before a build cannot be put in a sandbox on this computer (...), so nothing is built here. ... unshare could not make the sandbox; in brackets is what it said. The build user must be allowed user namespaces (sbuild needs them too: check /etc/subuid, step 2, and that the kernel allows them, sysctl kernel.unprivileged_userns_clone where it exists). In a container, the container must allow unshare and mounting in it (Docker's default seccomp filter does not)
folio-node: limit-time in ... is not a time: VALUE (write it as 4h, 90m or 600s) the limit-time line of the settings: see Limits. The same for limit-memory (is not an amount of memory), limit-processes (is not a number of processes) and limit-disk (is not an amount of disk space)
folio-node: the sandbox does not hide all of this node's own files from folio-node check, after a line SEES PATH: do not run builds on this node, and report it to the site's administrators
folio-node: ... has no 'pgp = FINGERPRINT' line: a node signs every claim and result with a GPG key of its own (see the top of this script for how to make one), and the site takes nothing unsigned the settings name no GPG key: make one (step 3) and add the pgp line (step 5)
folio-node: the site has no GPG key for this node (NAME), so it takes neither claims nor results: give an administrator the node's public key (admin node key NAME < node.asc) the node was let in before nodes had GPG keys: folio admin node key NAME < folio-node.asc (step 4)
folio-node: gpg could not sign with the node's key FINGERPRINT: ... the pgp line names a key the gnupg keyring does not hold, or the key has a passphrase
folio-node: this node's clock is N seconds off the site's, and the site takes a request only within five minutes of its own time: set the clock right the node's clock is wrong: set it (NTP)
folio: this request is not signed with the build node NAME's GPG key (FINGERPRINT); nothing was taken the pgp line names another key than the one the site has for this node: fix the line, or have an administrator set the right one (admin node key)
folio: the build node's GPG key FINGERPRINT has run out ... renew it on the node (GNUPGHOME=~/.folio-node-gnupg gpg --quick-set-expire FINGERPRINT 2y), export it again, and have an administrator set it (admin node key NAME < folio-node.asc)
the site could not be reached: ... the end of the line is what ssh or the site said. Permission denied (publickey): the key was not let in (step 4), the key line names the wrong file, or the node was switched off (the site then lets its key in no more). A connection error: the ssh or port line is wrong, or the site is down. folio: this build node is switched off: an administrator switched it off
the site moved to a new server, or its owner changed its SSH keys the node stops, saying the site's pages list other SSH keys: compare the new fingerprints with the owner's and run folio-node trust-host-keys (see The site's SSH keys)
folio-node: ... has no 'site-key-fpr = FINGERPRINT' line: ... a node set up before Folio needed the line, after an upgrade: add site-key-fpr = FINGERPRINT with the fingerprint the site's home page and setup.sh show; folio-node check shows the one its archive key has now, to compare
the site's answer was not understood: ... the site answered something other than a build or nothing. Run the help check of step 4 and read what it says
build N: error (the build system for ... could not be made) most often uidmap is missing, or the build user has no lines in /etc/subuid and /etc/subgid: step 2. The log on the site has mmdebstrap's own message
in a build's log on the site: The list of files in RELEASE could not be fetched from MIRROR, so what the build needs cannot be looked up. for a project without packaging: the distribution's mirror cannot be reached from the node, or sent the list cut short. The build ends with error (the list of files in RELEASE could not be fetched from MIRROR) and goes back in the queue: it is the node's trouble, not the package's
build N: error (the source could not be fetched from ADDRESS); it is back in the queue the forge is down, cannot be reached from the node, or the repository is private. From the node's computer, open the address: if the forge is down, nothing needs doing, the build is tried again later (three times in all; then it counts as failed, and rebuild tries it again)
build N: STATE, but the result could not be handed in: ... the site was busy for a minute (a backup, for example) or could not be reached. Nothing was taken; the site gives the build back to the queue after fifteen minutes
build N: STATE, but the site's answer was not understood: ... the site answered the result with something else than expected. Run the help check of step 4
every build fails at once stop the running node first (Ctrl+C, or pkill -f 'folio-node run'), then run folio-node once by hand and read what it prints. Never run two nodes with the same key: when a node asks for work, the site takes back whatever that node was still building

Stopping for good

Tell an administrator. They switch the node off (folio admin node disable NAME). Its key no longer gets in, and whatever it was building goes back in the queue. Then stop folio-node, remove the @reboot line from the build user's crontab, and delete ~/.cache/folio-node if you want the disk space back.

More than one node

A site may have as many nodes as it likes; each takes the oldest waiting build it may do. Give each its own key and its own name.

With two or more, a site can have every build checked: a second node builds it again and the site compares the packages byte for byte (the setting verify, in the Settings Reference). A node is never given the check of its own build, so with only one node the checking builds stay in the queue.

A result handed in may be at most 2 GB.