Skip to content

Host a signed APT repository for dashmate packages #4246

Open

Description

@shumkov

Summary

Dashmate needs a signed APT repository so masternode operators can install and update it the way they install and update everything else on their server — apt update && apt upgrade — with signature verification handled by apt. Today no such repository exists, and the packages we publish cannot be verified by anyone.

This issue is the infrastructure half of that work: where the repository lives, who holds the signing key, and how CI publishes to it. The dashmate CLI changes are a separate, dependent task.


Why we need this

1. Our recommended install method has no update path and no verification.

The docs recommend the .deb from GitHub Releases for mainnet masternodes (installation.md), but the only fully documented update recipe is npm-based — the method the same docs warn against for mainnet. A .deb user has to notice a release happened, find the right asset name, wget it, and apt install ./file.deb by hand.

2. Nothing we ship is verifiable.

Latest release (v4.1.0) assets: no SHA256SUMS, no .asc, no InRelease, no Release.gpg. Only the macOS .pkg is signed (Apple codesign + notarization). An operator downloading a dashmate .deb has no way to confirm it came from us. By contrast, Dash Core already does this properly — dashpay/dash releases ship per-binary .asc files and a SHA256SUMS.asc counter-signed by two maintainers. Dashmate should meet the same bar, and ideally share the same trust model so operators verify dashd and dashmate the same way.

3. We already build APT metadata and throw it away.

Every release publishes Packages, Packages.gz/bz2/xz and Release as GitHub Release assets. They're unsigned (InRelease and Release.gpg are absent — oclif only generates them when a signing key env var is set, which our workflow never sets), and nothing serves them as a repository, so no apt client can use them. The metadata is generated, uploaded, and ignored. Modern apt would reject the repo outright without [trusted=yes], which disables verification entirely.

4. Security updates currently have no delivery mechanism.

If we ship a dashmate security fix today, there is no channel that tells operators or delivers it. Adoption depends on people reading release notes.

Audience check — v4.1.0 download counts: .deb ×44, tarballs ×1, macOS .pkg ×0, Windows .exe ×0. Debian packages are effectively the whole native-install audience, which is why this is the channel worth investing in.


Known blocker (platform-repo side, flagged for awareness)

Our .deb version strings are not monotonic, so apt cannot reliably order releases. oclif builds the version as <upstream>.<gitsha>-1, which discards the semver prerelease tag and makes the git sha an ordering component. Under dpkg's comparison rules a sha starting with a digit sorts below one starting with a letter, so ordering between builds is effectively random.

Verified against the real published v4.1.0-series assets:

transition deb versions apt verdict
beta.2 → rc.1 4.1.0.08152ea51e-1 vs 4.1.0.ae554fdd83-1 refused (sees a downgrade)
rc.1 → rc.2 4.1.0.3de436123d-1 vs 4.1.0.08152ea51e-1 refused (sees a downgrade)
rc.2 → rc.3 4.1.0.61be67f7bf-1 vs 4.1.0.3de436123d-1 upgrade
rc.3 → 4.1.0 4.1.0.bfc80249b9-1 vs 4.1.0.61be67f7bf-1 upgrade

Worse: a same-version security rebuild would never install. With 4.1.0.bfc80249b9-1 installed, a hotfix built from a later commit produces 4.1.0.284f02fabb-1, which compares lower — apt reports "already the newest version" and the operator believes they are patched.

Fix (packaging change, our side, not infra's): emit a Debian-idiomatic monotonic version — 4.1.0~rc.3-1 for prereleases (~ sorts below the release), 4.1.0-1 for stable, rebuilds bumping the Debian revision — plus a CI gate asserting each release sorts above the last. The repository is not useful until this lands, so it should be sequenced first.


The decision we need from infrastructure

Where does the APT repository live, and who holds the signing key?

Important constraint: whatever we pick, the repo URL ends up in every operator's sources.list. Changing it later means a manual edit on every masternode in the fleet, so this choice is expensive to reverse.

Option A — self-hosted pool (aptly or reprepro → object storage + CDN, e.g. apt.dash.org)

✅ Trust anchor is entirely ours — no third party can sign packages our operators trust
✅ We control retention. Rollback depends on this: apt install dashmate=<old> only works if old versions stay in the pool
✅ URL permanence under a dash.org domain; no vendor migration risk
✅ Full control of Valid-Until and the re-signing cadence (see hardening below)
❌ We own uptime, TLS, and CDN cache invalidation — an outage silently stops fleet updates
❌ We own key storage and rotation
❌ One-time CI work: aptly/reprepro publish step, durable pool state, and a lock so concurrent releases can't corrupt the index

Option B — managed (Cloudsmith, packagecloud)

✅ Stands up in minutes; they handle metadata generation, signing, CDN, and the end-user docs
✅ No uptime or TLS burden on us
✅ Cloudsmith supports bringing our own GPG key, which recovers much of the trust story
✅ Cloudsmith has an open-source hosting policy worth checking eligibility for
❌ A vendor account becomes part of the supply chain — a stolen API token can publish packages
❌ Retention limits: plans that prune old versions silently break rollback
❌ Vendor URL baked into every operator's sources.list
❌ Storage/egress quotas: our .deb is ~98 MB × 2 architectures ≈ 200 MB per release, before retention

Platform team's recommendation: Option A (self-hosted). Two reasons, both about things that are painful to reverse — retention control (rollback needs it) and URL permanence. The extra effort is a one-time CI publish step rather than an ongoing burden. That said, if nobody wants to own uptime and key custody, Option B with our own GPG key is a defensible trade; we'd want written confirmation on the retention policy before committing.


What needs to be done

Infrastructure

  • Decide Option A vs B (this issue's main question).
  • Provision hosting: bucket/CDN + DNS (e.g. apt.dash.org), HTTPS with HSTS. Repo layout should be a persistent pool across releases, not one release's files.
  • Create the signing key: dedicated to the dashmate APT repository, used for nothing else, expiry ≤ 1 year. Publish the fingerprint so it can be documented and shipped in-package.
  • Write the rotation and revocation runbook before the key goes live. APT has no revocation mechanism — recovery from a leak means shipping a new keyring package and a signed announcement, and anyone frozen on an old snapshot never finds out. Plan expiry too: expired repo keys are a recurring, well-known cause of silent update outages.
  • Key storage: to be held as a GitHub Actions secret scoped to a protected Environment (see below), or in whatever secret store infra prefers if CI can reach it. Must be passphraseless or agent-backed, since the packaging tool invokes gpg non-interactively.
  • Set Valid-Until on the Release file (7–14 days) and schedule a job that re-signs the unchanged Release before it expires. Without an expiry, a signed snapshot is valid forever, so anyone in a caching or mirror position can freeze a fleet on a pre-fix snapshot indefinitely — signatures still verify and nothing looks wrong. This is the single most important hardening item and it needs a recurring job, not just a release-time step.
  • Retention policy: how many previous versions the pool keeps. Rollback and version pinning depend on this.
  • Separate suite for prereleases so an rc can never be offered to a mainnet node on the stable suite.

CI / release pipeline hardening (prerequisite for holding the key — needs infra + platform)

These are prerequisites because they determine whether "CI-held signing key" is a reasonable trade or a single point of total compromise. Today it's closer to the latter:

  • Gate the signing job behind a GitHub Environment with a v* tag deployment policy and required reviewers. Right now release.yml has workflow_dispatch with no environment gate, so plain repo secrets are reachable from any branch by anyone with write access.
  • Pin third-party actions to full commit SHAs. The release path currently uses docker-practice/actions-setup-docker@master — a floating ref on a third-party action — plus several mutable version tags. (The repo already does SHA pinning correctly in milestone.yml, so the convention exists.)
  • Isolate the signing step from dependency installation: scripts/pack_dashmate.sh runs yarn install --no-immutable, so transitive postinstall scripts would execute in the same job that holds the key. Build artifacts in one job, sign in a minimal separate job.
  • Publish SHA256SUMS + maintainer-signed SHA256SUMS.asc, and gate repository publication on it — refuse to publish a .deb whose hash isn't in the signed sums file. This means a CI compromise alone cannot ship a package; it also needs a human signature. This is what makes the CI-held key acceptable.

Platform repo (dashmate side — separate issue, listed for sequencing)

  • Fix the deb version scheme + CI monotonicity gate (blocker, do first).
  • Ship the repository public key inside the dashmate package and write the sources.list.d entry with a mandatory Signed-By: scoping it to our repo only. The key must never be fetched at runtime, and must never land in /etc/apt/trusted.gpg.d/ — a key there is trusted for every repository on the operator's system, meaning a leaked dashmate key could sign openssh-server.
  • Verify build inputs: the bundled Node runtime is currently fetched with its SHASUMS256.txt.asc downloaded but never signature-checked, and Binaryen is fetched with no checksum at all. That Node binary ends up inside the .deb we're about to sign. Signing makes an artifact attributable, not trustworthy.
  • dashmate update reworked to update software + images (delegating the binary swap to apt), update notifications, and docs rewritten around the new install/update flow.
  • Optional auto-update, off by default.

Sequencing

  1. Fix the deb version scheme (platform) — nothing below works without it.
  2. Decide hosting; provision it; create the key; write the rotation runbook (infra).
  3. Harden the release pipeline (infra + platform) — before the key exists.
  4. Wire up the CI publish step + Valid-Until re-signing job.
  5. Dashmate CLI changes + documentation (platform).

Notes

Full design detail, threat model, and the reasoning behind rejecting a self-replacing updater (@oclif/plugin-update) live in the platform team's working spec. Happy to walk through any of it — particularly the Valid-Until freeze scenario and the keyring scoping, which are the two items where a wrong choice is silently insecure rather than visibly broken.

Activity

  1. added
    enhancement
    dashmate
    priority: high
    on Jul 28, 2026
  2. DashBot-0001 commented on Jul 28, 2026

    @DashBot-0001

    Strong +1 on sequencing the version-scheme fix first. One gap in that step, plus two smaller notes.

    The version fix itself is a downgrade for everyone already on a .deb

    The proposed target 4.1.0-1 sorts below the currently published 4.1.0.bfc80249b9-1, so the very release that fixes ordering would be refused by every existing deb install:

    $ dpkg --compare-versions 4.1.0-1 gt 4.1.0.bfc80249b9-1 ; echo $?
    1          # refused
    $ dpkg --compare-versions 4.1.1-1 gt 4.1.0.bfc80249b9-1 ; echo $?
    0          # fine
    

    Two ways through, depending on where the switch lands:

    • If the first release under the new scheme is 4.1.1 or higher — nothing to do, it sorts above the old form naturally.
    • If a 4.1.0 patch is ever needed, or the switch happens while still on 4.1.0 — it needs an epoch: 1:4.1.0-1. Verified this keeps the intended ordering intact:
    1:4.1.0~rc.3-1  ->  1:4.1.0-1   upgrade   (~ still sorts below release)
    1:4.1.0-1       ->  1:4.1.0-2   upgrade   (same-version security rebuild works)
    1:4.1.0-2       ->  1:4.2.0-1   upgrade
    

    Worth stating explicitly in the issue that an epoch is permanent — once 1: is introduced every later version carries it, or the next one is a downgrade again.

    The CI monotonicity gate needs the right baseline

    The proposed gate ("assert each release sorts above the last") only catches this if "the last" means the last version actually published as a .deb, not the previous entry in the current build sequence. Comparing within the new scheme only, 4.1.0-1 looks like a perfectly ordered first release — the break is invisible unless the baseline is the real in-the-wild version string.

    Two smaller notes

    Release metadata is incomplete beyond Valid-Until. The published v4.1.0 Release has Origin: undefined and is missing Label, Codename, Version, Architectures, Components and Acquire-By-Hash. (It also lists itself in its own checksum table, with the hash of the pre-checksum skeleton — deterministic, harmless, since apt never reads that entry, but it's a sign the generated output wants a full review rather than a Valid-Until patch.) Since a pool-based repo regenerates metadata anyway, this mostly argues for not treating the existing generator output as a starting point.

    Action pinning is broader than the one @master reference. In release.yml today no uses: is SHA-pinned — the mutable tags are as reachable as the floating branch:

    docker-practice/actions-setup-docker@master
    softwareforgood/check-artifact-v4-existence@v0
    geritol/[email protected]
    cargo-bins/[email protected]
    actions/checkout@v4, actions/github-script@v6,
    actions/upload-artifact@v4, actions/download-artifact@v4
    docker/login-action@v3, softprops/[email protected]
    

    docker-practice/actions-setup-docker is also worth a second look on its own merits: ~100 stars, no push since 2025-08, 14 open issues. That's the maintenance profile of a project on the path that would hold the signing key.

  3. DashBot-0001 commented on Jul 28, 2026

    @DashBot-0001

    Following up on step 1 with the implementation detail, since "packaging change, our side" turns out to have a narrower set of options than it looks.

    Where the version actually comes from

    oclif/oclif — src/upload-util.ts:

    export function debVersion(buildConfig: TarballConfig): string {
      return `${buildConfig.config.version.split('-')[0]}.${buildConfig.gitSha}-1`
      // see debian_revision: https://www.debian.org/doc/debian-policy/ch-controlfields.html
    }

    Worth noting why the sha is in there, because it changes what a fix has to preserve: .split('-')[0] drops the semver prerelease tag (necessary — - is Debian's upstream/revision separator), which collapses rc.1, rc.2, rc.3 and the final release all onto 4.1.0. The sha isn't a version component anyone chose; it's what restores uniqueness after that collapse. Any fix has to keep prereleases distinct — which is what 4.1.0~rc.3-1 does natively, and it's in the very Debian Policy section that comment links to.

    Four options, including one that needs no upstream work

    1. Patch oclif upstream. debVersion has no override hook, so this is the clean fix for everyone. oclif is actively maintained (last push 2026-07-25), so it's not a dead end — but it's a dependency-bump wait.

    2. Fork / post-process — rewrite the version in the .deb control file after oclif pack deb.

    3. Drop oclif pack deb for fpm or plain dpkg-deb, which gives full control of the version string and the repo layout you'll want for a pool anyway.

    4. --sha as an escape hatch. pack deb takes --sha, it's a plain Flags.string with no format validation, and buildConfig uses it verbatim (options.sha ?? await gitSha(...)). So a monotonic build counter can be injected today with no upstream change.

      Being honest about (4)'s limits: it buys monotonicity, not Debian idiom — the string stays 4.1.0.<x>-1, prerelease semantics stay lost, and it doesn't dodge the migration break from my previous comment (a zero-padded counter starts with a digit, which sorts below the currently published bfc80249b9, so it still needs an epoch or a 4.1.1+ boundary). Useful as a stopgap if the version fix has to ship before the packaging rework; not a destination.

    Two small things that fall out of the same code

    Origin: undefined is a three-line fix. The template is:

    Origin "${config.scopedEnvVar('AUTHOR') || config.pjson.author}";

    packages/dashmate/package.json has no author field and CI sets no DASHMATE_AUTHOR, so both sides are undefined and the string is interpolated literally. Adding author to package.json fixes it wherever else oclif reads that field too.

    The signing env var is DASHMATE_DEB_KEY (scopedEnvVar('DEB_KEY')), and the branch is:

    const gpgKey = config.scopedEnvVar('DEB_KEY')
    if (gpgKey) { /* gpg --clearsign -o InRelease Release; gpg -abs -o Release.gpg Release */ }

    Two implications for the checklist: the key has to be reachable as an env var in the job that runs oclif pack deb (which is the same job as yarn install, hence the isolation item), and the no-key path is fail-open — it silently emits unsigned repo metadata rather than failing. Worth a CI assertion that InRelease exists after packing, so a missing secret can't quietly produce an unsigned release.

  4. DashBot-0001 commented on Jul 28, 2026

    @DashBot-0001

    Two corrections to my previous comment, and one note on the A/B cost comparison.

    The author fix covers one more field than I said, and one fewer. Pulling the control file out of the published v4.1.0 .deb:

    Package: dashmate
    Version: 4.1.0.bfc80249b9-1
    Maintainer: undefined
    Description: Distribution package for Dash node installation
    Aliases: undefined
    

    Maintainer comes from the same expression as Origin — scopedEnvVar('AUTHOR') || pjson.author — so adding author to packages/dashmate/package.json fixes both in one go. Worth doing on its own merits: Maintainer is where a security advisory would be attributed.

    Aliases: undefined is not the same root cause — it's binAliases?.join(', ') with no oclif.binAliases set. (Aliases also isn't a standard Debian control field, so emitting it at all is an oclif quirk rather than something to configure.)

    The control archive has no maintainer scripts — only control, 201 bytes. Nothing runs at install time, which is a genuinely good property to preserve if the packaging ever gets reworked.

    On A vs B: I argued for self-hosted in my first comment and still would. But one line in the A column reads as an understatement worth flagging before someone signs up for it — "The extra effort is a one-time CI publish step rather than an ongoing burden."

    The Valid-Until re-signing job isn't one-time. Short expiry is the mitigation for the freeze scenario, and it only works if something re-signs the unchanged Release on a schedule forever. Miss it and the whole fleet's apt update starts failing with Release file expired — noisy rather than dangerous, but it's a permanent operational commitment, not a build-time step. That doesn't change the recommendation; it changes who has to agree to own it, which seems worth being explicit about while the decision is still open.

  5. ktechmidas commented on Nov 20, 2026

    @ktechmidas
    Collaborator

    Infra's answer: Option A, self-hosted. Agreed on the reasoning in the issue, and agreed that apt-transport-s3 is the wrong tool here: the repository is public over HTTPS and the signature is what proves a package is ours.

    What you can build against

    Types: deb
    URIs: https://apt.services.dash.org/dashmate
    Suites: stable
    Components: main
    Architectures: amd64 arm64
    Signed-By: /usr/share/keyrings/dashmate-archive-keyring.gpg
    
    • Suites: stable gets final releases only. testing gets every release, prereleases and finals, so a node on testing still reaches each final version.
    • Hosting: a private S3 bucket behind CloudFront, HTTPS with HSTS, managed in dashpay/infra Terraform.
    • Retention: every version stays in the pool, so apt install dashmate=<old> keeps working.
    • Valid-Until: 10 days, re-signed daily by a scheduled job, with an alarm if InRelease goes stale.

    Signing happens in AWS, not in GitHub

    The signing key will not be a GitHub secret. A job on our side holds it and does the publishing:

    1. The release workflow assumes an OIDC role that can do one thing: start the publish job with a tag.
    2. The job downloads the debs for that tag from the GitHub release, checks them against the signed SHA256SUMS, adds them to the pool, signs and publishes.
    3. Only one publish runs at a time, which is the lock the issue asks for.

    This means a compromised workflow can ask us to publish a tag, but it can never read the key. It also lets the daily re-sign run without a second, weaker environment in this repository.

    The key

    • Dedicated to this repository, primary key kept offline, expiry of one year or less.
    • The keyring will carry a standby signing subkey from the first day. apt has no revocation and trusts only the keyring on the machine, so this is how a leak of the online subkey gets answered without touching operators.
    • A renewed keyring has to ship in a dashmate release months before the old one expires. The rotation runbook will be written before the key goes live, and we will hand you the keyring file and fingerprint to ship in the package.

    Order

    1. Infra builds the hosting and the publisher now; nothing blocks it.
    2. testing opens first, with the 5.1.0 dev builds, and we prove install, upgrade, pinning, rollback and an expired Release on a testnet node.
    3. stable opens once publication is gated on a maintainer-signed SHA256SUMS.

    Needed from the platform side

    • SHA256SUMS and SHA256SUMS.asc on each release, and the list of maintainer keys the publisher should trust.
    • A small trigger job in release.yml; we will supply the role ARN and the call.
    • The keyring and dashmate.sources shipped inside the package.
    • The Maintainer field, which is still undefined in the 5.1.0-dev.2 deb.
    • Third-party actions in release.yml pinned to commit SHAs.

    Two questions

    1. Should dev builds go to testing at all, or only beta and rc?
    2. Which suite does a prerelease package write into its own dashmate.sources: testing, or always stable, leaving the switch to the operator?
  6. shumkov commented on Nov 23, 2026

    @shumkov
    CollaboratorAuthor

    Thanks, this works for us. Answers, and where the platform side stands.

    1. Dev builds in testing: no, testing should carry beta, rc and final. Our devnets and testnet fleet are run by dashnet, which uses each release's dashmate helper image and compose files directly and never installs the dashmate package, so no DCG network would take dev builds from apt. The only consumers would be operators who opted into testing to run prereleases. If you want to prove the pipeline before 5.1.0-beta.1, a separate dev suite for the 5.1.0 dev builds would do it without putting them in testing. Ordering is fine either way: dev builds are versioned 5.1.0~~dev.N, which apt orders below every beta and rc.

    2. Suite in the shipped dashmate.sources: always stable; switching is the operator's. dpkg silently replaces an unmodified conffile whenever the package's copy changes, so if prereleases wrote testing and finals wrote stable, a node following testing would be moved back to stable by the first final it installs. We'll ship one fixed file and list it in DEBIAN/conffiles (oclif doesn't write that list; our repack step will), so an operator's switch survives upgrades. That also means the URL and keyring path in it should never change, since an edited copy won't receive later changes.

    One ordering constraint: a package must not ship a dashmate.sources that names a suite without a signed Release yet, or apt-get update fails on every host that installed it. Could you publish a signed, empty stable from the start, so the first package carrying the file can ship as soon as testing opens?

    Platform side:

    • SHA256SUMS / SHA256SUMS.asc and SHA-pinned actions: implemented earlier but split out of fix(dashmate)!: give Debian packages versions apt can order #4282 before it merged; we're re-proposing them on top of the current release.yml, together with the Maintainer fix. We'll send the list of signers and their key fingerprints with the SHA256SUMS.asc step.
    • Maintainer: oclif takes it from author in package.json, which dashmate doesn't set. Fixing in the same PR.
    • Keyring and dashmate.sources: added in the deb repack step once you hand us the keyring file and fingerprint.
    • Trigger job: we'll add it once you send the role ARN and the call.
  7. shumkov commented on Nov 25, 2026

    @shumkov
    CollaboratorAuthor

    Update from the platform side.

    Signers for SHA256SUMS.asc (one signature per release is enough):

    • Ivan Shumkov: 19E4 60D5 5429 A91B 40E9 E7C5 EDBC 0AA6 BC1A A13C
    • QuantumExplorer: 556C BC89 DA31 CAD4 928F 0926 D59C AD3E 1BEA FEF0

    The same list is enforced by scripts/release/sign_dashmate_checksums.sh, which refuses any other key (#6274).

    Done on our side: every release now carries SHA256SUMS (#6144), third-party actions in the release workflow are pinned to commit SHAs, and the deb has a real Maintainer. The deb change that ships dashmate.sources and the keyring is ready as draft #6267.

    Waiting on infra: the keyring file and its fingerprint (for #6267), the role ARN and the call for the trigger job, and a signed, empty stable from the start, so the first package carrying dashmate.sources doesn't break apt-get update. Is there an ETA for testing?

  8. dcg-infraclaw commented on Nov 25, 2026

    @dcg-infraclaw

    The repository is live. https://apt.services.dash.org/dashmate has served stable, testing and dev since 11:28 UTC today: signed, and empty. Below is everything from your "waiting on infra" list. Posted by infraclaw, DCG's infrastructure agent, at latte's request.

    1. The keyring, for #6267

    Fingerprint Expires
    Primary (certifies only) A5F9 0926 475E F253 46DC E268 36EF 5BF8 53D1 00FE 2027-11-25
    Signing subkey, online 94E1 AA92 32F7 10AF 5140 0D22 42D0 7EC5 97C9 2A74 2027-11-25
    Signing subkey, standby 51C0 AF25 3270 F3DA CE9F 4007 8A30 392F 222E 0ACC 2027-11-25

    Dashmate APT repository <[email protected]>

    The file is binary, starts with 0x98, and holds one version 4 ed25519 primary key with two signing subkeys and no secret packets. I checked those properties with gpg (--list-packets, --show-keys); I did not run pack_dashmate.sh on it.

    The suites are signed by the online subkey, which is the only key material in AWS. The primary and the standby subkey are held by latte and are in neither AWS nor GitHub. The fingerprints are also in #infra-claw on Slack, as a second channel to compare against.

    The renewed keyring has to reach you by 2027-08-25, three months before this one expires. The rotation runbook is stacks/apt/README.md, "The key".

    2. The role and the call, for the trigger job

    • Role: arn:aws:iam::854439639386:role/dashmate-apt-release, region us-west-2
    • State machine: arn:aws:states:us-west-2:854439639386:stateMachine:dashmate-apt-publish
    • The role trusts one subject only: repo:dashpay/platform:environment:dashmate-apt-publish. The job therefore has to run in an environment of that name, which does not exist in dashpay/platform yet. Restrict its deployments to v* tags: that restriction is what keeps branches away from the role. Required reviewers are yours to add.
    • The role can do two things: start that state machine, and read one of its executions.
      apt:
        needs: <the job that attaches the debs and SHA256SUMS to the release>
        runs-on: ubuntu-24.04
        environment: dashmate-apt-publish
        permissions:
          id-token: write
        steps:
          - uses: aws-actions/configure-aws-credentials@<commit sha>
            with:
              role-to-assume: arn:aws:iam::854439639386:role/dashmate-apt-release
              aws-region: us-west-2
          - env:
              TAG: <the release tag, e.g. v5.1.0-rc.2>
            run: |
              execution=$(aws stepfunctions start-execution \
                --state-machine-arn arn:aws:states:us-west-2:854439639386:stateMachine:dashmate-apt-publish \
                --name "${TAG//./-}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" \
                --input "{\"tag\":\"${TAG}\"}" --query executionArn --output text)
              while :; do
                status=$(aws stepfunctions describe-execution --execution-arn "$execution" --query status --output text)
                [ "$status" = RUNNING ] || break
                sleep 15
              done
              echo "apt publish: $status"
              [ "$status" = SUCCEEDED ]

    This job has not run from GitHub Actions yet; the role's permissions were checked with the IAM policy simulator.

    What the publisher does with a tag:

    • It downloads the two debs from the GitHub release and publishes them only if they are what the release's SHA256SUMS lists and their version is the one the tag stands for. Otherwise it changes nothing and the execution ends FAILED. So the job has to run after the debs and SHA256SUMS are attached.
    • Dev builds go to dev. Betas and release candidates go to testing and dev.
    • A final release goes to testing and dev at once, and into stable when its SHA256SUMS.asc verifies against a trusted maintainer key. If the signature is attached later, the next run moves it; the daily run does that at the latest, so nobody has to trigger it again.
    • Only one publish runs at a time. A second request waits.

    3. A signed, empty stable

    Done, and the same for testing and dev, so #6267's ordering constraint is met. On your ETA question: testing is open now.

    Each Release is valid for ten days. A scheduled run at 05:17 UTC signs all three suites again every day.

    What changed from the plan of 20 November

    • Suites follow your answer: testing carries betas, release candidates and finals, and dev builds have their own dev suite.
    • The alarm for a stale InRelease is not built yet.

    What was checked

    • Live: InRelease and Release.gpg of each suite verify with gpgv against the keyring above. A real apt client (Ubuntu 24.04) runs apt-get update cleanly against each suite, and refuses the repository when given a different keyring.
    • In containers, with throwaway keys and a real apt client: install, upgrade, rollback, install by version, a host on testing reaching the final release, a Release accepted nine days on and refused after eleven, the standby subkey taking over with no change on the host, and each refusal listed above. That run also published the real v5.1.0-rc.1 debs into a local directory.

    What was not checked

    • No package has been published to the live repository, so the upload of a deb to the bucket and its download through the CDN are untested.
    • The daily run has succeeded once, started by hand. Its first scheduled run is tomorrow.
    • Nothing was tried on a testnet node, which the plan promised before stable opens.

    Needed from the platform side

    1. Commit the keyring to feat(dashmate): ship the apt repository's source file and keyring in the deb #6267.
    2. Create the environment dashmate-apt-publish and add the trigger job.
    3. A decision on v5.1.0-rc.1. It is the only release with a SHA256SUMS, so it is the only one that can be published today, into testing and dev. It was built before feat(dashmate): ship the apt repository's source file and keyring in the deb #6267 and carries neither the source file nor the keyring, which is the case your follow-up note in feat(dashmate): ship the apt repository's source file and keyring in the deb #6267 warns about. Should it go in as the first live package, or should the pool start with the first release built with feat(dashmate): ship the apt repository's source file and keyring in the deb #6267?

    Still open on infra's side

    🤖 Generated with Claude Code

  9. shumkov commented on Nov 25, 2026

    @shumkov
    CollaboratorAuthor

    Thanks, this is great. We checked the keyring against three sources before committing it: the file in dashpay/infra at 04fe5c2c, the copy the repository serves, and the fingerprints in your comment and on Slack. All three match.

    Done on our side:

    v5.1.0-rc.1: yes, please publish it into testing and dev as the first live package. It exercises the bucket upload and the CDN download on a real package before a release depends on them.

    Correction: don't copy the #6267 stanza to test rc.1. It names stable, and a hand-written file at the package's own path makes dpkg prompt later. Use the procedure in #4246 (comment) instead.

    We'll merge #6267, #6274 and #6289 once their reviews finish, and let you know.

  10. shumkov commented on Nov 25, 2026

    @shumkov
    CollaboratorAuthor

    Two corrections to my previous comment. (Edited: the tester procedure below verifies the key's checksum before trusting it, creates a temporary package pin first, carries the suite you chose into the packaged source before removing anything hand-made, and covers decommissioning.)

    1. The keyring path changed. #6267 now ships the keyring as a conffile at /etc/apt/keyrings/dashmate-archive-keyring.gpg (the source's Signed-By points there), so the source and its key stay together on remove and rollback. It also ships /etc/apt/preferences.d/dashmate.pref, which makes dashmate the only package this repository can supply. If your docs mention /usr/share/keyrings/dashmate-archive-keyring.gpg, please update them.

    2. Testing v5.1.0-rc.1 by hand. My advice to copy the #6267 stanza was wrong: it names stable, which rc.1 isn't in, and a hand-written file at the package's own paths makes dpkg prompt later. Checked on Debian 12, Ubuntu 22.04 and 24.04 against the live repository:

    To try a prerelease that is not in stable yet (for example 5.1.0-rc.1, published to testing and dev), whose deb does not ship the repository files, configure the repository under names the package does not use. The block below writes the pin before the source and installs the key only if its sha256 matches. It stops at the first command that fails. Set suite=dev for dev builds. On a system without sha256sum, use shasum -a 256 -c - for the check.

    (
    set -e
    suite=testing
    keyring=$(mktemp)
    trap 'rm -f "$keyring"' EXIT
    curl --proto '=https' -fsSL https://apt.services.dash.org/dashmate/dashmate-archive-keyring.gpg -o "$keyring"
    echo "08006df56f24e282f19012a29e539dad431654abefefd697832ac61918b01230  $keyring" | sha256sum -c -
    sudo install -d -m 0755 /etc/apt/keyrings /etc/apt/preferences.d
    sudo tee /etc/apt/preferences.d/dashmate-testing.pref > /dev/null <<'EOF'
    Package: dashmate:any
    Pin: origin apt.services.dash.org
    Pin-Priority: 500
    
    Package: *:any
    Pin: origin apt.services.dash.org
    Pin-Priority: -1
    EOF
    sudo install -m 0644 "$keyring" /etc/apt/keyrings/dashmate-testing-archive-keyring.gpg
    sudo tee /etc/apt/sources.list.d/dashmate-testing.sources > /dev/null <<EOF
    Types: deb
    URIs: https://apt.services.dash.org/dashmate
    Suites: $suite
    Components: main
    Architectures: amd64 arm64
    Signed-By: /etc/apt/keyrings/dashmate-testing-archive-keyring.gpg
    EOF
    sudo apt update
    sudo apt install dashmate
    )

    The key's primary fingerprint is A5F90926475EF25346DCE26836EF5BF853D100FE.

    • Do not use the package's own paths for these files: /etc/apt/sources.list.d/dashmate.sources, /etc/apt/keyrings/dashmate-archive-keyring.gpg and /etc/apt/preferences.d/dashmate.pref. If one of them exists with different content when the first deb that ships it is installed, dpkg prompts, and an install without a terminal (apt-get -y from a script) stops with dashmate unconfigured.

    • Once dashmate is upgraded to a version that ships /etc/apt/sources.list.d/dashmate.sources, run the block below. It reads the suite you chose, sets it in dashmate.sources, and checks it is there. Only then does it delete the hand-made files, skipping any that are already gone, including a key under /usr/share/keyrings from older instructions. apt update runs last: while both sources name the same suite with different keys, it fails with Conflicting values set for option Signed-By.

      (
      set -e
      suite=$(sed -n 's/^Suites: *//p' /etc/apt/sources.list.d/dashmate-testing.sources)
      case "$suite" in
        testing|dev) echo "Keeping suite $suite" ;;
        *) echo "Unexpected suite '$suite' in dashmate-testing.sources" >&2; exit 1 ;;
      esac
      sudo sed -i "s/^Suites: stable\$/Suites: $suite/" /etc/apt/sources.list.d/dashmate.sources
      grep -qx "Suites: $suite" /etc/apt/sources.list.d/dashmate.sources \
        || { echo "dashmate.sources does not name suite $suite; nothing was deleted" >&2; exit 1; }
      sudo rm -f /etc/apt/sources.list.d/dashmate-testing.sources \
        /etc/apt/keyrings/dashmate-testing-archive-keyring.gpg \
        /etc/apt/preferences.d/dashmate-testing.pref \
        /usr/share/keyrings/dashmate-archive-keyring.gpg
      sudo apt update
      )
    • If you already created /etc/apt/sources.list.d/dashmate.sources yourself, rename it before upgrading: sudo mv /etc/apt/sources.list.d/dashmate.sources /etc/apt/sources.list.d/dashmate-testing.sources. If an upgrade already stopped at the conffile prompt (dpkg -l dashmate shows iU), do the same rename and run sudo dpkg --configure -a. Then run the migration block above once dashmate is on a version that ships dashmate.sources; it also removes a key you downloaded to /usr/share/keyrings/dashmate-archive-keyring.gpg.

    • To take dashmate off a host, use sudo apt purge dashmate. After apt remove alone, the source and key stay but the key is no longer renewed. To keep your suite choice without an active source, add Enabled: no to /etc/apt/sources.list.d/dashmate.sources.

    • dpkg does not own the hand-made dashmate-testing.* files. On a host that still uses them, purging dashmate leaves them in place and the source active: delete the files named in the migration block's rm -f command, or add Enabled: no to /etc/apt/sources.list.d/dashmate-testing.sources to keep the suite choice.

  11. dcg-infraclaw commented on Nov 25, 2026

    @dcg-infraclaw

    v5.1.0-rc.1 is in testing and dev, published at 17:06 UTC today as 5.1.0~rc.1-1 for amd64 and arm64. stable is still empty. From infraclaw, at latte's request.

    rc.1, checked from outside

    I ran your procedure from the comment above, unchanged, in fresh containers (amd64) of Ubuntu 24.04, Ubuntu 22.04 and Debian 12. The result was the same on all three:

    • The keyring downloads with sha256 08006df5…1230, and apt-get update exits 0.
    • apt-cache policy dashmate gives candidate 5.1.0~rc.1-1 at priority 500.
    • apt-get install dashmate fetches 93.6 MB through the CDN and installs it. dashmate --version answers dashmate/5.1.0-rc.1 linux-x64 node-v24.14.1, and the package's Maintainer is Dash Core Group <[email protected]>.
    • The arm64 deb, fetched directly from pool/main/d/dashmate/dashmate_5.1.0~rc.1-1_arm64.deb, has the size and sha256 that Packages lists. So a ~ in a file name passes through the CDN.
    • With the source switched to stable, apt-get update exits 0 and no version is offered.

    Not checked: an install on an arm64 machine, and an upgrade from rc.1 to a release that ships the repository files, which needs the first release built with #6267.

    QuantumExplorer's key

    The publisher trusts both signers now (dashpay/infra@ae9abf2, applied). Its log lists 19E460D5…A13C and 556CBC89…FEF0 as maintainer keys.

    I said the fingerprint would be confirmed with him directly first, and it has not been yet. What I have instead: the key file is the one published on his own GitHub account (github.com/QuantumExplorer.gpg, added there today at 08:13 UTC), and its fingerprint is the one in ALLOWED_SIGNERS on v5.1-dev and in your comment. I have asked him in #infra-claw to confirm. The key opens nothing until a final release carries his signature, and it comes out again if he says it is not his.

    The keyring's path

    Noted. stacks/apt/README.md, the keyring's README and our integration test now say /etc/apt/keyrings/dashmate-archive-keyring.gpg (same commit; the test passes on Ubuntu 24.04 and 22.04). Nothing in the publisher depends on the path. Two things follow from your changes on our side:

    • https://apt.services.dash.org/dashmate/dashmate-archive-keyring.gpg is in your published procedure, so we treat that URL as permanent, like the repository URL.
    • A host set up by hand holds a copy of the keyring that no package renews. Step 1 of your procedure ends that once the host is on a release with the repository files; the rotation runbook now says so.

    #6289

    I read the job against the publisher: the tag form and the list of what is published (finals, dev, beta, rc) match, and it runs after SHA256SUMS is attached. Its first run will also be the first real use of the role from GitHub Actions; so far that was checked with the IAM policy simulator only.

    Still open on infra's side

    • The alarm for a stale InRelease. Built after this was posted, running since 17:26 UTC: a timer on our operations host reads the three InRelease files from outside every 15 minutes and alerts us in Slack when one was not signed again for 40 hours, has under four days of validity left, has expired, cannot be fetched, or is not signed by the archive key.
    • The daily run's first scheduled start is tomorrow at 05:17 UTC. The same run has succeeded twice when started by hand.
    • Review and merge of feat(apt): the signed apt repository for dashmate infra#100. What runs is applied from its branch.

    🤖 Generated with Claude Code

  12. shumkov commented on Nov 25, 2026

    @shumkov
    CollaboratorAuthor

    Two requests, now that #6274 is merged and #6289 is updated.

    1. QuantumExplorer's key. #6274 is merged, so 556C BC89 DA31 CAD4 928F 0926 D59C AD3E 1BEA FEF0 can be added to the publisher's trusted maintainer keys. It matches the key on his GitHub account (D59CAD3E1BEAFEF0).

    2. Bind a release-triggered publish to the manifest the run checked. #6289 now starts the state machine with:

    {"tag": "v5.1.0-rc.2", "sha256sums_sha256": "<64 lowercase hex>"}

    sha256sums_sha256 is the SHA-256 of the exact SHA256SUMS bytes that the run's checksums job verified and attached. Could the publisher enforce it?

    • pass it through the state machine to the build (today PublishRelease passes only $.tag);
    • for a tag request, refuse (nothing written) unless the downloaded SHA256SUMS hashes to that value, so a publish always uses the manifest its triggering run verified;
    • once ci(dashmate): ask the apt publisher to publish a release's debs #6289 has shipped, refuse a tag request without the field too; the daily refresh run is unchanged;
    • stable keeps its SHA256SUMS.asc requirement as today.

    The extra field is ignored by the current state machine, so nothing breaks before you add the check.

    Optional: if the publisher could report the requested release's outcome separately from problems with other releases, and return an explicit "skipped" result for prerelease kinds it doesn't accept, our job could tell those cases apart instead of failing on both.

  13. dcg-infraclaw commented on Nov 26, 2026

    @dcg-infraclaw

    The publisher enforces sha256sums_sha256 since 09:43 UTC today, so the condition for turning on DASHMATE_APT_PUBLISH is met on our side. From infraclaw, at latte's request.

    This answers item 2 and the optional part of your comment above. The code is dashpay/infra#100 at a843ba5, applied.

    What it does now

    • The input is {"tag": "<tag>", "sha256sums_sha256": "<64 lowercase hex digits>"}, as ci(dashmate): ask the apt publisher to publish a release's debs #6289 sends it. The state machine passes both to the build.
    • A tag without the digest is refused in the state machine. The execution ends FAILED with the error Publisher.RequestRefused, and no build starts. The publisher checks it again by itself.
    • Another SHA256SUMS is refused before anything is written. The publisher downloads the release's SHA256SUMS and stops unless it has the sha256 the request names. It reads that file once per run, so nothing later in the run sees a different one.
    • Nothing goes into the pool until every check has passed: both debs against that SHA256SUMS, their versions against the tag, what is already published against our key, and the signing key itself.
    • The daily run is unchanged. It sends {}, adds no release, and moves a final into stable only when it is already in testing byte for byte and its SHA256SUMS carries a maintainer's signature.
    • stable still needs SHA256SUMS.asc. The digest says which file your run checked; it does not stand in for the signature.

    What a run reports

    The optional part is in as well. The exit status of publish.py is in the execution's cause, in the build phase message your job already reads:

    Exit Log line Meaning
    0 PUBLISHED: <tag> is in <suites> as <version> Done. A run without a tag has no such line
    1 NEEDS A PERSON: <other tag>: ... Done, and a release other than the requested one needs a person. The requested release is published all the same and has its PUBLISHED: line
    2 REFUSED: ... The run stopped. A refusal of the request, the release, what is published or the signing key comes before anything is written
    3 SKIPPED: ... A release tag of a kind the repository leaves out (alpha, pr, hotfix). Decided before anything is read

    Your job never sends the kinds that exit 3, so its case needs no change. If it ever does send one, the execution ends FAILED like any other non-zero exit.

    Checked live

    One execution each, between 09:44 and 09:48 UTC:

    • v5.1.0-rc.1 with the right digest (74acd72a53bd79d35253c3fb44d0546632ff30c32f32807baecacab088da8d4e): SUCCEEDED, with SHA256SUMS is the file the request names and PUBLISHED: v5.1.0-rc.1 is in testing, dev as 5.1.0~rc.1-1. Both debs were already published, so it wrote no package. Asking again for a release that is already in is safe.
    • The same tag with another digest: 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.
    • A tag without a digest: FAILED, Publisher.RequestRefused, no build.
    • v5.1.0-alpha.1: FAILED, exit status 3, SKIPPED: v5.1.0-alpha.1: prereleases named 'alpha' are not published; only beta, dev, rc.
    • {}: SUCCEEDED.
    • Nothing was written by the three runs that did not succeed. I listed every object version in the repository bucket before and after them, and the two lists are identical.
    • The suites are as they were: all three still verify against the keyring, signed at 05:18 UTC by the first scheduled daily run.

    Before the apply, the unit tests (40) and the integration test with a real apt client passed on Ubuntu 24.04 and 22.04.

    Not checked

    • The role from GitHub Actions. The first run of Publish Dashmate debs to apt will be its first real use. If it fails at the credentials or the start, send us the run and we publish the tag by hand; the job changes no asset.
    • A final release moving into stable in the live repository. No final release carries a maintainer's signature yet. It is covered by the tests only.
    • A tag with a leading zero in a numeric prerelease identifier (v5.1.0-rc.01). Your job's pattern lets it through and the publisher refuses it as not a release tag. No such tag exists, and I did not check whether the deb build refuses it first.

    Until the variable is on

    Post the tag and the sha256 from the Release Dashmate checksums job here or in #infra-claw, as your release procedure says. We publish only if the release's SHA256SUMS has that sha256, and say here which we did.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dashmateenhancementpriority: high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions