Watch
1
0
Fork
You've already forked keys
0

Name snapshots by full date instead of just year

Snapshots are now written as <KEYID>-public_YYYY-MM-DD.asc,
one file per ceremony, matching the naming of the secret exports
kept outside this repository
This commit is contained in:
Alexander Hess 2026-09-21 21:15:53 +02:00
commit 112cead812
Signed by: alexander
GPG key ID: B46EDB4DFC26805D
5 changed files with 14 additions and 15 deletions

View file

@ -1,12 +1,12 @@
#!/bin/sh
# Export the current OpenPGP public key as a yearly snapshot
# Export the current OpenPGP public key as a dated snapshot
#
# Usage: ./scripts/snapshot.sh [YEAR]
# Usage: ./scripts/snapshot.sh [DATE]
#
# YEAR defaults to the current UTC year
# DATE defaults to the current UTC date (YYYY-MM-DD)
#
# Writes snapshots/<KEYID>-public-<YEAR>.asc and refreshes public-key.asc
# Writes snapshots/<KEYID>-public_<DATE>.asc and refreshes public-key.asc
set -eu
@ -16,7 +16,7 @@ SIGNING_KEY='D6D1989DF1F6B23FD776293DB46EDB4DFC26805D'
REPO=$(cd "$(dirname "$0")/.." && pwd)
YEAR=${1:-$(date -u +%Y)}
DATE=${1:-$(date -u +%F)}
# Notes:
# - the first "fpr" line is the primary key's fingerprint
@ -30,7 +30,7 @@ fi
# The last 16 hex chars, as used in OPENPGP.md
KEYID=${FPR#"${FPR%????????????????}"}
OUT="$REPO/snapshots/$KEYID-public-$YEAR.asc"
OUT="$REPO/snapshots/${KEYID}-public_$DATE.asc"
mkdir -p "$REPO/snapshots"
@ -69,4 +69,4 @@ cp "$OUT" "$REPO/public-key.asc"
gpg --show-keys "$OUT" >&2
echo "Wrote snapshots/$KEYID-public-$YEAR.asc and public-key.asc"
echo "Wrote snapshots/${KEYID}-public_$DATE.asc and public-key.asc"