From 9fe36861356c88a537c4624815bd1779890c40d0 Mon Sep 17 00:00:00 2001 From: John Coffey Date: Fri, 13 Nov 2026 07:17:23 -0700 Subject: [PATCH 1/2] publish: sign SHA256SUMS with minisign (cherry picked from commit e44dfeed24d56ad7f794b084060137d413156161) --- .gitea/workflows/publish.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml index 8cb1a981..bc9160dc 100644 --- a/.gitea/workflows/publish.yml +++ b/.gitea/workflows/publish.yml @@ -302,6 +302,7 @@ jobs: REPO: ${{ github.repository }} PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }} TOKEN: ${{ secrets.GITHUB_TOKEN }} + MINISIGN_SECRET_KEY: ${{ secrets.MINISIGN_SECRET_KEY }} steps: - name: take the binaries out of the image run: | @@ -319,6 +320,22 @@ jobs: done sha256sum inbuxa-linux-*.tar.gz > SHA256SUMS cat SHA256SUMS + # Sign SHA256SUMS with the suite's minisign key, so a download can be + # verified against the public key the docs publish. No key (as on a + # fork, or before the key is added) leaves the release unsigned. + - name: sign SHA256SUMS with minisign + 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 + apk add --no-cache -q minisign + 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" - name: attach them to the release run: | set -euo pipefail @@ -335,7 +352,10 @@ jobs: rel = get(f"/releases/tags/{tag}") assets = {a["name"]: a["id"] for a in get(f"/releases/{rel['id']}/assets")} - for path in ["/out/inbuxa-linux-amd64.tar.gz", "/out/inbuxa-linux-arm64.tar.gz", "/out/SHA256SUMS"]: + for path in ["/out/inbuxa-linux-amd64.tar.gz", "/out/inbuxa-linux-arm64.tar.gz", + "/out/SHA256SUMS", "/out/SHA256SUMS.minisig"]: + if not pathlib.Path(path).exists(): + continue # SHA256SUMS.minisig is absent only on an unsigned release name = os.path.basename(path) # A re-run of a tag replaces its assets rather than leaving two # files with the same name and different contents. -- 2.54.0 From 2e0a83a982a77ebc56826ca9648bedd8b4e3bb20 Mon Sep 17 00:00:00 2001 From: John Coffey Date: Fri, 13 Nov 2026 15:35:27 -0700 Subject: [PATCH 2/2] Sign SHA256SUMS on GitHub builds too (2026.x) With BUILD_ON=github the release binaries and SHA256SUMS come from GitHub's ci.yml, so 2026.x releases (2026.11.11, 2026.11.17) went out without a signature. 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. release/2026 attaches no relay binaries, so its asset list only gains the signature. (cherry picked from commit 35cc4d6ed9cfaae6f23f4b5dfbca27134c9aed5e) --- .github/workflows/ci.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b9a6904..a68a0e22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -386,6 +386,25 @@ jobs: done sha256sum inbuxa-linux-*.tar.gz > 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" # A re-run of a tag replaces its assets rather than leaving two files # with the same name and different contents. # @@ -400,7 +419,9 @@ jobs: retry=(--retry 5 --retry-all-errors --retry-delay 15) 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/SHA256SUMS; do + for f in out/inbuxa-linux-amd64.tar.gz out/inbuxa-linux-arm64.tar.gz 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 -- 2.54.0