Skip to content

Self-hosting

timber is designed, not built, and this page says what running it yourself will be. There is no hosted timber: self-hosted is the only kind. Everything here follows the statement, whose Part C names the profiles a host binds.

  • One binary. timber runs where the agents run: a laptop, an agent host, a build machine. There is no server of timber’s own to keep up: timber serve answers on localhost, started by the first asker that finds none and ended when idle, for the status pages and the ecosystems that read over HTTP.
  • A store you own. An OCI registry you already have, Amazon ECR, GitHub’s registry, Harbor, zot or the reference distribution, or an OCI image layout in a directory on disk, read and written with no server. The stores guide lists them.
  • A signer you hold. A key in a key service your host’s cloud identity may use and never export, a key file on the host as sluice’s signers keep theirs, or a short-lived certificate from your own identity provider, keyless. The signers guide says which fits where.
  • The policy in the repository. .config/timber.toml at the landed revision says what the repository publishes and through which projections, the signers and what each may claim, what each audience requires, the channels, and the environments with their targets.
  • The gate in your trusted place. Acceptance and promotion run wherever you trust a signer to stand: a laptop for one person, a machine of its own for a team. A machine an agent runs on writes the cache and quarantine, and never promotes.
  • sluice beside it. timber reads sluice’s refs for the landed revision and its signed verdicts; sluice does not know timber exists. A branch sluice does not run is landed by its history alone, with no verdicts.

A solo user needs the binary and the policy file in the repository, and writes nothing else: the first publish makes the store, an OCI image layout in the user’s data directory, and a host key beside it (118). sluice lands, timber pushes into the layout on disk, the same laptop accepts and promotes, and timber sync fills the laptop’s own npm cache, Cargo registry or Python index from the store. The layout syncs to a registry later, or never.

The operator’s bindings for a host are one file, ~/.config/timber/config.toml, or under $XDG_CONFIG_HOME where it is set, beside sluice’s own config.toml and in the same form, readable with any file reader (118). A host needs none: the file is for pointing a host at a registry, a key service or a shared ledger. It names the store, the landing, the ledger, the signer, what tells the gate and the credentials a target’s tool reads, and nothing the repository binds (92):

[store]
layout = "~/.local/share/timber/layout" # C.2
# or: registry = "<host>/<root>", C.1
[landing]
sluice = { remote = "origin" } # C.5; or: branch = { remote = "origin" }, C.6
# remote optional; without one, local refs
[ledger]
git_ref = { remote = "origin" } # C.13; or: store = {}, C.14, the chain in [store]
# remote optional; without one, the repository's own refs
[signing] # sluice's own table, C.8
signer = "laptop"
key = "~/.config/timber/signing"
# or a key in AWS KMS, C.7, alone:
# kms = "arn:aws:kms:<region>:<account>:key/<key id>"
[gate] # what tells the gate, C.16
publish = {} # also with no [gate], 118
# or: job = "<the job's words>"
[credentials] # each a file holding only that credential, 118
dash0-dashboards = "~/.local/share/secrets/dash0-dashboards"

With no file, and for each table a file leaves out, the host is bound to the given ones (118):

  • The store: an OCI layout at ~/.local/share/timber/layout, or timber/layout under $XDG_DATA_HOME where it is set (C.2), named in the host’s record by that path in full.
  • The landing: sluice where the repository’s HEAD commit holds .config/sluice.toml, read from the commit and never from the working tree, and a plain branch otherwise (C.5, C.6). Its remote is the checkout’s origin, else its one remote, else none, the repository’s own refs then read. A checkout with several remotes and none of them origin answers every command unreadable, naming each remote and [landing] remote, the one line that picks one.
  • The ledger: the git ref on the landing’s remote, written or given, fetched before each read and pushed on each append as the branch is, so a second machine of the same repository reads the same chain with nothing written; the repository’s own refs where the landing has no remote (C.13).
  • The signer: for a publish or a promote, the host key at timber/host/signing.key under the same data directory, made by the first claim it signs, its public half beside it as signing.key.pub, signing as the host’s short name, which that public half fixes (C.8; see signers). Every other command signs nothing.
  • What tells the gate: the host’s own publish, as [gate] publish = {} binds it (130).
  • The credentials: none, so an environment whose target names a credential is unreadable, naming it and the file.

A file that names a table binds exactly what it names, and leaves the rest given: [store] registry alone writes under that registry’s root and keeps the given landing, ledger, key and gate; [signing] kms alone signs through that key and makes no host key; [landing] branch = {} reads the repository’s own refs, and keeps the given ledger there too. An empty file is no file.

  • Each seam’s table names its profile by its one key; a table naming none or two is refused, naming it. A path is absolute or begins ~/.
  • timber publish, verify, sync, push, rebuild, promote and status read it, or bind the given tables where there is none. A file that is not well formed is unreadable in the parser’s own words, and binds nothing given in its place: a file that is there is never guessed past. Only where no given path can be placed, neither XDG_CONFIG_HOME nor HOME set, is the binding absent, naming both. timber status binds no signer and makes nothing, its fetch of the ledger’s refs into the repository’s copy aside (60); a file it cannot read is its channels’ answer, and the host’s record still answers beside it.
  • Only publish and push make the layout, the given one with its parents, where the path is missing or an empty directory, at the first thing they ask of the store, so a publish refused before it asks the store anything, a revision not landed among them, makes none; push needs no [signing], since it signs nothing, and push --left binds no landing where the file names no [landing], since it asks the landing nothing, so a check job’s file names [store] alone. verify, sync and rebuild never make or write one, and answer a layout that is not there unreadable, naming its path.
  • The host’s record of the versions it published is a file per version under the repository’s common git directory, timber/published/, which status reads. It can be deleted and rebuilt with timber rebuild, which writes it again from the store and git: one entry for each tag the branch landed whose name the store resolves to that component’s index.
  • [store] registry names a registry’s host and the root every repository of the store is under, <host>/<root>, such as 123456789012.dkr.ecr.us-east-1.amazonaws.com/timber, ghcr.io/<owner>/timber or localhost:5000/timber (C.1). Each repository that publishes keeps its own repositories under the root (see a registry’s repositories). No binding makes a repository. The credential is never the file’s: it is the host’s Docker configuration and the credential helper it names for the registry, ECR’s ecr-login among them, reached when the registry asks for one and kept nowhere (64).
  • [signing] kms names a key in AWS KMS by its key ARN, and nothing beside it: the signer’s name is the ARN. The credential is never the file’s: it is the host’s AWS chain, the environment, the AWS profile and its SSO session, or the container’s or the instance’s role, found at each signature and kept nowhere (64). A table naming kms with signer or key is refused, naming [signing].
  • A machine that only verifies signs nothing: verify reads the keys the policy lists, makes no key, and needs only a copy of the layout and a clone of the repository. Every host binds both signers, the one its [signing] names signing and the other verify-only, so it tells a host key’s claims and a KMS key’s alike.
  • [ledger] names where each channel’s chain is held. git_ref keeps it in the repository’s refs, refs/timber/ledger/<channel>, or refs/timber/ledger/<component>/<channel> where the repository declares components (C.13, 125), pushed to and fetched from the remote it names with the host’s own git credentials, kept nowhere (64); store keeps it as the promotion claims in the store [store] names, walked from the channel’s name there, channel/<channel> or channel/<component>/<channel> (C.14), opened and never made. timber promote signs with the host’s [signing], or the given key where the file names none, and appends to the ledger [ledger] names, or the given git ref on the landing’s remote; promote never makes the layout.
  • [gate] names what tells the host’s gate of a version a publish offered, by one key (130). publish = {} is this host’s own publish: once the publish has answered, the same run tells the gate of each version it offered, and prints the gate’s answer beside the version’s. job = "…" names in your own words a job outside timber that a forge’s or a store’s event wakes; timber runs nothing for it, and a publish says the version is offered and the gate is told by those words. A file with no [gate] binds publish, the host’s default (118), so a host whose gate is elsewhere names its job. A [gate] naming no key, two, or another is refused, naming it.
  • [credentials] names each credential a target’s own tool reads, by the name an environment’s target table gives it, as the path of a file holding only that credential, absolute or beginning ~/ (118). The file never holds a credential, and the binding never opens the file a path names: it hands the path to the target, which hands it to its tool, as the Dash0 target hands Dash0’s CLI its token, or, where its tool takes a credential only in a variable, reads it when it runs and hands it to that tool’s runs alone, as the GitHub release target hands gh its token (64). A value that is no string, or a path of neither form, is unreadable naming the file and [credentials] <name>, never the value, and binds nothing in its place.
  • The build and the projections are the repository’s to bind, not the host’s: moon is the build, and the policy file names each output’s task and the projection that packs it. A [build] or [projections] table is refused, naming it.

The root holds every repository of the store, in three spaces (C.1 as amended at boomdrivedev/blueprints f412008; record 0040, ADR 0023):

  • The repository’s own, <root>/<owner>/<name>, one for each repository that publishes, named by the owner and name its landing remote’s address ends in, lowercased, as the serving process names it (114). A checkout of https://github.com/Acme/Site.git writes under <root>/acme/site. The repository’s own holds the versions and channels of a repository that declares no component, and every blob, artifact, index and claim a publish writes before any name reaches it. Under it hang each declared component’s repository, <root>/<owner>/<name>/<component>, holding its versions’ tags, its channels’ names and its indexes, and one cache repository per build profile, <root>/<owner>/<name>/cache/moon, the build identity its tag.
  • The artifact space, <root>/artifact/<ecosystem>/<name>, one repository per artifact name for the whole store, under no repository’s own, the version its tag. A consumer finds a pin by its ecosystem, name and version alone, and reads the version’s claims beside its index there (138).

Each name’s repository holds what its tag reaches and the claims on it, so a credential, or a package’s visibility, can be scoped to each apart (135). An owner written artifact is refused, since its own repository would sit in the artifact space. A checkout whose landing names no remote, or whose remote’s address ends in no owner and name, still syncs, reading the artifact space, and cannot publish: every write is absent naming the landing’s remote, and nothing is written.

A registry that makes a repository on its first push, zot, the reference distribution and GitHub’s registry among them, makes each of these as timber first writes into it. One that makes repositories only by a creation template, Amazon ECR among them, refuses a push into a repository nobody made, and timber answers that refusal in the registry’s words, naming the repository it was for, and asks nothing again. Before the first publish to such a registry, make repository creation templates applying on push to <root>/artifact/ and to each publishing repository’s <root>/<owner>/<name>/, its own among them, or one template applying to <root>/ that covers both, or each repository by hand.

