Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
motdotla committed May 29, 2023
1 parent 3dddb89 commit 1d2e4ee
Showing 1 changed file with 18 additions and 21 deletions.
39 changes: 18 additions & 21 deletions README.md
Expand Up @@ -184,26 +184,24 @@ You need to keep `.env` files in sync between machines, environments, or team me

You need to deploy your secrets in a cloud-agnostic manner? Use a `.env.vault` file.

## 🚀 Deploying
### Multiple Environments

**Note: Currently RC Candidate [dotenv@16.1.0-rc2](https://www.npmjs.com/package/dotenv/v/16.1.0-rc2)**
You need to manage your secrets across different environments and apply them as needed? Use a `.env.vault` file with a `DOTENV_KEY`.

Install [dotenv-vault](https://github.com/dotenv-org/dotenv-vault#-install).
## 🚀 Deploying

```bash
$ brew install dotenv-org/brew/dotenv-vault
```
**Note: Currently RC Candidate [dotenv@16.1.0-rc2](https://www.npmjs.com/package/dotenv/v/16.1.0-rc2)**

Encrypt your `.env.vault` file.

```bash
$ dotenv-vault build
$ npx dotenv-vault build
```

Fetch your production `DOTENV_KEY`.

```bash
$ dotenv-vault keys production
$ npx dotenv-vault keys production
```

Set `DOTENV_KEY` on your server.
Expand All @@ -213,28 +211,27 @@ Set `DOTENV_KEY` on your server.
heroku config:set DOTENV_KEY=dotenv://:key_1234…@dotenv.org/vault/.env.vault?environment=production
```

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

```bash
$ git add .env.vault
$ git commit -am "Update .env.vault"
$ git push
$ git push heroku main # heroku example
```

That's it! On deploy, your `.env.vault` file will be decrypted and its secrets injected as environment variables – just in time.

<p>See <a href="https://github.com/dotenv-org/dotenv-vault#dotenv-vault-"><img src="https://api.iconify.design/devicon/github.svg" alt="GitHub", width="14" /> dotenv-vault README</a> for more details.</p>
<a href="https://github.com/dotenv-org/dotenv-vault#dotenv-vault-">Learn more at dotenv-vault: Deploying</a>

---

ℹ️ **A note from Mot**: Until recently, we did not have an opinion on how and where to store your secrets in production. We now strongly recommend generating a `.env.vault` file. It's the best way to prevent your secrets from being scattered across multiple servers and cloud providers – protecting you from breaches like the [CircleCI breach](https://techcrunch.com/2023/01/05/circleci-breach/). Also it unlocks interoperability WITHOUT native third-party integrations. Third-party integrations are [increasingly risky](https://coderpad.io/blog/development/heroku-github-breach/) to our industry. They may be the 'du jour' of today, but we imagine a better future.

ℹ️ **🔐 Vault Managed vs 💻 Locally Managed**: The above example, for brevity's sake, used the 🔐 Vault Managed solution to generate your `.env.vault` file. You can instead use the 💻 Locally Managed solution. [Read more here](https://github.com/dotenv-org/dotenv-vault#how-do-i-use--locally-managed-dotenv-vault). Our vision is that other platforms and orchestration tools adopt the `.env.vault` standard as they did the `.env` standard. We don't expect to be the only ones providing tooling to manage and generate `.env.vault` files.

## 🌴 Manage Multiple Environments

See [dotenv-vault: Manage Multiple Environments](https://github.com/dotenv-org/dotenv-vault#-manage-multiple-environments)
Edit your production environment variables.

```bash
$ dotenv-vault open production
```

<a href="https://github.com/dotenv-org/dotenv-vault#dotenv-vault-">Learn more at dotenv-vault: Manage Multiple Environments</a>

---

ℹ️ **🔐 Vault Managed vs 💻 Locally Managed**: The above example, for brevity's sake, used the 🔐 Vault Managed solution to generate your `.env.vault` file. You can instead use the 💻 Locally Managed solution. [Read more here](https://github.com/dotenv-org/dotenv-vault#how-do-i-use--locally-managed-dotenv-vault). Our vision is that other platforms and orchestration tools adopt the `.env.vault` standard as they did the `.env` standard. We don't expect to be the only ones providing tooling to manage and generate `.env.vault` files.

## 📚 Examples

Expand Down

0 comments on commit 1d2e4ee

Please sign in to comment.