|
|
|
|
@ -2,8 +2,8 @@
|
|
|
|
|
# Purpose: manage .sops.yaml based on gpg keys in the same dir _and_ verify correct configuration
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
sops_config_dir="$(realpath "${1?"E: specify dir containing .sops.yaml"}")"; shift;
|
|
|
|
|
keyfiles_dir="$(realpath "${1?"E: specify dir containing keyfiles"}")"; shift;
|
|
|
|
|
sops_config_dir="$(realpath "${1?"E: specify dir containing .sops.yaml"}")"; shift;
|
|
|
|
|
sops_config="${sops_config_dir}/.sops.yaml"
|
|
|
|
|
secrets_file="${1:-0}"
|
|
|
|
|
|
|
|
|
|
@ -82,10 +82,7 @@ fn_verify_sops_config(){
|
|
|
|
|
GPG_TTY=$(tty) sops -d "${sops_enc_file}"
|
|
|
|
|
}
|
|
|
|
|
if [[ "${secrets_file}" != "0" ]]; then
|
|
|
|
|
pushd "${sops_config_dir}" > /dev/null 2>&1
|
|
|
|
|
fn_verify_sops_config "${secrets_file}"
|
|
|
|
|
popd > /dev/null 2>&1
|
|
|
|
|
|
|
|
|
|
echo "# SUCESS: all users with keys in this dir should have functional keys"
|
|
|
|
|
else
|
|
|
|
|
echo "# WARN: no secrets file passed in, make sure to call 'sops updatekeys' on secrets files"
|
|
|
|
|
|