A template that sets resource tags on the repositories it makes names a role that may tag them: on ECR, a template naming tags and no role makes no repository, and every push under it is refused.

A credential needs to write only where its job writes:

  • a pool’s push writes cache entries alone: write on <root>/<owner>/<name>/cache/, and nothing else;
  • a publishing host writes the repository’s own, its components’ repositories and <root>/artifact/;
  • a promotion writes the channel’s component’s repository, for the channel’s tag, and each repository holding the index, for its claim.

So a credential scoped to one component’s repository makes that component’s versions and moves its channels and no other component’s.

A store written before each repository kept its own root keeps every byte it holds, and nothing carries it (record 0041):

  • Read by nothing now: its undeclared component’s version and channel tags in the root itself; its declared components’ repositories, <root>/<component>; its cache, <root>/cache/<build>, where an entry gone is a build again (54); and the claims held in the root alone.
  • Where they were: its artifact names, <root>/artifact/…, which a consumer still resolves; their claims stay where they were written.
  • Before following anything there, a host binds a new root, or publishes and promotes again under the old one, so each version’s names, channels and claims are written where they are read now.

A repository renamed or moved to another owner gets a new remote address, and every checkout following it binds a new root (C.1; record 0042):

  • The first publish after the move carries its history. Before it builds or claims anything, it marks the old root with where the history went, copies there every version the repository’s record of claimed versions names, with every claim on it, makes each channel’s name at its chain’s head, and records the new root in refs/timber/root, beside the version tags. Nobody runs anything for it, and a carry that stops partway is carried again by the next publish. A version published before the move is promoted at the new root after it, each channel’s chain going on from its head.
  • A checkout whose remote still names the old address is refused. Its publish is refused naming the old root and where its history went, before anything is written, however a forge still redirects the old address; set the checkout’s remote to the new address, git remote set-url origin <address>, and publish again.
  • A move back is refused. A repository moved back to a root it left is refused the same way, since from git alone it cannot be told from a checkout with a stale remote; its history stays where it was carried.
  • The first publish may be refused for its cache. Cache entries are not carried. Where the landing’s run pushed its entries under the old root, the first publish after the move is refused naming the output whose entry the new root lacks, after the carry is done; the pool’s next run pushes to the new root, and the publish after it goes on (54, 135).

GitHub’s registry is bound as any registry, [store] registry = "ghcr.io/<owner>/<root>", and proven by hand outside the gate (record 0039). What it holds, it holds as the owner’s packages (record 0040):

  • Every repository is a package. Each repository’s own, each of its components’ and its cache repositories, and each artifact’s name, is a package of the owner’s, public or private as a whole. GitHub’s registry makes each on its first push, private.
  • The publishing host makes the packages first. Its first publish makes the repository’s own, its components’ and its artifacts’ names’ packages, before any job pushes there.
  • Each package as its repository is. An administrator of the organization sets each package public or private as the repository that publishes it is, one at a time, in its settings. GitHub documents that a public package is never made private again, so decide before you do it. Each new artifact’s name and each new component is a new package, private until that is done.
  • The pool writes only its cache. Give the job’s repository write on <root>/<owner>/<name>/cache/<build> alone, and nothing on any other package, and let the job push with its own token. A package a job makes on its own holds no name the gate accepted, and is refused wherever it is read (95, 96, 135). Where the repository’s prune workflow removes its old cache entries, the repository holds the admin role on its cache packages instead, and that role lets the pool’s push token remove cache entries too: still only cache entries, which a build makes again (54, 145).
  • The host’s token. A publishing host needs a token with write:packages, a host that only reads a private store one with read:packages, kept by docker login ghcr.io in its Docker configuration. A token reaches what its account’s role on each package lets it, whatever scope timber asks.
  • Leave untagged versions alone. An artifact’s manifest, a referrer and a cache entry’s bytes are held by digest, untagged, and named by an index, a referrers tag or a cache manifest. Deleting a package’s untagged versions deletes them. timber prune deletes only a cache entry’s tagged cache manifest, never an untagged version, and nothing else should either.
  • Until its first manifest. A new package serves no bytes until it holds a manifest, which the first publish puts: until then, a read of bytes it holds is unreadable in GitHub’s words.
  • After a repository moves. The carry makes the new root’s packages, each private, as any first push does. An administrator sets each as its repository is, as for a new repository, and gives the job’s repository write on the new root’s cache package, <root>/<owner>/<name>/cache/<build>, alone (record 0040).
  • The check’s leavings. Each run of the GHCR check, moon run ':#check-ghcr', leaves private packages under the root it names; remove them in the organization’s package settings.

A host configured by Nix writes the file from timber’s own flake, with nothing else. The flake gives darwinModules.timber and nixosModules.timber, each also default, declaring services.timber; a system that imports it directly and through another flake’s module declares it once:

