Crates.io | env-y |
lib.rs | env-y |
version | 0.1.0 |
source | src |
created_at | 2023-07-21 05:34:30.284553 |
updated_at | 2023-07-21 05:34:30.284553 |
description | simple env tools |
homepage | |
repository | |
max_upload_size | |
id | 922141 |
size | 34,173 |
simple env tools
# example
docker run --rm \
-v $(PWD)/.env:/.env \
leafchage/envy encrypt \
-f /.env \
-k 2sBel3LDvH0pM2BhTQiF2CS48e4UB3ylaHnt2u/ZPmE=
generate key to encrypt and decrypt
envy key
> 2sBel3LDvH0pM2BhTQiF2CS48e4UB3ylaHnt2u/ZPmE=
> 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
> 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
> cat .env
KEY=VALUE
# this is comment
KEY2=VALUE
#%ENCRYPT
KEY3=VALUE
> envy json .env
{"KEY3":"VALUE","KEY":"VALUE","KEY2":"VALUE"}