+5
-1
@@ -5,4 +5,8 @@ # Changelog | ||
| ## [Unreleased](https://github.com/motdotla/dotenv/compare/v16.4.0...master) | ||
| ## [Unreleased](https://github.com/motdotla/dotenv/compare/v16.4.1...master) | ||
| ## [16.4.1](https://github.com/motdotla/dotenv/compare/v16.4.0...v16.4.1) (2024-01-24) | ||
| - Patch support for array as `path` option [#797](https://github.com/motdotla/dotenv/pull/797) | ||
| ## [16.4.0](https://github.com/motdotla/dotenv/compare/v16.3.2...v16.4.0) (2024-01-23) | ||
@@ -9,0 +13,0 @@ |
+12
-1
@@ -212,3 +212,14 @@ const fs = require('fs') | ||
| if (options.path != null) { | ||
| dotenvPath = _resolveHome(options.path) | ||
| let envPath = options.path | ||
| if (Array.isArray(envPath)) { | ||
| for (const filepath of options.path) { | ||
| if (fs.existsSync(filepath)) { | ||
| envPath = filepath | ||
| break | ||
| } | ||
| } | ||
| } | ||
| dotenvPath = _resolveHome(envPath) | ||
| } | ||
@@ -215,0 +226,0 @@ if (options.encoding != null) { |
+1
-1
| { | ||
| "name": "dotenv", | ||
| "version": "16.4.0", | ||
| "version": "16.4.1", | ||
| "description": "Loads environment variables from .env file", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
+6
-0
| <div align="center"> | ||
| 🎉 announcing <a href="https://github.com/dotenvx/dotenvx">dotenvx</a>. *run anywhere, multi-environment, encrypted envs*. | ||
| </div> | ||
| --- | ||
| <div align="center"> | ||
| <p> | ||
@@ -4,0 +10,0 @@ <sup> |
+29
-1
| <div align="center"> | ||
| 🎉 announcing <a href="https://github.com/dotenvx/dotenvx">dotenvx</a>. <em>run anywhere, multi-environment, encrypted envs</em>. | ||
| </div> | ||
| --- | ||
| <div align="center"> | ||
| <p> | ||
@@ -498,3 +504,3 @@ <sup> | ||
| No. We **strongly** recommend against having a "main" `.env` file and an "environment" `.env` file like `.env.test`. Your config should vary between deploys, and you should not be sharing values between environments. | ||
| We recommend creating on `.env` file per environment. Use `.env` for local/development, `.env.production` for production and so on. This still follows the twelve factor principles as each is attributed individually to its own environment. Avoid custom set ups that work in inheritance somehow (`.env.production` inherits values form `.env` for example). It is better to duplicate values if necessary across each `.env.environment` file. | ||
@@ -658,2 +664,24 @@ > In a twelve-factor app, env vars are granular controls, each fully orthogonal to other env vars. They are never grouped together as “environments”, but instead are independently managed for each deploy. This is a model that scales up smoothly as the app naturally expands into more deploys over its lifetime. | ||
| ### What if I accidentally commit my `.env` file to code? | ||
| Remove it, [remove git history](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository) and then install the [git pre-commit hook](https://github.com/dotenvx/dotenvx#pre-commit) to prevent this from ever happening again. | ||
| ``` | ||
| brew install dotenvx/brew/dotenvx | ||
| dotenvx precommit --install | ||
| ``` | ||
| ### How can I prevent committing my `.env` file to a Docker build? | ||
| Use the [docker prebuild hook](https://dotenvx.com/docs/features/prebuild). | ||
| ```bash | ||
| # Dockerfile | ||
| ... | ||
| RUN curl -fsS https://dotenvx.sh/ | sh | ||
| ... | ||
| RUN dotenvx prebuild | ||
| CMD ["dotenvx", "run", "--", "node", "index.js"] | ||
| ``` | ||
| ## Contributing Guide | ||
@@ -660,0 +688,0 @@ |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 8 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 8 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
76016
2.24%461
1.99%698
4.18%