Repository navigation
feat(apt): the signed apt repository for dashmate - #100
Merged
Merged
Conversation
A new stack, stacks/apt, for dashpay/platform#4246: a private bucket behind CloudFront at apt.services.dash.org/dashmate, and the job that signs and publishes it. The publisher is a CodeBuild project that runs publisher/ from this directory. It takes a release's debs from GitHub, checks them against the release's SHA256SUMS and against the tag, and writes three suites: stable (final releases a maintainer signed), testing (beta, rc and final) and dev (dev builds as well). Every suite is signed from the first run, empty or not. Release carries Valid-Until ten days ahead and a daily schedule signs it again. Only a state machine may start the publisher, and it passes one value, the tag. The role for dashpay/platform's release workflow can start that state machine and read how it ended, nothing else. There is no key yet: the keyring is not committed, the secret is empty and the schedule is off, so every run is refused. Co-Authored-By: Claude Fable 5.2 <[email protected]>
An input without a tag failed the Choice state: IsString on a field that is not there is a runtime error. Test IsPresent first. Found by starting the machine with {} after the first apply.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
The repository has its key: primary A5F90926475EF25346DCE26836EF5BF853D100FE, signing subkeys 94E1AA9232F710AF51400D2242D07EC597C92A74 (online) and 51C0AF253270F3DACE9F40078A30392F222E0ACC (standby), all expiring 2027-11-25. The keyring is the public key only. The online subkey's secret part is the value of the secret dashmate-apt/signing-key, put there by hand; the primary and the standby are held by the head of infrastructure. Applied. The first run published stable, testing and dev, empty and signed. The daily run is on by default from here; schedule_enabled = false is for a repository without a key. Co-Authored-By: Claude Fable 5.2 <[email protected]>
17 tasks
dcg-infraclaw
Bot
changed the base branch from
feat/adopt-existing-infra
to
master
November 25, 2026 12:38
This was referenced Nov 25, 2026
A final release reaches stable when its SHA256SUMS is signed by a key in publisher/maintainers/. dashpay/platform#6274 added a second signer there, QuantumExplorer, 556CBC89DA31CAD4928F0926D59CAD3E1BEAFEF0; this adds the same key here. The key file is the one published on the GitHub account QuantumExplorer (github.com/QuantumExplorer.gpg), exported minimal; its fingerprint is the one in ALLOWED_SIGNERS on v5.1-dev and in the issue. dashpay/platform#6267 ships the keyring at /etc/apt/keyrings/dashmate-archive-keyring.gpg, not under /usr/share, and a pin file. The README, the keyring's README and the integration test say so now. Nothing in the publisher depends on the path. Tested: 19 unit tests; tests/integration.sh in Ubuntu 24.04 and 22.04 containers, all passed. Co-Authored-By: Claude Fable 5.2 <[email protected]>
The README said nothing tells a person when the daily run fails. Since 2026-11-25 a timer on infraclaw's operations host reads every suite's InRelease each 15 minutes and reports in Slack. No change to the stack. Co-Authored-By: Claude Fable 5.2 <[email protected]>
dashpay/platform#6289 starts the state machine with {"tag": "v5.1.0-rc.2", "sha256sums_sha256": "<64 lowercase hex>"}: the sha256 of the SHA256SUMS its checksums job checked and attached. A release's assets can be replaced after that check, so the tag alone does not say which packages were meant (dashpay/platform#4246, Ivan's comment of 2026-11-25). - The state machine passes sha256sums_sha256 to the build as SHA256SUMS_SHA256, beside RELEASE_TAG. An input that names a tag without it, or with either value not a string, ends in a Fail state, Publisher.RequestRefused, and no build starts. An input without a tag is the refresh, as before. - The publisher refuses a tag without the sha256, and a sha256 that is not 64 lowercase hex digits, before it reads anything. It refuses the release's SHA256SUMS unless it hashes to that value, before it fetches a deb or writes a file. A release's SHA256SUMS is read once in a run. - stable is as it was: a final release gets there only with a maintainer's SHA256SUMS.asc. The daily run sends {} and needs no sha256: it adds no release, and what it moves into stable is already in testing and listed in a SHA256SUMS a maintainer signed. - A release published by hand now needs the sha256 too; the README says how. Not applied. Until terraform apply, the live state machine passes only the tag and ignores the new field. Tested: 31 unit tests, six of them new ones that run publish.py itself with throwaway keys and local releases (a replaced SHA256SUMS, a tag without the sha256, the refresh, stable); terraform fmt and validate; the rendered definition against the ASL schema. tests/integration.sh was run with the apt client stubbed, on a machine without root: its publisher steps pass, its apt steps still need a container. Co-Authored-By: Claude Fable 5.2 <[email protected]>
… left out Asked for as optional in dashpay/platform#4246 (Ivan, 2026-11-25): tell the requested release's outcome apart from problems with other releases, and answer "skipped" for a prerelease kind the repository does not take. - A run with a tag ends its log with `PUBLISHED: <tag> is in <suites> as <version>`, once every suite is written. - Exit status 1 now has one meaning: the run is done, and a release other than the requested one needs a person. The requested release cannot be the subject: its SHA256SUMS is read once in a run, and a fault in it is a refusal. - A release tag of a kind that is left out (alpha, pr, hotfix) ends `SKIPPED:` with exit status 3, before anything is read. It was `REFUSED:` with 2. A request that is not well-formed is still refused, whatever its kind. What is published does not change. The state machine does not interpret the exit status: 1 and 3 still end the execution FAILED, with the status in the cause. Turning them into a result of a successful execution needs the build to hand a value to the state machine, which was not done here: it cannot be tried without AWS. Tested: 35 unit tests; tests/integration.sh with the apt client stubbed, including REAL=1 against v5.1.0-rc.1 of dashpay/platform. Co-Authored-By: Claude Fable 5.2 <[email protected]>
… a request
From a review of the two commits before this one.
- A release refused at its second deb left the first one in the pool,
for good: the pool is write-once. Both debs are now downloaded and
checked first, and they go into the pool only once the signing key has
been read and checked too. A refusal of the request, the release, what
is published or the signing key leaves the repository as it was. (The
write-once pool file was there before these commits; the claim that
nothing is written was new.)
- RELEASE_TAG and SHA256SUMS_SHA256 are taken as they come. A variable
that is set and empty is a request, and refused: {"tag": "",
"sha256sums_sha256": ""} went to the build and ran as a refresh that
ended green. Nothing is trimmed any more, so the sha256 is 64 lowercase
hex digits exactly, as the messages say. The daily run sets neither
variable and is the refresh, as before.
- "Read once in a run" was true only of a read that succeeded; the
docstring says so.
- The by-hand recipe hashed a second download, not the file that was
looked at.
- Each run left an empty gpg socket directory under /run/user.
Tested: 40 unit tests, 13 of them running publish.py itself. New ones
count the downloads (SHA256SUMS of the requested release: one), break
the second deb, hand over a signing key that is refused, and ask for a
skipped kind with no keyring at all. Ten deliberate breakages of the
publisher were each caught by at least one test. tests/integration.sh
with the apt client stubbed, including REAL=1; terraform validate; the
rendered definition against the ASL schema.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The infra half of dashpay/platform#4246: a signed apt repository for dashmate at
https://apt.services.dash.org/dashmate. Prepared by Claude at latte's request.The new files are
stacks/apt/and one row in the root README. It uses thestacks/layout andmodules/github-oidc-rolefrom #93, which is merged.What it builds
A/AAAArecords inservices.dash.org.stacks/apt/publisher/. It is the only thing that writes the bucket and the only thing that reads the signing key.dashmate-apt-releasefordashpay/platform's release workflow.How it behaves
stabletakes final releases whoseSHA256SUMSa maintainer signed.testingtakes betas, release candidates and finals.devtakes dev builds as well. All three are signed from the first run, empty or not, as asked in the issue.SHA256SUMS(728af96,ee104eb,a843ba5, asked for in this comment). The input is{"tag": "v5.1.0", "sha256sums_sha256": "<64 lowercase hex digits>"}: the sha256 of theSHA256SUMSthe release run checked and attached. The publisher downloads the release'sSHA256SUMSand refuses it unless it is that file. A tag without the digest ends in the state machine withPublisher.RequestRefusedand no build starts.{}is the daily refresh and is unchanged.SHA256SUMSlists and its version is the one the tag stands for. Both debs, everything else the run reads and the signing key are checked before anything is written to the pool. A final release without a maintainer's signature waits intesting; a later run moves it once the signature is attached. The digest does not stand in for the signature.PUBLISHED: <tag> is in <suites> as <version>; exit 1 andNEEDS A PERSON:when another release needs a person (the requested one is published all the same); exit 2 andREFUSED:; exit 3 andSKIPPED:for a kind of prerelease the repository leaves out (alpha,pr, hotfix). The table is instacks/apt/README.md.Valid-Untilis ten days ahead and a daily run signs every suite again.StartBuildlets the caller replace the build's commands.The key
Made on 2026-11-25 (
04fe5c2). PrimaryA5F90926475EF25346DCE26836EF5BF853D100FE, signing subkeys94E1AA9232F710AF51400D2242D07EC597C92A74(online) and51C0AF253270F3DACE9F40078A30392F222E0ACC(standby), all expiring 2027-11-25. The public keyring isstacks/apt/publisher/keyring/dashmate-archive-keyring.gpg. The online subkey's secret part is the value of the secretdashmate-apt/signing-key; the primary and the standby are held by latte.stacks/apt/README.md, "The key", is the rotation runbook.Maintainer keys
A final release reaches
stablewhen itsSHA256SUMSis signed by one of the keys instacks/apt/publisher/maintainers/. There are two, the same two asALLOWED_SIGNERSin dashpay/platform: Ivan Shumkov's19E460D55429A91B40E9E7C5EDBC0AA6BC1AA13Cand QuantumExplorer's556CBC89DA31CAD4928F0926D59CAD3E1BEAFEF0(ae9abf2, after dashpay/platform#6274 merged). QuantumExplorer's key file is the one published on his GitHub account; he has been asked to confirm the fingerprint himself and has not answered yet.Paths on a host
They belong to dashpay/platform#6267 (merged), which ships the source file, the keyring at
/etc/apt/keyrings/dashmate-archive-keyring.gpgand a pin file in the deb. The keyring onv5.1-devis the one in this PR, byte for byte.Not in this PR
InReleasefrom outside each 15 minutes and says in Slack when one is stale, close to expiry, expired, unreachable or not signed by this key.State
Applied to
dashdevfrom this branch ata843ba5on 2026-11-26 09:43 UTC (three resources changed: the state machine, the publisher's code and the version the project runs; a plan afterwards shows no changes). The repository is live and the daily run is on: its first scheduled run, 2026-11-26 05:17 UTC, succeeded.testinganddevcarry5.1.0~rc.1-1for amd64 and arm64;stableis signed and empty.Tested
At
a843ba5:python3 -m unittest discover -s stacks/apt/publisher/tests: 40 tests, 13 of which runpublish.pyitself with throwaway keys.stacks/apt/publisher/tests/integration.shin Ubuntu 24.04 and Ubuntu 22.04 containers, with throwaway keys and a real apt client: empty signed suites accepted byapt-get update; install, upgrade, rollback and install by version; a host ontestingreaches the final release;Releaseaccepted nine days on and refused after eleven; the standby subkey takes over with no change on the host; every refusal above, with the repository unchanged after it.terraform planon the real state before the apply: 0 to add, 0 to destroy; the three resources named under "State" change.v5.1.0-rc.1with the sha256 of itsSHA256SUMS:SUCCEEDED,PUBLISHED: v5.1.0-rc.1 is in testing, dev as 5.1.0~rc.1-1. Both debs are already published, so no package was written.FAILED, exit status 2,REFUSED: v5.1.0-rc.1: the release's SHA256SUMS has sha256 74acd72a…8d4e, and the request was made for 0000…0000.FAILEDwithPublisher.RequestRefused; no build started.v5.1.0-alpha.1: exit status 3,SKIPPED: … prereleases named 'alpha' are not published.{}:SUCCEEDED, the suites left as they are (signed under 12 hours before).Error while executing command: python3 publish.py. Reason: exit status <n>, the form the job in dashpay/platform reads.InReleaseandRelease.gpgverify with gpgv against the committed keyring.Earlier, at
ae9abf2:InReleaseandRelease.gpgverify with gpgv against the committed keyring; a real apt client (Ubuntu 24.04) runsapt-get updatecleanly against each suite and refuses the repository when given another keyring.v5.1.0-rc.1from the GitHub release intotestinganddev. In fresh containers of Ubuntu 24.04, Ubuntu 22.04 and Debian 12, the by-hand procedure from Host a signed APT repository for dashmate packages platform#4246 runsapt-get updatecleanly and installs it through the CDN, anddashmate --versionanswers5.1.0-rc.1. The arm64 deb, fetched directly, is whatPackageslists.Not tested: the release role used from GitHub Actions (the first run of the job from dashpay/platform#6289 will be that; it is off until the variable
DASHMATE_APT_PUBLISHis set), an install on an arm64 machine, and a final release moving intostablein the live repository (no final release has a maintainer's signature yet).🤖 Generated with Claude Code