#!/usr/bin/env bash # CI, job `release`: sign the server's archive, which cnx01 installs only # with this signature (cnx-network-clan modules/visa). The key is the # repository secret RELEASE_SIGNING_KEY, the base64 of an OpenSSH ed25519 # key that exists nowhere else; its public half is release/allowed-signers # (principal visa-ci, namespace visa-release), the same line as the fleet's # modules/visa/allowed-signers: change both together. The signature is # checked against that file before it is published, so a secret that does # not match fails the release here instead of on cnx01. # RELEASE_SIGNING_KEY=... bash .gitea/scripts/sign-release.sh dist/visa-linux-x86_64.tar.gz # SIGNERS names another allowed-signers file (the tests). set -euo pipefail file=${1:?the archive to sign} signers=${SIGNERS:-release/allowed-signers} if [ -z "${RELEASE_SIGNING_KEY:-}" ]; then echo "the repository secret RELEASE_SIGNING_KEY is not set: no signed release for cnx01" >&2 exit 1 fi key=$(mktemp) trap 'rm -f "$key"' EXIT printf '%s' "$RELEASE_SIGNING_KEY" | base64 -d >"$key" rm -f "$file.sig" ssh-keygen -q -Y sign -n visa-release -f "$key" "$file" ssh-keygen -Y verify -f "$signers" -I visa-ci -n visa-release -s "$file.sig" <"$file"