|
|
|
|
@ -3,6 +3,8 @@
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
# sops.yaml doc: https://github.com/getsops/sops?tab=readme-ov-file#using-sops-yaml-conf-to-select-kms-pgp-and-age-for-new-files
|
|
|
|
|
|
|
|
|
|
sops_config=".sops.yaml"
|
|
|
|
|
|
|
|
|
|
function fn_extract_fpr(){
|
|
|
|
|
gpgkeyfile=$1;shift;
|
|
|
|
|
# fingerprint
|
|
|
|
|
@ -23,6 +25,7 @@ function fn_extract_uid(){
|
|
|
|
|
echo "${uid}"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function fn_update_sops_config(){
|
|
|
|
|
# CAVEAT: dirty hacks, just get it done. Not DRY at all.
|
|
|
|
|
|
|
|
|
|
echo "# Fingerprint | User Type | User ID"
|
|
|
|
|
@ -52,3 +55,6 @@ done
|
|
|
|
|
for gpgkeyfile in $(ls *gpg.pub | grep -v automation | tail -n 1); do
|
|
|
|
|
echo " $(fn_extract_fpr "${gpgkeyfile}")"
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
(fn_update_sops_config) >> "${sops_config}"
|
|
|
|
|
|