From 89b54ed7ca5ac8cce4a4582346f62f89440c0967 Mon Sep 17 00:00:00 2001 From: Dane Schneider Date: Wed, 16 Jan 2019 09:29:53 -0800 Subject: [PATCH] Update documentation for consistency with other packages --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index bc45c52..269d749 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,65 @@ # EnvKey for .net Framework -[NuGet Package](https://www.nuget.org/packages/EnvKey) -[EnvKey Releases](https://github.com/envkey/envkey-fetch/releases) +Integrate [EnvKey](https://www.envkey.com) with your .net projects to keep api keys, credentials, and other configuration securely and automatically in sync for developers and servers. -The current envkey nuget package supports only windows on x64. -If you wish to use it on linux or mac please [open an issue](https://github.com/envkey/envkey-dotnet/issues) to show your demand. +## Installation -# Usage +envkey-dotnet is distributed as a [NuGet Package](https://www.nuget.org/packages/EnvKey). Please refer to the [NuGet Documentation](https://docs.microsoft.com/en-us/nuget/consume-packages/overview-and-workflow) for instructions on installing a package through the Visual Studio Package Manager UI or the command line. + +## Usage + +First, generate an `ENVKEY` in the [EnvKey App](https://github.com/envkey/envkey-app). Then set `ENVKEY=...`, either in a gitignored `.env` file in the root of your project (in development) or in an environment variable (on servers). + +Next, initialize the envkey package at the start of your project's `Main` method. ```cs var envKey = new EnvKeyConfig(); var success = envKey.Load(); +``` + +Now you can access your EnvKey config anywhere you need it using `Environment.GetEnvironmentVariable` and these values will always be up-to-date. +```cs Stripe.ApiKey = Environment.GetEnvironmentVariable("STRIPE_SECRET_KEY"); ``` -## Building +### Errors + +The package will throw an error if an `ENVKEY` is missing or invalid. + +### Overriding Vars + +This package will not overwrite existing environment variables or additional variables set in a `.env` file. This can be convenient for customizing environments that otherwise share the same configuration. You can also use [sub-environments](https://blog.envkey.com/development-staging-production-and-beyond-85f26f65edd6) in the EnvKey app for this purpose. + +### Working Offline + +This package caches your encrypted config when in `DEBUG` mode so that you can still use it while offline. Your config will still be available (though possibly not up-to-date) the next time you lose your internet connection. If you do have a connection available, envkey-dotnet will always load the latest config. Your cached encrypted config is stored in `$HOME/.envkey/cache` + +## envkey-fetch binaries + +If you look at the `NuGet/download_envkey.bat` script, you'll find that a number of `envkey-fetch` binaries for various platforms are pulled into the package before release. These are output by the [envkey-fetch Go library](https://github.com/envkey/envkey-fetch). It contains EnvKey's core cross-platform fetching, decryption, verification, web of trust, redundancy, and caching logic. It is completely open source. + +## Further Reading + +For more on EnvKey in general: + +Read the [docs](https://docs.envkey.com). + +Read the [integration quickstart](https://docs.envkey.com/integration-quickstart.html). + +Read the [security and cryptography overview](https://security.envkey.com). + +## Need help? Have questions, feedback, or ideas? + +Post an [issue](https://github.com/envkey/envkey-ruby/issues) or email us: [support@envkey.com](mailto:support@envkey.com). + +## For Contributors - Build Instructions ### Preface Versions of envkey should go hand in hand with the nuget package version to keep things tidy. -That means that a envkey version 1.2.0 should be downlaoded (via `download_envkey.bat`) and a package should be generated with version 1.2.0 (via `build.bat` and `pack.bat`). -To release library changes that refer to a certain version of envkey, the package should get a build-version extension, eg. 1.2.0.**3**. +That means that a envkey version 1.2.4 should be downloaded (via `download_envkey.bat`) and a package should be generated with version 1.2.4 (via `build.bat` and `pack.bat`). +To release library changes that refer to a certain version of envkey, the package should get a build-version extension, eg. 1.2.4.**3**. ### Requirements