Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit eeef8830 authored by Christophe Chaudier's avatar Christophe Chaudier
Browse files

Add git hook for keaping the secret encrypt.

parent a1af2976
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
if [ ! -r '.vault_pass' ]; then
exit 1
fi
tmp=$(mktemp)
cat > $tmp
ansible-vault encrypt $tmp --vault-password-file=.vault_pass > /dev/null 2>&1
cat "$tmp"
rm $tmp
#!/bin/sh
if [ ! -r '.vault_pass' ]; then
exit 1
fi
BASE=$1
export PAGER='cat'
CONTENT=$(ansible-vault view "$BASE" --vault-password-file=.vault_pass 2>&1)
if echo "$CONTENT" | grep -q 'input is not vault encrypted'; then
cat "$1"
else
echo "$CONTENT"
fi
*vault* merge=binary diff=ansible-vault filter=ansible-vault
......@@ -6,3 +6,15 @@ Bootstrap git repository with some cool stuffs.
First [install Ansible](http://docs.ansible.com/ansible/latest/intro_installation.html) on your laptop.
After create ```.vault_pass``` file under the repository root folder and put in it a strong password.
Add in your .git/config file this code :
```
[diff "ansible-vault"]
textconv = .git_crypt_diff
# Do not cache the vault contents
cachetextconv = false
[filter "ansible-vault"]
clean = .git_crypt_clean
```
**Please note : only work with the git cli !**
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment