Voyager.Configuration.MountPath 1.2.8

dotnet add package Voyager.Configuration.MountPath --version 1.2.8                
NuGet\Install-Package Voyager.Configuration.MountPath -Version 1.2.8                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Voyager.Configuration.MountPath" Version="1.2.8" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Voyager.Configuration.MountPath --version 1.2.8                
#r "nuget: Voyager.Configuration.MountPath, 1.2.8"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Voyager.Configuration.MountPath as a Cake Addin
#addin nuget:?package=Voyager.Configuration.MountPath&version=1.2.8

// Install Voyager.Configuration.MountPath as a Cake Tool
#tool nuget:?package=Voyager.Configuration.MountPath&version=1.2.8                

Voyager.Configuration.MountPath


The extension for AspNetCore to organize JSON configuration.

About

The nuget allows reading the JSON configuration files from a path. The path can be used by an environment like Linux, Docker, or Kubernetes to update the content by a mounting mechanism. In providing the library by docker images you will gain the possibility to avoid publishing your sensitive data in an image repository.

🏁 Getting Started

Prerequisites

The library menage configuration is supplied by the JSON files. Cooperate with the WebApplicationBuilder or HostApplicationBuilder. Linux mount mechanism can only work with folders so the config files have to be in that folder.

🔧 How to start

The best metod to see how it worsk is look to the thest project.

The default configuration

builder.ConfigureAppConfiguration((hostingConfiguration, config) =>
{
  config.AddMountConfiguration(hostingConfiguration.HostingEnvironment.GetSettingsProvider());
});

The default configuration will work with the files structures:

YourAppFiles
|--bin
   |--config
      |--appsettings.json
      |--appsettings.Development.json

It works in the way that from the folder config will load appsettings.json. The dotnet from the ASPNETCORE_ENVIRONMENT set his HostEnviroment variable, and if is setted with value: Development the program finds the appsettings.Development.json file and will use it to override previous settings.

🔧 How to update default settings

The library is open for extensions so it is possible to modify behavior. At the first, it is possible to make the obligation to possess a hosting file:

builder.ConfigureAppConfiguration((hostingConfiguration, config) =>
{
  config.AddMountConfiguration(hostingConfiguration.HostingEnvironment.GetSettingsProviderForce());
});

The second possibility is to override the class Voyager.Configuration.MountPath.SettingsProvider and use the instance in the AddMountConfiguration method.

Also is possible to use the AddMountConfiguration with the action that is can change all settings.

builder.ConfigureAppConfiguration((hostingConfiguration, config) =>
{
  config.AddMountConfiguration(settings =>
  {
    settings.HostingName = "MyEnv";
    settings.Optional = false;
  });
});

✍️ Authors

  • @andrzejswistowski - Idea & work. Please let me know if you find out an error or suggestions.

contributors.

🎉 Acknowledgements

  • Przemysław Wróbel - for the icon.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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 is compatible.  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. 
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.8 165 9/26/2024
1.2.7 388 6/7/2024
1.2.6 84 6/6/2024
1.2.5 112 6/6/2024
1.2.4 86 6/6/2024
1.1.3 105 6/6/2024
1.1.2 474 12/1/2023
1.1.1 153 11/21/2023
1.1.0 137 11/17/2023
1.0.1 219 4/12/2023
1.0.0 184 4/11/2023