1 unstable release

0.1.0 Jul 21, 2023

#2098 in Cryptography

Custom license

19KB
522 lines

Envy

simple env tools

install

from cargo

from dockerhub

# example
docker run --rm \
         -v $(PWD)/.env:/.env \
         leafchage/envy encrypt \
         -f /.env \
         -k 2sBel3LDvH0pM2BhTQiF2CS48e4UB3ylaHnt2u/ZPmE=

Commands

key

generate key to encrypt and decrypt

envy key
> 2sBel3LDvH0pM2BhTQiF2CS48e4UB3ylaHnt2u/ZPmE=

encrypt | decrypt

> cat .env
KEY=VALUE
# this is comment
KEY2=VALUE
#%ENCRYPT
KEY3=VALUE

> envy encrypt -f .env -k 2sBel3LDvH0pM2BhTQiF2CS48e4UB3ylaHnt2u/ZPmE= | tee .env.enc
KEY=VALUE
# this is comment
KEY2=VALUE
#%ENCRYPTED(JrZJuruOyn2TVYm2)
KEY3=ZCnANf4kHhkKYSIAjmbycvOyn4Rf

> envy decrypt -f .env.env -k 2sBel3LDvH0pM2BhTQiF2CS48e4UB3ylaHnt2u/ZPmE=
KEY=VALUE
# this is comment
KEY2=VALUE
#%ENCRYPT
KEY3=VALUE

load

> cat .env1
KEY=VALUE

> cat .env2
KEY2=VALUE2

> cat a.sh
echo $KEY $KEY2

> envy load -f .env1 .env2 --cmd sh a.sh
VALUE VALUE2

json

> cat .env
KEY=VALUE
# this is comment
KEY2=VALUE
#%ENCRYPT
KEY3=VALUE

> envy json .env
{"KEY3":"VALUE","KEY":"VALUE","KEY2":"VALUE"}

Dependencies

~3–4.5MB
~85K SLoC