{"id":26742232,"url":"https://github.com/iotsharp/extensions.configuration.gitrepository","last_synced_at":"2025-04-14T17:49:07.025Z","repository":{"id":284612349,"uuid":"955502614","full_name":"IoTSharp/Extensions.Configuration.GitRepository","owner":"IoTSharp","description":"Git repository configuration provider","archived":false,"fork":false,"pushed_at":"2025-04-11T10:45:17.000Z","size":65,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T17:48:59.334Z","etag":null,"topics":["asp-net-core","configuration-provider","git","gitlab"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IoTSharp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"maikebing"}},"created_at":"2025-03-26T18:33:13.000Z","updated_at":"2025-04-11T10:45:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"56aa5e36-9237-4fbf-a560-a67503d2b220","html_url":"https://github.com/IoTSharp/Extensions.Configuration.GitRepository","commit_stats":null,"previous_names":["iotsharp/extensions.configuration.gitrepository"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IoTSharp%2FExtensions.Configuration.GitRepository","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IoTSharp%2FExtensions.Configuration.GitRepository/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IoTSharp%2FExtensions.Configuration.GitRepository/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IoTSharp%2FExtensions.Configuration.GitRepository/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IoTSharp","download_url":"https://codeload.github.com/IoTSharp/Extensions.Configuration.GitRepository/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248930863,"owners_count":21185096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asp-net-core","configuration-provider","git","gitlab"],"created_at":"2025-03-28T06:17:09.292Z","updated_at":"2025-04-14T17:49:07.018Z","avatar_url":"https://github.com/IoTSharp.png","language":"C#","funding_links":["https://github.com/sponsors/maikebing"],"categories":[],"sub_categories":[],"readme":"## IoTSharp/Extensions.Configuration.GitRepository\n\n### Project Overview\n**Git repository configuration provider** is a library designed for managing and loading configuration files, specifically for C# developers. It allows developers to read configuration files directly from a Git repository, enabling centralized configuration management and version control in distributed systems or microservice architectures.\n\n[![Build status](https://ci.appveyor.com/api/projects/status/egfxe7u2b23672j6?svg=true)](https://ci.appveyor.com/project/MaiKeBing/extensions-configuration-gitrepository)\n[![NuGet Count](https://img.shields.io/nuget/dt/Extensions.Configuration.GitRepository.svg?style=flat-square)](https://www.nuget.org/packages/Extensions.Configuration.GitRepository/)\n[![Issues Open](https://img.shields.io/github/issues/IoTSharp/Extensions.Configuration.GitRepository.svg?style=flat-square)](https://github.com/IoTSharp/Extensions.Configuration.GitRepository/issues)\n![NuGet Version](https://img.shields.io/nuget/v/Extensions.Configuration.GitRepository)\n\n### Key Features\n- **Load Configuration from Git Repositories**: Allows you to load configuration files from a specified Git repository, supporting various formats (such as JSON, YAML, etc.).\n- **Version Control**: Leverage Git's powerful features to easily track changes to configuration files, ensuring traceability and version management.\n- **Dynamic Refresh**: Supports dynamic refresh of configuration files, automatically updating configurations when files in the Git repository change.\n- **Flexible Configuration Sources**: Supports loading configurations from multiple branches or tags, adapting to different environments (development, testing, production).\n- **Security**: Access Git repositories via SSH or HTTPS, ensuring secure transmission and access control of configuration files.\n\n### Use Cases\n- **Distributed Systems**: Centrally manage and distribute configuration files in distributed systems, ensuring consistency and manageability across services.\n- **Microservice Architecture**: Simplify configuration management in a microservice architecture by unifying configuration file management through a Git repository.\n- **Dynamic Configuration Management**: Suitable for scenarios requiring dynamic configuration updates, such as applications with frequently changing configuration files.\n- **Version Control**: Utilize Git's version control features to ensure traceability and change management in scenarios requiring strict version control.\n\n### Installation and Usage\n#### Installation\nYou can install this library via the NuGet package manager. Run the following command to install:\n\n```shell\ndotnet add package Extensions.Configuration.GitRepository\n```\n\n#### Example Code\nHere is a simple example demonstrating how to use this library to load configuration files from a Git repository:\n\n```csharp\nvar builder = WebApplication.CreateBuilder(args);\nbuilder.Services.AddControllers();\nbuilder.Services.AddOpenApi();\nbuilder.Configuration.AddUserSecrets(\"personal_access_tokens\");\nbuilder.Configuration.AddGitRepository(cfg =\u003e cfg.WithGitLab()\n                                                .WithHostUrl(\"https://git.uixe.net/\")\n                                                .WithRepositoryPath(\"uixe/stdlanedevctlsvr\")\n                                                .WithAuthenticationToken(builder.Configuration.GetValue\u003cstring\u003e(\"personal_access_tokens\"))\n                                                .WithFileName($\"{Environment.GetEnvironmentVariable(\"UIXEID\")}/appsettings.{builder.Environment.EnvironmentName}.json\")\n                                                .WithCache($\"{builder.Environment.ContentRootPath}{System.IO.Path.DirectorySeparatorChar}appsettings.{builder.Environment.EnvironmentName}.json\")\n                                        );\n\nvar app = builder.Build();\n\n// Configure the HTTP request pipeline.\nif (app.Environment.IsDevelopment())\n{\n    app.MapOpenApi();\n}\nConsole.WriteLine($\"abc={app.Configuration.GetValue\u003cstring\u003e(\"abc\")}\");\napp.UseAuthorization();\napp.MapControllers();\napp.Run();\n}\n```\n\n### Contribution Guidelines\nWe welcome community contributions. You can contribute in the following ways:\n\n- **Report Issues**: Report bugs or suggest features on the GitHub Issues page.\n- **Submit PRs**: Fix bugs or add new features and submit your code through a Pull Request.\n- **Improve Documentation**: Help improve the project's documentation to make it clearer and more understandable.\n\n### License\nThis project is licensed under the MIT License. For details, please refer to the [LICENSE](https://github.com/IoTSharp/Extensions.Configuration.GitRepository/blob/main/LICENSE) file.\n\n### Acknowledgments\nInspired by https://github.com/denis-ivanov/Extensions.Configuration.GitLab\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiotsharp%2Fextensions.configuration.gitrepository","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiotsharp%2Fextensions.configuration.gitrepository","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiotsharp%2Fextensions.configuration.gitrepository/lists"}