Created
August 2, 2017 16:27
-
-
Save naure/828014f15e652f745fb9ac709a0cb9ae to your computer and use it in GitHub Desktop.
Commands to encrypt and decrypt secrets in git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Store encrypted secrets in git. | |
# | |
# 1. Put all your keys and passwords in a directory called secrets/ | |
# 2. make encrypt_secrets, and enter a password twice. | |
# 3. git commit, push, pull, etc. | |
# 4. make decrypt_secrets, and enter the password again. | |
# | |
encrypt_secrets: | |
tar cz secrets | openssl aes-256-cbc -out secrets.tgz.aes | |
git add secrets.tgz.aes | |
decrypt_secrets: | |
echo '/!\ About to erase any changes under secrets/ !' | |
openssl aes-256-cbc -d -in secrets.tgz.aes | tar xz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment