Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
motdotla committed May 26, 2023
1 parent 1ba1180 commit e8f66ff
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions README.md
Expand Up @@ -195,47 +195,42 @@ You need to deploy your secrets in a cloud-agnostic manner? Use a `.env.vault` f

**Note: Currently released as RC Candidate [dotenv@16.1.0-rc2](https://www.npmjs.com/package/dotenv/v/16.1.0-rc2)**

Install dotenv-vault.
Install the dotenv-vault cl - [github.com/dotenv-org/dotenv-vault](https://github.com/dotenv-org/dotenv-vault).

```shell
$ brew install dotenv-vault
```
(see [dotenv.org/install](https://www.dotenv.org/install) for other install options)

Build your encrypted `.env.vault` file from your local .env file.
Generate your `.env.vault` file.

```shell
$ dotenv-vault local build
```

This creates two files:

* `.env.vault` - containing an encrypted version of your .env file
* `.env.keys` - containing the decryption key
* `.env.vault` - encrypted .env file
* `.env.keys` - decryptions keys

Boot your application using the encrypted `.env.vault` file instead of your `.env` file.
Boot using `.env.vault`.

```
$ DOTENV_KEY=<key string from .env.keys> npm start
```

If it worked, you'll see the message:
```shell
[dotenv@16.1.0][INFO] Loading env from encrypted .env.vault
```

(This [blog post](https://dotenv.org) goes into a full Hello World example.)

Great, now set the `DOTENV_KEY` on your server. For example in heroku:
Great! Next, set the `DOTENV_KEY` on your server. For example in heroku:

```shell
$ heroku config:set DOTENV_KEY=<key string from .env.keys>
```

Commit your `.env.vault` file safely to code and deploy.

Your `.env.vault` fill be decrypted on boot, its environment variables injected, and your app work as expected. Congratulations, your secrets are now much safer than scattered across multiple servers and cloud providers!
Your `.env.vault` is decrypted on boot, its environment variables injected, and your app works as expected.

Congratulations, your secrets are now much safer than scattered across multiple servers and cloud providers! This [blog post](https://dotenv.org) goes into a full Hello World example.

## 🌴 Manage Multiple Environments

Expand Down

0 comments on commit e8f66ff

Please sign in to comment.