This commit is contained in:
Lukian 2023-06-20 15:28:07 +02:00
parent 68f4b60012
commit 41ae7ff4bd
1010 changed files with 38622 additions and 17071 deletions

21
node_modules/dotenv/CHANGELOG.md generated vendored
View file

@ -2,7 +2,26 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [Unreleased](https://github.com/motdotla/dotenv/compare/v16.1.0...master)
## [Unreleased](https://github.com/motdotla/dotenv/compare/v16.3.1...master)
## [16.3.1](https://github.com/motdotla/dotenv/compare/v16.3.0...v16.3.1) (2023-06-17)
### Added
- Add missing type definitions for `processEnv` and `DOTENV_KEY` options. [#756](https://github.com/motdotla/dotenv/pull/756)
## [16.3.0](https://github.com/motdotla/dotenv/compare/v16.2.0...v16.3.0) (2023-06-16)
### Added
- Optionally pass `DOTENV_KEY` to options rather than relying on `process.env.DOTENV_KEY`. Defaults to `process.env.DOTENV_KEY` [#754](https://github.com/motdotla/dotenv/pull/754)
## [16.2.0](https://github.com/motdotla/dotenv/compare/v16.1.4...v16.2.0) (2023-06-15)
### Added
- Optionally write to your own target object rather than `process.env`. Defaults to `process.env`. [#753](https://github.com/motdotla/dotenv/pull/753)
- Add import type URL to types file [#751](https://github.com/motdotla/dotenv/pull/751)
## [16.1.4](https://github.com/motdotla/dotenv/compare/v16.1.3...v16.1.4) (2023-06-04)

59
node_modules/dotenv/README.md generated vendored
View file

@ -242,6 +242,8 @@ See [examples](https://github.com/dotenv-org/examples) of using dotenv with vari
* [nodejs](https://github.com/dotenv-org/examples/tree/master/dotenv-nodejs)
* [nodejs (debug on)](https://github.com/dotenv-org/examples/tree/master/dotenv-nodejs-debug)
* [nodejs (override on)](https://github.com/dotenv-org/examples/tree/master/dotenv-nodejs-override)
* [nodejs (processEnv override)](https://github.com/dotenv-org/examples/tree/master/dotenv-custom-target)
* [nodejs (DOTENV_KEY override)](https://github.com/dotenv-org/examples/tree/master/dotenv-vault-custom-target)
* [esm](https://github.com/dotenv-org/examples/tree/master/dotenv-esm)
* [esm (preload)](https://github.com/dotenv-org/examples/tree/master/dotenv-esm-preload)
* [typescript](https://github.com/dotenv-org/examples/tree/master/dotenv-typescript)
@ -257,11 +259,12 @@ See [examples](https://github.com/dotenv-org/examples) of using dotenv with vari
## 📖 Documentation
Dotenv exposes three functions:
Dotenv exposes four functions:
* `config`
* `parse`
* `populate`
* `decrypt`
### Config
@ -283,7 +286,7 @@ You can additionally, pass options to `config`.
#### Options
##### Path
##### path
Default: `path.resolve(process.cwd(), '.env')`
@ -293,7 +296,7 @@ Specify a custom path if your file containing environment variables is located e
require('dotenv').config({ path: '/custom/path/to/.env' })
```
##### Encoding
##### encoding
Default: `utf8`
@ -303,7 +306,7 @@ Specify the encoding of your file containing environment variables.
require('dotenv').config({ encoding: 'latin1' })
```
##### Debug
##### debug
Default: `false`
@ -313,7 +316,7 @@ Turn on logging to help debug why certain keys or values are not being set as yo
require('dotenv').config({ debug: process.env.DEBUG })
```
##### Override
##### override
Default: `false`
@ -323,6 +326,30 @@ Override any environment variables that have already been set on your machine wi
require('dotenv').config({ override: true })
```
##### processEnv
Default: `process.env`
Specify an object to write your secrets to. Defaults to `process.env` environment variables.
```js
const myObject = {}
require('dotenv').config({ processEnv: myObject })
console.log(myObject) // values from .env or .env.vault live here now.
console.log(process.env) // this was not changed or written to
```
##### DOTENV_KEY
Default: `process.env.DOTENV_KEY`
Pass the `DOTENV_KEY` directly to config options. Defaults to looking for `process.env.DOTENV_KEY` environment variable. Note this only applies to decrypting `.env.vault` files. If passed as null or undefined, or not passed at all, dotenv falls back to its traditional job of parsing a `.env` file.
```js
require('dotenv').config({ DOTENV_KEY: 'dotenv://:key_1234…@dotenv.org/vault/.env.vault?environment=production' })
```
### Parse
The engine which parses the contents of your file containing environment
@ -338,7 +365,7 @@ console.log(typeof config, config) // object { BASIC : 'basic' }
#### Options
##### Debug
##### debug
Default: `false`
@ -379,7 +406,7 @@ dotenv.populate(target, parsed, { override: true, debug: true })
console.log(target) // { HELLO: 'universe' }
```
#### Options
#### options
##### Debug
@ -387,12 +414,28 @@ Default: `false`
Turn on logging to help debug why certain keys or values are not being populated as you expect.
##### Override
##### override
Default: `false`
Override any environment variables that have already been set.
### Decrypt
The engine which decrypts the ciphertext contents of your .env.vault file is available for use. It accepts a ciphertext and a decryption key. It uses AES-256-GCM encryption.
For example, decrypting a simple ciphertext:
```js
const dotenv = require('dotenv')
const ciphertext = 's7NYXa809k/bVSPwIAmJhPJmEGTtU0hG58hOZy7I0ix6y5HP8LsHBsZCYC/gw5DDFy5DgOcyd18R'
const decryptionKey = 'ddcaa26504cd70a6fef9801901c3981538563a1767c297cb8416e8a38c62fe00'
const decrypted = dotenv.decrypt(ciphertext, decryptionKey)
console.log(decrypted) // # development@v6\nALPHA="zeta"
```
## ❓ FAQ
### Why is the `.env` file not loading my environment variables successfully?

View file

@ -1,4 +1,4 @@
const re = /^dotenv_config_(encoding|path|debug|override)=(.+)$/
const re = /^dotenv_config_(encoding|path|debug|override|DOTENV_KEY)=(.+)$/
module.exports = function optionMatcher (args) {
return args.reduce(function (acc, cur) {

View file

@ -17,4 +17,8 @@ if (process.env.DOTENV_CONFIG_OVERRIDE != null) {
options.override = process.env.DOTENV_CONFIG_OVERRIDE
}
if (process.env.DOTENV_CONFIG_DOTENV_KEY != null) {
options.DOTENV_KEY = process.env.DOTENV_CONFIG_DOTENV_KEY
}
module.exports = options

19
node_modules/dotenv/lib/main.d.ts generated vendored
View file

@ -1,5 +1,6 @@
// TypeScript Version: 3.0
/// <reference types="node" />
import type { URL } from 'node:url';
export interface DotenvParseOutput {
[name: string]: string;
@ -54,6 +55,24 @@ export interface DotenvConfigOptions {
* example: `require('dotenv').config({ override: true })`
*/
override?: boolean;
/**
* Default: `process.env`
*
* Specify an object to write your secrets to. Defaults to process.env environment variables.
*
* example: `const processEnv = {}; require('dotenv').config({ processEnv: processEnv })`
*/
processEnv?: DotenvPopulateInput;
/**
* Default: `undefined`
*
* Pass the DOTENV_KEY directly to config options. Defaults to looking for process.env.DOTENV_KEY environment variable. Note this only applies to decrypting .env.vault files. If passed as null or undefined, or not passed at all, dotenv falls back to its traditional job of parsing a .env file.
*
* example: `require('dotenv').config({ DOTENV_KEY: 'dotenv://:key_1234…@dotenv.org/vault/.env.vault?environment=production' })`
*/
DOTENV_KEY?: string;
}
export interface DotenvConfigOutput {

27
node_modules/dotenv/lib/main.js generated vendored
View file

@ -58,7 +58,7 @@ function _parseVault (options) {
// handle scenario for comma separated keys - for use with key rotation
// example: DOTENV_KEY="dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenv.org/vault/.env.vault?environment=prod"
const keys = _dotenvKey().split(',')
const keys = _dotenvKey(options).split(',')
const length = keys.length
let decrypted
@ -99,11 +99,18 @@ function _debug (message) {
console.log(`[dotenv@${version}][DEBUG] ${message}`)
}
function _dotenvKey () {
function _dotenvKey (options) {
// prioritize developer directly setting options.DOTENV_KEY
if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
return options.DOTENV_KEY
}
// secondary infra already contains a DOTENV_KEY environment variable
if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
return process.env.DOTENV_KEY
}
// fallback to empty string
return ''
}
@ -162,7 +169,12 @@ function _configVault (options) {
const parsed = DotenvModule._parseVault(options)
DotenvModule.populate(process.env, parsed, options)
let processEnv = process.env
if (options && options.processEnv != null) {
processEnv = options.processEnv
}
DotenvModule.populate(processEnv, parsed, options)
return { parsed }
}
@ -185,7 +197,12 @@ function configDotenv (options) {
// Specifying an encoding returns a string instead of a buffer
const parsed = DotenvModule.parse(fs.readFileSync(dotenvPath, { encoding }))
DotenvModule.populate(process.env, parsed, options)
let processEnv = process.env
if (options && options.processEnv != null) {
processEnv = options.processEnv
}
DotenvModule.populate(processEnv, parsed, options)
return { parsed }
} catch (e) {
@ -202,7 +219,7 @@ function config (options) {
const vaultPath = _vaultPath(options)
// fallback to original dotenv if DOTENV_KEY is not set
if (_dotenvKey().length === 0) {
if (_dotenvKey(options).length === 0) {
return DotenvModule.configDotenv(options)
}

2
node_modules/dotenv/package.json generated vendored
View file

@ -1,6 +1,6 @@
{
"name": "dotenv",
"version": "16.1.4",
"version": "16.3.1",
"description": "Loads environment variables from .env file",
"main": "lib/main.js",
"types": "lib/main.d.ts",