-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Enable .env file loading using
env
feature (#1308)
Related issues: - #1236 This PR adds conditional support for loading a local `.env` for environment variables. This support is only enabled when compiling the client binary with the `env` feature or when passing `--all-features` to Cargo. This is not enabled by default for production environments. Users can add a `.env` to the root directory of their local copy of their Fuel node (or wherever their working directory is). This helps users provide CLI arguments in a way that is more convenient and more secure than entering these values in an IDE directly: - Users can reuse environment variables across IDEs (e.g., VS Code and CLion) and IDE configurations seamlessly, rather than specifying them in each IDE specific configuration - Users can avoid putting secrets in shared commands or configurations - CLion users can greatly shorten their `run` commands, which is helpful since the configuration window does not word wrap long commands The `.env` is also added to `.gitignore` to prevent users from uploading individual environment configurations that may include secrets. This approach acts as a sort of stop gap for handling secrets before we have SOPS. This PR also renames the internal `eth_client` component of the relayer configuration to `relayer`. This allow users to use the environment variable name `RELAYER` to supply this value. Prior to this, the CLI expected an environment variable called `ETH_CLIENT`, even though the CLI argument is named `relayer`. Note: Due to the order in which the initialization functions are called, we cannot supply `RUST_LOG` in the .env file; this has to be provided elsewhere or directly to Cargo.
- Loading branch information
Brandon Vrooman
authored
Aug 22, 2023
1 parent
078446b
commit 75b7115
Showing
11 changed files
with
50 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters