Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
feat: add dotenv support (#1333)
Browse files Browse the repository at this point in the history
* feat: add dotenv support

* docs: add dotenv usage docs

* docs: update docs to clarify default
  • Loading branch information
Matthew-Mallimo authored Mar 22, 2024
1 parent eb811e3 commit 3172251
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ docker-compose.test.yml
.DS_Store
.idea
.vscode
.env
20 changes: 20 additions & 0 deletions docs/api/server/Environment-Variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ One App can be configured via Environment Variables:
## 📖 Table of Contents

**By Topic**
* Dotenv
* [`DOTENV_CONFIG_PATH`](#dotenv_config_path)
* Network & Protocol Settings
* [`HTTPS_PORT`](#https_port)
* [`HTTPS_PRIVATE_KEY_PASS_FILE_PATH`](#https_private_key_pass_file_path)
Expand Down Expand Up @@ -94,6 +96,24 @@ One App can be configured via Environment Variables:

> ⚠️ = Required
## `DOTENV_CONFIG_PATH`

One App supports the usage of [Dotenv](https://github.com/motdotla/dotenv). This environment variable allows you to specify the path to the `.env` file that should be loaded. These values are loaded before the start of the One App server. See the documentation for Dotenv for advanced usage. Dotenv will look for `.env` by default if this is not set.

**Runs In**
* ✅ Production
* ✅ Development

**Shape**
```bash
DOTENV_CONFIG_PATH=String
```

**Example**
```bash
DOTENV_CONFIG_PATH=.env
```

## `HOLOCRON_MODULE_MAP_URL`

⚠️ Required In Production
Expand Down
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
"create-shared-react-context": "^1.0.5",
"cross-fetch": "^4.0.0",
"deepmerge": "^4.3.1",
"dotenv": "^16.4.5",
"fastify": "^4.26.2",
"fastify-metrics": "^11.0.0",
"fastify-plugin": "^4.5.1",
Expand Down
2 changes: 1 addition & 1 deletion scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# permissions and limitations under the License.

flags="$@"
nodeArgs='--dns-result-order ipv4first --no-experimental-fetch'
nodeArgs='--dns-result-order ipv4first --no-experimental-fetch --require=dotenv/config'

if [ -n "$OTEL_RESOURCE_ATTRIBUTES" ]; then
export OTEL_RESOURCE_ATTRIBUTES=$(echo $OTEL_RESOURCE_ATTRIBUTES | sed "s/;/,/g")
Expand Down

0 comments on commit 3172251

Please sign in to comment.