#3 Remove superfluous lines from filter scripts, switch sops creation rules to apply to all
This commit is contained in:
parent
bb26fe060e
commit
79af6f5c2d
@ -1,5 +1,5 @@
|
||||
creation_rules:
|
||||
- path_regex: secrets.env
|
||||
- path_regex: .*
|
||||
shamir_threshold: 2
|
||||
key_groups:
|
||||
- age: # Author keys
|
||||
|
@ -3,9 +3,6 @@
|
||||
# Takes encrypted file contents from /dev/stdin
|
||||
# Outputs to stdout
|
||||
|
||||
SOPS_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
|
||||
REPO_ROOT=$(realpath "$SOPS_DIR/../../")
|
||||
|
||||
if [[ -f $HOME/.age/key ]]; then
|
||||
export SOPS_AGE_KEY_FILE=$HOME/.age/key
|
||||
else
|
||||
|
@ -3,19 +3,12 @@
|
||||
# Takes file contents from stdin
|
||||
# Outputs to stdout
|
||||
|
||||
# Set up directory variables and default age recipients
|
||||
SOPS_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
|
||||
SOPS_AGE_RECIPIENTS="$(<$SOPS_DIR/age-author-pubkeys)"
|
||||
HOST_AGE_PUBKEY_PATH="$(echo $1 | cut -d'/' -f -2)/.age-pubkey"
|
||||
if [[ -f "$HOST_AGE_PUBKEY_PATH" ]]; then
|
||||
SOPS_AGE_RECIPIENTS="$SOPS_AGE_RECIPIENTS,$(<$HOST_AGE_PUBKEY_PATH)"
|
||||
fi
|
||||
|
||||
if [[ -f $HOME/.age/key ]]; then
|
||||
export SOPS_AGE_KEY_FILE=$HOME/.age/key
|
||||
else
|
||||
echo "SOPS_AGE_KEY_FILE not found at $HOME/.age/key"
|
||||
echo "Cannot encrypt secrets."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set input/output type
|
||||
@ -33,7 +26,7 @@ case $FILE_EXT in
|
||||
esac
|
||||
|
||||
if [[ -z ${FILE_TYPE+x} ]]; then
|
||||
sops --encrypt --age ${SOPS_AGE_RECIPIENTS} /dev/stdin
|
||||
sops --encrypt --config ../.sops.yaml /dev/stdin
|
||||
else
|
||||
sops --encrypt --input-type $FILE_TYPE --output-type $FILE_TYPE --age ${SOPS_AGE_RECIPIENTS} /dev/stdin
|
||||
sops --encrypt --config ../.sops.yaml --input-type $FILE_TYPE --output-type json /dev/stdin
|
||||
fi
|
Loading…
Reference in New Issue
Block a user