Starfish is a lightweight powerful distributed configuration server for .NET application.
Starfish是一个轻量但功能强大的分布式 .NET 应用程序配置中心。
Completed/已完成 ⌛ In progress/进行中 Planned/计划中
Paypal
https://www.paypal.me/realzhaorong
If you like my work, you can support me by donation. / 如果您喜欢我的工作,可以通过捐赠来支持我。
Any feedback is welcome, you can create a issue, or contact us by email, thank you.
非常乐意收到您的任何反馈,您可以创建一个 issue,或通过邮件联系我们,谢谢。
This project is licensed under the AGPL-3.0 License - see the LICENSE file for details.
本项目采用 AGPL-3.0 协议,可查看 LICENSE 了解更详细内容。
Starfish
├──Source
├ ├──Starfish.Client
├ ├──~~Starfish.Agent~~
├ ├──Starfish.Common
├ ├──Starfish.Service
├ ├──Starfish.Transit
├ ├──Starfish.Webapi
├ ├──Starfish.Webapp
├──Tests
├ ├──Starfish.Client.Tests
├ ├──Starfish.Service.Tests
graph TD
Starfish.Webapi --> Starfish.Service
Starfish.Service --> Starfish.Transit
Starfish.Service --> Starfish.Common
Starfish.Client --> Starfish.Common
Starfish.Webapp --> Starfish.Client
Starfish.Webapp --> Starfish.Common
Starfish.Webapp --> Starfish.Transit
IDE/开发环境
Dependencies/依赖服务
Deploy & Run/部署与运行
Runtime/运行环境
Dependencies/依赖服务
Deploy & Run/部署与运行
{
"ConnectionStrings": {
"Default": ""
},
"DatabaseType": "",
"JwtBearerOptions": {
"Scheme": "Bearer",
"RequireHttpsMetadata": false,
"ApiName": "starfish_api",
"AuthorityUrl": "http://localhost:5229",
"TokenIssuer": "localhost",
"TokenKey": "NEROSOFT-STARFISH-WEBAPI"
},
"CorsOrigins": [
"https://localhost"
],
"ServiceBus": {
"Provider": "inmemory",
"InMemory": {
"MultipleSubscriberInstance": false
}
},
"InitializeUser": {
"UserName": "admin",
"Password": "Starfish.8888"
},
"ReservedUsernames": [
"starfish",
"admin",
"administrator",
"root"
],
"FeatureManagement": {
"UserRegistration": true
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}| Key | Description | Type | Options |
|---|---|---|---|
| ConnectionStrings | Database connection string | Object | N/A |
| - Default | Default database connection string | String | N/A |
| DatabaseType | Database type | String | mysql/sqlite/sqlserver/mongo/postgresql |
| JwtBearerOptions | JWT Bearer options | Object | N/A |
| - Scheme | Scheme | String | Bearer |
| - RequireHttpsMetadata | Require HTTPS metadata | Boolean | true/false |
| - ApiName | API name | String | starfish_api |
| - AuthorityUrl | Authority URL | String | http://localhost:5229 |
| - TokenIssuer | Token issuer | String | localhost |
| - TokenKey | String | N/A | |
| CorsOrigins | CORS origins | String array | N/A |
| ServiceBus | Service bus options | Object | N/A |
| - Provider | Message transport provider | String | inmemory/rabbitmq |
| - InMemory | InMemory options | Object | N/A |
| - - MultipleSubscriberInstance | N/A | Boolean | true/false |
| InitializeUser | Options to initialize user | Object | N/A |
| - UserName | Username | String | N/A |
| - Password | Password | String | N/A |
| ReservedUsernames | Reserved usernames | String array | N/A |
| FeatureManagement | Feature management | Object | N/A |
| - UserRegistration | A value indicate whether user registration is enabled or not | Boolean | true/false |
dotnet add package Starfish.Clientor
Install-Package Starfish.Clientor
<PackageReference Include="Starfish.Client" Version="1.0.0" />// .NET 5
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration((hostingContext, config) =>
{
config.AddStarfish(ConfigurationClientOptions.Load(config));
})
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});// .NET 6 and above
var builder = WebApplication.CreateBuilder(args);
builder.Configuration.AddStarfish(ConfigurationClientOptions.Load(builder.Configuration));
// ...
var app = builder.Build();
// ...
app.Run();{
"Starfish": {
"Host": "http://localhost:5000",
"Id": "5lNc9zQGdG7",
"Secret": "123456"
}
}See the Swagger UI at http://localhost:5229/swagger after running the server.
Thanks to JetBrains for supporting the project through All Products Packs within their Free Open Source License program.
感谢JetBrains通过其免费开源许可计划中的所有产品包支持该项目。