# flake.nix: inputs.timber.url = "github:boomdrivedev/timber";
# and timber.darwinModules.timber, or timber.nixosModules.timber,
# among the system's modules.
services.timber = {
enable = true;
user = "alice"; # NixOS only: the user who runs timber
settings = {
store.registry = "123456789012.dkr.ecr.us-east-1.amazonaws.com/timber";
signing.kms = "arn:aws:kms:us-east-1:123456789012:key/<key id>";
credentials.dash0 = "/run/secrets/dash0-token";
};
};
  • settings is the file, under its own names. Each table and key is named as the file names it, store.layout, landing.branch.remote, ledger.git_ref.remote, signing.key, gate.job, trust.<signer>.ssh, and the module renders the file from them. A table or key left unset is left out of the file, so the given binding holds, as above (118). A table set empty, landing.branch = { }, is written, since it binds its profile. A key the module does not declare is written as given, for timber to judge at its read: the module holds none of timber’s rules, which refuse a table naming two profiles, or kms beside signer, as for a hand-written file.
  • A key and a credential are named by their paths. The file is in the Nix store, which every user reads, so signing.key and each credential name a file on the host, absolute or under ~/, put there by hand or by the host’s handling of secrets and readable by the user who runs timber alone. One under the store directory, one that is no path, such as a key’s or a token’s own text, or one given as a Nix path fails evaluation, naming the option. The module reads and copies neither (64).
  • The file is linked for the user who runs timber. The activation links ~/.config/timber/config.toml to the rendered file: on nix-darwin for the system’s primary user, and on NixOS for services.timber.user, which has no default, in that user’s own activation. A file there that is no link is moved once to config.toml.before-nix, both paths named; where that is taken already, neither changes, and the activation says so and goes on. timber reads the file at its next command, and a serving process at its next request, as after a hand edit. A user who points XDG_CONFIG_HOME elsewhere links that folder’s file by hand.
  • The package, and nothing else. The module puts services.timber.package, the flake’s timber for the host’s system, in the system profile; a host may replace it, or set it to null to install none. It starts nothing: no launchd agent or daemon and no systemd unit, so the first asker that finds no serving process starts it (114). It writes no other tool’s file and nothing under the data directory, where timber makes its given layout and host key itself.

One timber serve answers a host, at http://127.0.0.1:7420 (114). No one is told to start it: timber status --page finds it, or starts it detached from the asker’s terminal where none answers, and it ends once nothing has asked it for ten minutes. A host may also run timber serve as a service of its own; a second one finds the first holding the lock, says where it answers, and ends.

What it keeps is in the host’s state directory, ~/.local/state/timber, or timber under $XDG_STATE_HOME where it is set:

  • repositories, the repositories a checkout named: a TOML table per repository, keyed by its owner and name, naming the checkout that last named it, written by timber status --page and read on each request. A repository no checkout named answers absent, and a checkout that is gone is its row’s unreadable answer, naming the path. Deleted, it is written again by the next --page in each checkout.
  • serve.lock, which the serving process holds for as long as it runs, so the host has one.

The process’s working directory is the state directory, never a checkout, and no request writes a file of the record or the repository.

The policy file names each signer with the key that verifies it and what it may claim, and the claims each audience requires, in the order a verdict reads them (82, 83, 116, C.10):

[signers.laptop]
ssh = "ssh-ed25519 AAAA… host@laptop"
kinds = ["provenance"]
[signers.box]
ssh = "ssh-ed25519 BBBB…"
kinds = ["verdict"]
checks = ["cli:test", "core:test"] # by the landing's names (116)
[signers.gate]
ssh = "ssh-ed25519 CCCC…"
kinds = ["acceptance", "promotion"]
[acceptance]
require = [
{ kind = "provenance", signers = ["laptop"] },
{ kind = "verdict", check = "cli:test", signers = ["box"] },
]
[layout]
require = [{ kind = "provenance", signers = ["laptop"] }]
# A line under stable, which every component is given: a verdict of
# core:test after the gate's acceptance.
[channels.stable]
require = [{ kind = "verdict", check = "core:test", signers = ["box"] }]

A signer’s one key besides kinds and checks is what its signer profile verifies it by: for a host key, its public key as ssh-keygen lists one; for a key in AWS KMS, kms = "<key ARN>". require names its signers by their [signers] names, and a name [signers] does not hold is refused, naming it; only a channel names bound_to. The policy is read at the landed revision, never from a checkout (65).

The given channels are a policy fragment shipped with timber, written in the policy file’s own form and laid beneath your file (C.10):

[channels.beta] # moves on each accepted release
on_each_publish = true
[channels.stable] # takes only a version beta has held
bound_to = "beta"

