Giter Club home page Giter Club logo

configuration.dockersecrets's Introduction

Configuration.DockerSecrets

Nuget Version Nuget Downloads

This project is be able to pull docker secrets into a DotNetCore configuration. Originally, I tried writing this from scratch and then came across Microsoft's implementation on GitHub. It is slated to be released with dotnetcore 2.0. Regardless of Microsoft's final implementation, our team needed to use this as soon as possible.

The primary use case that inspired pulling this together is using a dockerized NancyFx api as a service on Docker Swarm. As such, our example application is a NancyFx api.

Background

Docker secrets are data that "should not be transmitted over a network or stored unencrypted in a Dockerfile or in your application’s source code." [1] The data is encrypted at rest and in transit on the swarm. The default mount point is /run/secrets/<secret-name>.

Installing Configuration.DockerSecrets

Using Nuget, install the Configuration.DockerSecrets package. Your .csproj should include the following:

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
    <PackageReference Include="Configuration.DockerSecrets" Version="1.0.0"/>
</ItemGroup>

Usage

Pull in the docker secrets into your config.

    var config = new ConfigurationBuilder()
                    .AddDockerSecrets()
                    .Build();

Access your secrets where you need them using:

    var secret = config["secret-name"];

Maintenance and Contributions

Contributions are always welcome. When dotnetcore is released, this package will not longer be maintained.

License and Acknowledgements

Most of this code is directly taken from Microsoft's ASP.NET Configuration repo. As a result, this repo is under the Apache License, Version 2.0.

configuration.dockersecrets's People

Contributors

jdkelley avatar

Stargazers

Simon  Birrer avatar Dale Henries avatar Hal Lesesne avatar  avatar

Watchers

Hal Lesesne avatar  avatar Dale Henries avatar  avatar

configuration.dockersecrets's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.