-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·37 lines (27 loc) · 960 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Based on http://ejohn.org/blog/keeping-passwords-in-source-control/
#
# John Resig needed a way to keep sensitive data (e.g. config files with
# passwords) out of source control. So he decided to encrypt the sensitive data.
#
# I decided to modify the script so it's purpose is quickly encrypting or
# decrypting any sensitive file you have on your computer.
#
# Usage: make encrypt
# make decrypt
.PHONY: _pwd_prompt decrypt encrypt decrypt_conf encrypt_conf clean_encrypt clean_decrypt
ENV=dev
FILE_DEC=conf/${ENV}.casted5.json
FILE_ENC=conf/${ENV}.json.cast5
_pwd_prompt:
@echo "Contact the author for the password."
decrypt: decrypt_conf clean_decrypt
encrypt: encrypt_conf clean_encrypt
decrypt_conf: _pwd_prompt
openssl cast5-cbc -d -in ${FILE_ENC} -out ${FILE_DEC}
chmod 600 ${FILE_DEC}
encrypt_conf: _pwd_prompt
openssl cast5-cbc -e -in ${FILE_DEC} -out ${FILE_ENC}
clean_encrypt:
\rm ${FILE_DEC}
clean_decrypt:
\rm ${FILE_ENC}