Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
A simple CLI tool for encrypting and decrypting .env files.
.env
files so they can be securely tracked in Git.env
files for different environment configurations$ yarn global add senv
or
$ npm install -g senv
$ echo "your_password_here" >> .env.pass
$ senv encrypt .env -o .env.enc
$ senv decrypt .env.enc -o .env
There are several ways to store your passwords, depending on what works best with your project's existing setup.
.env
filesTo configure senv
to use a single password for all .env
files you have two options:
DOTENV_PASS
environment variable in your ~/.bash_profile
:$ export DOTENV_PASS=your_password_here
.env.pass
in the same directory as your .env
file:$ echo "your_password_here" >> .env.pass
If both an environment variable and a password file are present, senv
will default to using the
environment variable.
.env
filesenv
will look for and use an environment variables or password file for each .env
file based
on the filename that is passed in, like so:
$ senv encrypt .env # Looks for $DOTENV_PASS or .env.pass
$ senv encrypt .env.prod # Looks for $DOTENV_PROD_PASS or .env.prod.pass
$ senv decrypt .env.prod.enc # Looks for $DOTENV_PROD_PASS or .env.prod.pass
$ senv decrypt .env.prod.encrypted # Looks for $DOTENV_PROD_PASS or .env.prod.pass
$ senv decrypt .env.prod.suffix # Looks for $DOTENV_PROD_SUFFIX_PASS or .env.prod.suffix.pass
If both an environment variable and a password file are present for an individual .env
file,
senv
will default to using the environment variable.
You can also pass in your password as a command line argument, like so:
$ senv encrypt .env -p your_password_here
However, this method is insecure and should not be your first choice.
$ echo "#!/bin/sh" >> .git/hooks/pre-commit
$ echo "senv encrypt .env -o .env.enc" >> .git/hooks/pre-commit
$ chmod +x .git/hooks/pre-commit
$DOTENV_PASS
or individual file environment variable via UIEveryone knows it's bad practice to store plaintext secrets in git. Often the alternatives are unecessarily complex for small projects (e.g. Hashicorp Vault), or are a pain to manage (e.g. passing around .env
files among developers via slack or email 🤮).
This tool makes it easy to encrypt and decrypt any .env
files so they can be securely tracked in Git.
There are several other great libraries that support encryption of environment variables (encrypt-env, secure-env, etc), but none fit our use case well (managing secrets in .env
files with react-native-config
) for one reason or another.
So I created this tool. Hope it helps someone else out 😊.
FAQs
A simple CLI tool for encrypting and decrypting .env files
We found that senv demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.