So every component has beta and stable with no line written, declared all the same (102). The fragment can also hold a given off, with held = true, its own mark, which your file never writes. It holds none off today: the held givens are alpha/* and lts/*, a channel for each branch and for each line, never a single alpha or lts, and they come with pattern channels. Each given channel in force requires the gate’s acceptance, by the signers [signers] lets claim acceptance, and those same signers, the gate, are the ones whose promotion of it counts (32).

Writing a held given’s table, empty or with lines, is the one switch, since its keys are already written beneath. No key turns a channel on or off, nothing turns beta or stable off, and held or on written in your file is unreadable naming the key. Each key you write replaces the fragment’s:

[channels.stable] # a claim after the gate's acceptance
require = [{ kind = "verdict", check = "core:test", signers = ["box"] }]
[channels.edge] # a channel of your own, below
on_each_publish = true
[channels.stable] # the same line rebinds stable to edge
bound_to = "edge"
[channels.beta] # beta takes prereleases too
prereleases = true

on_each_publish and bound_to say together how a channel moves, so writing either replaces both, and the fragment’s prereleases with them unless you write your own (37). A channel that follows each publish takes the releases the version rule makes, and prereleases too only where its line says prereleases = true; prereleases under a channel that does not follow each publish is unreadable naming it. A line never widens who signs a given channel’s promotion: a signer it names for a promotion is a claim the version must carry, and the gate stays the promoter. Bindings that come round to where they began are unreadable naming a table, since no version could reach the channel.

approvers under a channel names who may ask for it to move, signers [signers] holds; with none named, any asker the gate verifies may, the host’s own signer while no identity provider stands (129). You write it on the channel you mean, or on a manual environment for the channel that environment makes, never under a channel an environment makes. It narrows who asks and never who signs, and an empty list is unreadable, since it would read as naming no one:

[signers.ci]
ssh = "ssh-ed25519 CCCC… ci@desk"
kinds = ["acceptance"]
[channels.stable] # only ci may ask for stable to move
approvers = ["ci"]

A channel of your own is a table under a name the fragment does not hold, and moves as it says:

[channels.edge]
on_each_publish = true # moves on each accepted release
[channels.next]
bound_to = "beta" # takes only what beta has held
[channels.rc] # moves by a promotion alone
require = [{ kind = "acceptance", signers = ["gate"] }]
[channels.nightly]
on_each_publish = true # moves on each accepted version,
prereleases = true # prereleases too

A channel declared by hand is promoted by the signers its require names that may claim promotion, as gate may above. A table naming both on_each_publish and bound_to is unreadable, since a bound channel takes no version from a publish (37).

Each channel belongs to one component and names only its versions (125). Where the repository declares no component, a channel is [channels.<name>], spelled by its name alone. Where it declares components, the fragment lies beneath each one’s tables, every component has its own beta and stable, and a channel is [channels.<component>.<name>]:

[channels.lib.stable] # lib's stable alone takes this claim
require = [{ kind = "verdict", check = "core:test", signers = ["box"] }]
[channels.web.nightly]
on_each_publish = true

A channel is bound only to another of its own component in force (37). A table of the other form, one under a component the file does not declare, or one naming a component with component = "<name>", is unreadable naming the table and the form to use.

An environment’s words make channels too. policy = "manual" gives the environment a channel of its own, named for it and bound to the channel it names, so it waits on a promotion (41, 97); after gives it one bound to the channel the environments it names follow:

[environments.us]
channel = "stable"
policy = "manual" # makes us, bound to stable
approvers = ["ci"] # only ci may say yes to us
[environments.eu]
channel = "stable"
after = ["us"] # makes eu, bound to us

These are listed like a channel of your own and are promoted by the gate’s signers as a given channel is. Who may say yes to a manual environment is its own approvers, which the channel it makes takes as who may ask for it. A line under a made channel adds claims; one that changes how it moves, or names approvers, is unreadable naming its table, since the environment’s words say both.

An environment’s table holds channel, policy, after, target, and approvers where the environment is manual, and no other key: a target’s own settings sit in the target’s table, and a key such as bucket written on the environment is unreadable naming the table and the key (C.10). approvers on an environment whose policy is auto is unreadable the same way, naming the field, since it names no one who could be asked (C.10). policy other than auto or manual, a made channel named as any channel the fragment holds, held or not, environments named in after that follow two channels, an environment not declared, or one that comes after itself, is unreadable naming the table. A manual environment’s channel moves by timber promote; an after channel moves when the environments it names report the version they run, after timber apply, as the targets page says.

The policy lists a repository’s channels, each with its component and how it moves, read the same way as the policy for one channel, so the two never disagree (131).

timber policy shows the one table in force at the branch’s landed head, the givens beside your own lines: what acceptance and a layout require, then every channel in force, with how it moves, whether it takes prereleases, the claims its versions must carry, who promotes it and who may ask for it. Beneath them, under held off, it shows each given you have not switched on, with how it would move and the line that switches it on, so a channel left off is seen one line away (C.10). The fragment timber ships holds none off, so it shows no held off part. The channels and the givens held off come in one answer of the policy, which carries them apart (131). A claim asked of built artifacts alone is shown so, after its signers (134). Each part is its own answer, so a missing [layout] is shown as absent beside the rest:

$ timber policy
main at 4f2a9c1…
acceptance
provenance by laptop
verdict of cli:test by box, of built artifacts alone
layout
the policy (policy file) holds no policy for layout in .config/timber.toml
channels
beta, each publish
requires acceptance by gate
promoted by gate
may be asked for by any asker
stable, bound to beta
requires acceptance by gate, then verdict of core:test by box, of built artifacts alone
promoted by gate
may be asked for by ci

--branch names another governed branch, and --json prints the answer as one document. It asks the landing and the policy alone and writes nothing (60); a head the branch has not landed is refused naming both, before the policy is read.

The gate and the channels that follow each publish

Section titled “The gate and the channels that follow each publish”

The gate judges an offered version under [acceptance] as it stands at the branch’s landed head when it judges, so a policy that lands binds every judgment after it (107), and a version once accepted stays accepted (94). It accepts the version whole or refuses it whole, naming the artifact and the claim it found wanting (28), and its acceptance is one more claim on the version’s index: no byte changes (26).

Each artifact is asked only the claims asked of artifacts made its way (134). A version’s notes are rendered from its history with no build behind them, and carry the publisher’s provenance naming no build: they are asked that provenance and the claims about the version as a whole, the gate’s acceptance and a promotion, and never a verdict, a test, a review or a rebuild, which the policy file asks of built artifacts alone. The gate tells the notes are rendered from that provenance, counted through a signer [acceptance] names for provenance; an artifact whose provenance names its build, or whose only build-less provenance comes from a signer named for none, is judged as built and asked every claim. The notes still need the publisher’s provenance: a version whose notes lack it is refused naming them.

beta, and every channel of yours with on_each_publish = true, follows each publish. When a publish’s answer tells the gate of a version of a component and the gate accepts it, the gate judges the version under each following channel of that component, and of no other, a prerelease under only those that take prereleases, and where the channel’s policy is met and names the gate among its promoters, promotes the channel itself, its own act, naming its own signer as who asked whatever approvers the channel names: the promotion is held in the ledger before the channel’s name moves (95, 125, C.10). A following channel whose promoters leave the gate out is refused naming them, and the acceptance stands. Each following channel judges each artifact as acceptance told it was made, so a channel’s verdict or rebuild never holds a version for its notes. The gate learns these channels from the policy’s list, never from the file itself (131). A publish never moves a channel, and a version the gate is asked about by anyone else moves none.

The gate never accepts what its own signer offered (27, 96). The one laptop that both offers and accepts is the one signer that may claim both, and its acceptance then says the host accepted what it offered, so a reader tells it from a separated one (108). A laptop with nothing written needs only to list its key for provenance:

[signers.laptop]
ssh = "ssh-ed25519 AAAA… laptop"
kinds = ["provenance"]
[acceptance]
require = [{ kind = "provenance", signers = ["laptop"] }]

Where [signers] names no signer that may claim acceptance and exactly one that may claim provenance, the policy file answers that signer as one that may claim acceptance too: it is the repository’s gate, the one host, accepting what it offered and moving beta on each publish, with no line written for beta (118, 108, C.10). The gate reads this from the policy’s answer and decides nothing of it. Writing kinds = ["provenance", "acceptance"] says the same in so many words. Naming any signer that may claim acceptance ends it: that signer is the gate, and the laptop’s own provenance is refused as offered by the gate when it runs the gate itself.

A policy that names several signers for provenance and none that may claim acceptance accepts nothing, since no one host offers and accepts: the policy for acceptance, and for beta and stable, is refused, wanting an acceptance no signer may make, in the policy’s own words, several publishers and no gate, name an accepting signer (C.10). Each publish offers its version and the gate’s answer beside it carries that refusal; no channel moves. The line that fixes it names the gate:

[signers.gate]
ssh = "ssh-ed25519 CCCC…"
kinds = ["acceptance", "promotion"]

On a fresh laptop the first publish makes the key, and its gate’s answer says the version is not accepted until the policy lists it. List it, land the policy, and the next landing’s publish is accepted:

  1. Print the key’s public half, one line naming the host: cat ~/.local/share/timber/host/signing.key.pub, or $XDG_DATA_HOME/timber/host/signing.key.pub where that is set.
  2. Copy the line as it stands into the policy under [signers.<name>], the name the line ends with, as ssh = "<line>" with kinds = ["provenance"].
  3. Land the policy; from the next landing on, timber publish accepts as one host and moves beta.

Beside that policy, the laptop’s bindings file needs no [gate] for beta to move: with none, the laptop’s own publish tells its gate (118), as naming it does:

[gate]
publish = {}

beta then moves on each publish, in the same run: timber publish offers the version, the gate accepts it as the laptop’s signer, its [signing] or the given key, and the promotion is held in the ledger before beta’s name moves. The answer shows the acceptance and beta’s move beside the version, and the publish exits as a refusal where the gate refused the version or held beta, so a landing step that runs it fails when beta did not move. With no [ledger], the promotion is held in the given git ref on the landing’s remote.

Beside that policy, the laptop’s bindings file needs no [gate] for beta to move: with none, the laptop’s own publish tells its gate (118), as naming it does:

[gate]
publish = {}

beta then moves on each release a publish offers, in the same run: timber publish offers the version, the gate accepts it as the laptop’s [signing] signer, and the promotion, the gate’s own act, is held in the ledger [ledger] names before beta’s name moves. A prerelease is accepted the same way and moves only the channels that take prereleases, each whose line says prereleases = true, leaving beta where it was (C.10). The answer shows the acceptance and each channel’s move beside the version, and the publish exits as a refusal where the gate refused the version or held a channel it moves, so a landing step that runs it fails when beta did not move to a release. With no [ledger], the version is accepted and each channel’s answer is absent naming it.

timber promote 0.2.0 --to stable moves stable to 0.2.0 of the one component, or of the one --component names, under the policy for that component’s stable as it stands at the branch’s landed head; a channel the policy does not list for the component is absent, naming both (125, 131). The version’s index must carry an acceptance a signer the channel’s policy names made, and then every claim it requires, in order; the first found wanting is named with the signers that may make it (31, 58). The host’s [signing] signer must be among the channel’s promoters, the gate’s signers for a given channel and one an environment makes, so a host holding the gate’s signer promotes stable with no line written (9, 32), and it is recorded as who asked. Where the channel names approvers, the host’s signer must be one of them, or the promotion is refused naming it and who may ask, before anything is signed (32, C.10). A channel bound to another, as stable is to beta, takes only a version beta has held, now or before (37).

The promotion is held in the ledger before stable’s name moves in the store (33). --from 0.1.0 says where you expect stable, and a channel that has moved since is refused naming where it is (35); a promotion another host made between your read and your append is refused naming it, never retried. timber promote --back --to stable moves stable back to the version it moved from, one more promotion (34).

timber starts nothing of its own after a landing: the checkout that ran the checks pushes what its run left, and whatever learns that the work landed publishes it. Which of two ways is yours depends on where your checks run.

You land from your own machines. sluice runs the checks on hosts you keep, each candidate’s in a place of its own. The push after the landing runs in that place, the checkout that ran the checks: the repository’s .config/sluice.toml names it as the branch’s release command, which sluice runs in the place once it has landed. The place holds the candidate’s revision, so the command fetches and names the landed one:

[tests]
release = "git fetch -q origin main && timber push origin/main"

timber push <revision> writes, as cache entries, the archives of each task that both the landing’s passing verdicts and the place’s own run name, and answers every other absent, naming the checkout; run in a checkout whose run left nothing, it writes nothing. sluice may run a release more than once, and a push repeated writes nothing. A branch with a hold, whose places sluice releases at their verdicts before the landing, names timber push --left there instead.

Whatever submitted the work waits for it: crew, or wt submit waiting. Once it learns the work landed, it publishes, on the host that ran the checks:

Terminal window
timber publish <revision>

The publish takes the landing’s outputs from the store’s cache: it never offers what its own host built in their place, and it refuses the version, naming the output and its task hash, when the store holds no entry for one (118, C.16).

Your checks run on sluice’s Actions pool. No runner keeps what the checks built, so each run job pushes what its own run left before the landing is decided, and a workflow of the repository’s own publishes after it. That takes four pieces.

Add one step to the run job of the pool’s workflow, after the step that runs sluice job run. It installs timber from its GitHub release, names the registry and nothing else in its bindings file, reaches the registry through Docker’s credential helper for ECR, and runs timber push --left in the checkout the checks ran in, whether they passed or not, since only the tasks that passed are pushed. The run job holds no identity token, which sluice’s pool keeps out of the job that runs checks, so the credential is an access key kept as repository secrets, not a role assumed by OIDC.

# In the run job's steps, after the one that runs `sluice job run`.
- name: Push what the run left
if: ${{ !cancelled() }}
# The checkout `sluice job run` ran the checks in.
working-directory: ${{ github.workspace }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.TIMBER_CACHE_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.TIMBER_CACHE_SECRET_KEY }}
AWS_REGION: us-east-1
GH_TOKEN: ${{ github.token }}
run: |
gh release download --repo boomdrivedev/timber \
--pattern timber-x86_64-linux.tar.gz --output - | tar -xz -C "$RUNNER_TEMP"
sudo apt-get install -y amazon-ecr-credential-helper
mkdir -p ~/.docker ~/.config/timber
echo '{"credHelpers":{"123456789012.dkr.ecr.us-east-1.amazonaws.com":"ecr-login"}}' \
> ~/.docker/config.json
printf '[store]\nregistry = "%s"\n' \
123456789012.dkr.ecr.us-east-1.amazonaws.com/timber > ~/.config/timber/config.toml
"$RUNNER_TEMP/timber" push --left --json

The key belongs to an IAM user whose one policy lets it push to its repository’s cache repositories, <root>/<owner>/<name>/cache/, and nothing else, so a check that reads the key can write cache entries and never offer, accept or move a name (96, 135). For the repository acme/site under the root timber:

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ecr:BatchCheckLayerAvailability",
"ecr:InitiateLayerUpload",
"ecr:UploadLayerPart",
"ecr:CompleteLayerUpload",
"ecr:PutImage",
"ecr:BatchGetImage"
],
"Resource": "arn:aws:ecr:us-east-1:123456789012:repository/timber/acme/site/cache/*"
},
{
"Effect": "Allow",
"Action": "ecr:GetAuthorizationToken",
"Resource": "*"
}
]
}

ECR makes a repository on push only through a creation template, so the operator makes the repository timber/acme/site/cache/moon once, or a template covering timber/acme/site/, before the first push, and the key needs no ecr:CreateRepository (C.1).

.github/workflows/timber.yml is the repository’s own, and runs once for each landing: sluice lands with a GitHub App’s push, which starts a push workflow, as a push made with GITHUB_TOKEN would not. It publishes one landing at a time and never cancels one. Its store credential is a role it assumes by OIDC, since this job runs no check, and the publisher’s host key is a secret of the GitHub environment timber, which this job alone uses.

name: timber
on:
push:
branches: [main]
concurrency:
group: timber
cancel-in-progress: false
permissions:
contents: write # the version's tag (22)
id-token: write # the store's role, by OIDC
jobs:
publish:
runs-on: ubuntu-latest
environment: timber
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- run: git fetch --no-tags origin '+refs/sluice/*:refs/sluice/*'
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::123456789012:role/timber-publish
aws-region: us-east-1
# The repository's own toolchain, so moon runs.
- uses: moonrepo/setup-toolchain@v0
- name: Publish the landing
env:
GH_TOKEN: ${{ github.token }}
SIGNING_KEY: ${{ secrets.TIMBER_SIGNING_KEY }}
run: |
gh release download --repo boomdrivedev/timber \
--pattern timber-x86_64-linux.tar.gz --output - | tar -xz -C "$RUNNER_TEMP"
sudo apt-get install -y amazon-ecr-credential-helper
mkdir -p ~/.docker ~/.config/timber
echo '{"credHelpers":{"123456789012.dkr.ecr.us-east-1.amazonaws.com":"ecr-login"}}' \
> ~/.docker/config.json
(umask 077 && printf '%s\n' "$SIGNING_KEY" > ~/.config/timber/signing)
cat > ~/.config/timber/config.toml <<'EOF'
[store]
registry = "123456789012.dkr.ecr.us-east-1.amazonaws.com/timber"
[landing]
sluice = { remote = "origin" }
[signing]
signer = "ci"
key = "~/.config/timber/signing"
EOF
"$RUNNER_TEMP/timber" publish "$GITHUB_SHA" --json

The policy file names the job’s signer by the public half of that key, for provenance alone, and names it among the signers of the provenance [acceptance] requires:

[signers.ci]
ssh = "ssh-ed25519 AAAA… timber@ci"
kinds = ["provenance"]
[acceptance]
require = [{ kind = "provenance", signers = ["ci"] }]

The gate counts the job’s provenance through that line, and from it tells the version’s notes, which no build made, from its outputs: the notes are asked that provenance and never a verdict, which the policy file asks of built artifacts alone (134).

A landing one of whose outputs the store holds no entry for is refused, naming the output; the pool’s next run of that output’s check pushes it, and the next landing publishes.

One thing this way rests on is still being built: the step needs room in the pool’s run job and to know where its checkout is, which sluice’s Actions pool keeps; sluice’s template names no timber.

Every landing’s run pushes its cache entries, so a store grows with every landing until they are removed. A repository’s entries are kept thirty days from their push unless its policy file says otherwise, in whole days from 0 (145):

[cache]
keep_days = 14

timber prune removes each entry pushed longer ago than that, read from the policy at the branch’s landed head, and nothing else: no version, claim or channel’s name, no tag of the repository and no ledger (54, 22, 34). timber starts nothing, so a scheduled workflow of the repository’s own runs it, with a full checkout of the branch and the landing’s records, as the publish workflow has. On GitHub’s registry the job’s own token removes the entries:

name: timber prune
on:
schedule:
- cron: "17 4 * * *"
workflow_dispatch:
concurrency:
group: timber-prune
cancel-in-progress: false
permissions:
contents: read
packages: write # the cache packages' versions (145)
jobs:
prune:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- run: git fetch --no-tags origin '+refs/sluice/*:refs/sluice/*'
- name: Remove old cache entries
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release download --repo boomdrivedev/timber \
--pattern timber-x86_64-linux.tar.gz --output - | tar -xz -C "$RUNNER_TEMP"
echo "$GH_TOKEN" | docker login ghcr.io -u "$GITHUB_ACTOR" --password-stdin
mkdir -p ~/.config/timber
cat > ~/.config/timber/config.toml <<'EOF'
[store]
registry = "ghcr.io/acme/timber"
[landing]
sluice = { remote = "origin" }
EOF
"$RUNNER_TEMP/timber" prune --json

On GitHub’s registry the token may delete a cache package’s versions only where the repository holds the admin role on that package: an administrator of the organization gives the repository the admin role on each of its cache packages, <root>/<owner>/<name>/cache/<build>, and nothing on its components’ or its artifacts’ packages, which the publishing host makes (record 0040). timber deletes each entry’s cache manifest through GitHub’s API there, as GitHub documents no other way.

On ECR the job assumes a role by OIDC, permissions: id-token: write in place of packages: write, configured as the publish workflow’s is, whose one policy lets it read and delete in its repository’s cache repositories and nothing else. For the repository acme/site under the root timber:

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["ecr:BatchGetImage", "ecr:ListImages", "ecr:BatchDeleteImage"],
"Resource": "arn:aws:ecr:us-east-1:123456789012:repository/timber/acme/site/cache/*"
},
{
"Effect": "Allow",
"Action": "ecr:GetAuthorizationToken",
"Resource": "*"
}
]
}

The first prune removes every entry pushed before cache entries said when they were pushed. A landing whose entries are removed before it is published is refused naming the output, and the next landing’s run fills the cache again (54, 135).

A team needs a registry its hosts share, a signer bound to each host’s identity rather than a file that travels, and a trusted place for the gate: a machine that holds the signer the acceptance policy names, which no agent writes to. Each developer’s laptop and each agent host pushes to quarantine with a signer the policy admits for that; only the gate’s signer may accept and promote. Environments subscribe to the channels the gate moves, and converge through the targets the repository binds.

A host that only offers must name the job that tells the gate: without a [gate], its publish asks its own gate, which refuses the version where the policy does not let the host’s signer accept, and the publish exits as a refusal with the version still offered. With the job named, each publish says where the version went to be judged:

[gate]
job = "the release job a push to main wakes"

timber runs nothing for the job and carries its words as written, and the publish asks the gate nothing.

  • Every byte: the store is your registry or your disk, and timber keeps no copy.
  • Every signature: made by a signer you hold, bound to an identity you issued.
  • Every ledger entry: promotions are signed records in your store, and a rollback is one more.
  • Every policy: a file in your repository, at the revision that landed.
  • Nothing hosted: no account with anyone, no service in the path from a landing to an environment.