scripts: decrypt agenix secrets with explicit identity
This commit is contained in:
parent
223272db7d
commit
4cd58a4bd7
2 changed files with 7 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue