scripts: decrypt agenix secrets with explicit identity

This commit is contained in:
every.channel 2026-02-16 00:24:14 -05:00
parent 223272db7d
commit 4cd58a4bd7
No known key found for this signature in database
2 changed files with 7 additions and 3 deletions

View file

@ -9,6 +9,8 @@ cd "${root}"
token_file="${EVERY_CHANNEL_CF_TOKEN_FILE:-}"
account_file="${EVERY_CHANNEL_CF_ACCOUNT_FILE:-}"
agenix_secret="${EVERY_CHANNEL_CF_TOKEN_AGE_SECRET:-secrets/cloudflare-api-token.age}"
rules_file="${EVERY_CHANNEL_AGE_RULES_FILE:-./secrets.nix}"
identity_file="${EVERY_CHANNEL_AGE_IDENTITY_FILE:-$HOME/.config/every.channel/keys/founder_ed25519}"
if [[ -z "${CLOUDFLARE_API_TOKEN:-}" && -n "${token_file}" && -f "${token_file}" ]]; then
export CLOUDFLARE_API_TOKEN
@ -22,7 +24,7 @@ fi
if [[ -z "${CLOUDFLARE_API_TOKEN:-}" && -f "${agenix_secret}" && -x "$(command -v agenix)" ]]; then
export CLOUDFLARE_API_TOKEN
CLOUDFLARE_API_TOKEN="$(agenix -d "${agenix_secret}")"
CLOUDFLARE_API_TOKEN="$(RULES="${rules_file}" agenix -d "${agenix_secret}" -i "${identity_file}")"
fi
if [[ -z "${CLOUDFLARE_API_TOKEN:-}" ]]; then