dotenv-vault.net
0.0.4
dotnet add package dotenv-vault.net --version 0.0.4
NuGet\Install-Package dotenv-vault.net -Version 0.0.4
<PackageReference Include="dotenv-vault.net" Version="0.0.4" />
paket add dotenv-vault.net --version 0.0.4
#r "nuget: dotenv-vault.net, 0.0.4"
// Install dotenv-vault.net as a Cake Addin
#addin nuget:?package=dotenv-vault.net&version=0.0.4
// Install dotenv-vault.net as a Cake Tool
#tool nuget:?package=dotenv-vault.net&version=0.0.4
dotenv-vault.net
Extends the proven & trusted foundation of dotenv, with a .env.vault
file.
The extended standard lets you sync your .env
files – quickly & securely. Stop sharing them over insecure channels like Slack and email, and never lose an important .env
file again.
Installation
Follow these steps to install both of these libraries:
- dotenv-vault.net
- dotenv.net (3.1.0 ⇐ version < 3.2.0)
If you want to add library reference manually then add this line to your csproj
file:
<PackageReference Include="dotenv-vault.net" Version="0.0.1"/>
If you're using the Visual Studio package manager console, then run the following:
Install-Package dotenv-vault.net
If you are making use of the dotnet CLI, then run the following in your terminal:
dotnet add package dotenv-vault.net
Usage
Ensure you have declared the necessary namespace at the head of your class file:
using dotenv_vault.net;
Load Environment Variables
Calling the Load()
method with no parameters would locate and load the .env
file in the same directory that the library is if one exists:
DotEnvVault.Load();
If you want to be notified of exceptions that occur in the process of loading env files then you can specify that via the configuration options:
DotEnvVault.Load();
Defaults:
The default is .env
The defaults are true
and 4
directories up
The default encoding is UTF-8
The default to trim whitespaces is false
The default to skip overwriteing an environment variable is true
Dotenv.org
You need a Dotenv Account to use Dotenv Vault. It is free to use with premium features.
<br>
<br>
Visit health.dotenv.org for more information.
FAQ
What happens if DOTENV_KEY
is not set?
Dotenv Vault gracefully falls back to dotenv.net when
DOTENV_KEY
is not set. This is the default for development so that you can focus on editing your.env
file and save thebuild
command until you are ready to deploy those environment variables changes.
Should I commit my .env
file?
No. We strongly recommend against committing your
.env
file to version control. It should only include environment-specific values such as database passwords or API keys. Your production database should have a different password than your development database.
Should I commit my .env.vault
file?
Yes. It is safe and recommended to do so. It contains your encrypted envs, and your vault identifier.
Can I share the DOTENV_KEY
?
No. It is the key that unlocks your encrypted environment variables. Be very careful who you share this key with. Do not let it leak.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Changelog
See CHANGELOG.md
License
MIT
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- dotenv.net (>= 3.1.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Intial release