From 35cc4d6ed9cfaae6f23f4b5dfbca27134c9aed5e Mon Sep 17 00:00:00 2001 From: John Coffey Date: Fri, 13 Nov 2026 15:35:27 -0700 Subject: [PATCH] Sign SHA256SUMS on GitHub builds too #386 signed SHA256SUMS in Gitea's publish.yml, but with BUILD_ON=github the release binaries and SHA256SUMS come from GitHub's ci.yml, so 27.1-rc.22 went out unsigned. The binaries job now signs SHA256SUMS with the same MINISIGN_SECRET_KEY and attaches SHA256SUMS.minisig. With no key it warns and the release stays unsigned, as on Gitea. The 27.1-rc.22 CHANGELOG entry said its downloads came with the signature; that line is gone. --- .github/workflows/ci.yml | 23 ++++++++++++++++++++++- CHANGELOG.md | 4 ---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 260f1bae..3f247cad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -489,6 +489,25 @@ jobs: done sha256sum inbuxa-linux-*.tar.gz inbuxa-relay-* > SHA256SUMS cat SHA256SUMS + # Sign SHA256SUMS with the suite's minisign key, so a download can be + # verified against the public key the docs publish, as Gitea's + # publish.yml does when it builds. No key (as on a fork, or before the + # key is added) leaves the release unsigned. + - name: sign SHA256SUMS with minisign + env: + MINISIGN_SECRET_KEY: ${{ secrets.MINISIGN_SECRET_KEY }} + run: | + set -euo pipefail + if [ -z "${MINISIGN_SECRET_KEY:-}" ]; then + echo "::warning::MINISIGN_SECRET_KEY is not set; this release will be unsigned" + exit 0 + fi + sudo apt-get -qq update >/dev/null && sudo apt-get -qq install -y --no-install-recommends minisign >/dev/null + umask 077 + key="$(mktemp)"; printf '%s\n' "$MINISIGN_SECRET_KEY" > "$key" + minisign -S -s "$key" -m out/SHA256SUMS -t "inbuxa $TAG" + rm -f "$key" + echo "signed out/SHA256SUMS -> out/SHA256SUMS.minisig" # The relay binaries' .sig files are made on Gitea, which holds the # release key (publish.yml, relay-sign), once these are attached. # @@ -507,7 +526,9 @@ jobs: rel="$(curl -fsS "${retry[@]}" -H "$auth" "$api/releases/tags/$TAG" | jq -r .id)" assets="$(curl -fsS "${retry[@]}" -H "$auth" "$api/releases/$rel/assets")" for f in out/inbuxa-linux-amd64.tar.gz out/inbuxa-linux-arm64.tar.gz \ - out/inbuxa-relay-x86_64-linux-musl out/inbuxa-relay-aarch64-linux-musl out/SHA256SUMS; do + out/inbuxa-relay-x86_64-linux-musl out/inbuxa-relay-aarch64-linux-musl out/SHA256SUMS \ + out/SHA256SUMS.minisig; do + [ -e "$f" ] || continue # SHA256SUMS.minisig is absent only on an unsigned release name="$(basename "$f")" old="$(jq -r --arg n "$name" '.[] | select(.name == $n) | .id' <<<"$assets")" for id in $old; do curl -fsS "${retry[@]}" -o /dev/null -X DELETE -H "$auth" "$api/releases/$rel/assets/$id"; done diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ab279ac..cf7f973f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,10 +21,6 @@ Fixes from the community: Check now reads fresh DNS, Automatic DNS publishes newly enabled record types, and the dashboard counts DMARC warnings the way the reports page does. -### Added -- Release downloads come with `SHA256SUMS.minisig`, a minisign signature of - `SHA256SUMS`, so a download can be checked against the published key. (#386) - ### Changed - The container image bundles inbuxa-migrate 27.1-rc.14: upstream v1.0.16's Exchange EWS and Graph fixes, and the POP3, Fastmail, Zoho and Zimbra -- 2.54.0