env-y

Crates.ioenv-y
lib.rsenv-y
version0.1.0
sourcesrc
created_at2023-07-21 05:34:30.284553
updated_at2023-07-21 05:34:30.284553
descriptionsimple env tools
homepage
repository
max_upload_size
id922141
size34,173
takaya kusanagi (LeafChage)

documentation

README

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"}
Commit count: 0

cargo fmt