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通過其免費開源許可計劃中的所有產品包支持該項目。