diff --git a/DaprTool.Solution.sln b/DaprTool.Solution.sln index ab7b347172606ae2bda41fc68e6ef048f3fd040d..4eeb4328f59d18c3d25fe7e49109b29ab1334806 100644 --- a/DaprTool.Solution.sln +++ b/DaprTool.Solution.sln @@ -97,6 +97,9 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DaprTool.AbstractionsTest", "test\DaprTool.AbstractionsTest\DaprTool.AbstractionsTest.csproj", "{9D99BAB3-C5FA-4EB8-8CCF-4476957484D2}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IdentityServer4", "IdentityServer4", "{D2F20A9C-E732-43EA-9615-70F9FD46253A}" + ProjectSection(SolutionItems) = preProject + src\IdentityServer4\README.md = src\IdentityServer4\README.md + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DaprActorExtensions", "src\BuildingBlocks\DaprActorExtensions\DaprActorExtensions.csproj", "{E8E71C63-315D-4CD5-9847-4FFE30D2EA45}" EndProject diff --git a/README.md b/README.md index 1e98ef7bff12b6fbdb98fa851ec28b2722f8f2ff..db1c07d33d3e9e5376c60c93adf1ad7efbc71613 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,30 @@ # 使用 Dapr 构建分布式应用测试项目 +# QuickStart + + +```bash + +git clone git@gitee.com:gold-cloud/dapr-tool-solution.git + +visual studio 2022 p +``` # 先决条件 ### 基础设施 +- **[`Visual Studio 2022 预览版`](https://visualstudio.microsoft.com/zh-hans/vs/preview/)** +- **[`.NET 8.0 +`](https://dotnet.microsoft.com/download)** -安装了 vs 后会自带 无需单独安装 - **[`Dapr`](https://dapr.io/)** -- **[`Dotnet`](https://dotnet.microsoft.com/download)** - **[`WSL2 - Ubuntu OS`](https://docs.microsoft.com/en-us/windows/wsl/install-win10)** -- **[`.NET 8.0`](https://dotnet.microsoft.com/download)** - -### 构建编排 - -- **[`.NET Aspire`](https://github.com/dotnet/aspire)** - **[`Aspir8`](https://prom3theu5.github.io/aspirational-manifests/getting-started.html)** -- **[`Docker for desktop`](https://www.docker.com/products/docker-desktop)** +- **[`Docker for desktop`](https://www.docker.com/products/docker-desktop)** +- **[`RabbitMQ`](https://gitee.com/iamshen/my-docker-compose/blob/master/rabbitmq/README.MD)** -### 后端服务 +### 后端 +- **[`.NET Aspire`](https://github.com/dotnet/aspire)** - **[`Yarp`](https://github.com/microsoft/reverse-proxy)** - **[`MediatR`](https://github.com/jbogard/MediatR)** - **[`Linq2Db`](https://github.com/linq2db/linq2db)** @@ -26,7 +33,7 @@ - **[`FluentValidation`](https://github.com/FluentValidation/FluentValidation)** - **[`Swashbuckle.AspNetCore`](https://github.com/domaindrivendev/Swashbuckle.AspNetCore)** -### 前端 UI +### 前端 - **[`ASP.NET Core Web UI(Blazor)`](https://learn.microsoft.com/zh-cn/aspnet/core/tutorials/choose-web-ui?view=aspnetcore-8.0)** - **[`Fluent UI Blazor`](https://www.fluentui-blazor.net/)** @@ -42,3 +49,17 @@ # 可插拔组件 > 本地测试 可插拔组件的时候 请使用 wsl 运行 dotnet run + + + +### IdentityServer4 + +#### 数据库准备 + +* 1. 创建数据库 + - `1.1 创建 postgres 用户 idsrv4 密码 Local@Db` + - `1.2 创建 postgres 数据库 CREATE DATABASE idsrv4 OWNER idsrv4;` +* 2. 初始化数据库 + - `2.1 把 Idsrv4.Admin | Idsrv4.Admin.Api | Idsrv4.Admin.STS.Identity 这三个项目中 appsettings.json 的所有 ConnectionStrings 的连接字符串修改为自己本地 localhost` + - `2.2 cd dapr-tool-solution\src\IdentityServer4\src\Idsrv4.Admin` + - `2.3 dotnet run /seed` \ No newline at end of file diff --git a/src/IdentityServer4/src/Idsrv4.Admin.Api/appsettings.json b/src/IdentityServer4/src/Idsrv4.Admin.Api/appsettings.json index a6d26fb0a7b107f216fc98a9aa1d0d1faafb87dd..3be2da1939a57e8ce1144c0fc8686d65271842ad 100644 --- a/src/IdentityServer4/src/Idsrv4.Admin.Api/appsettings.json +++ b/src/IdentityServer4/src/Idsrv4.Admin.Api/appsettings.json @@ -1,11 +1,11 @@ { "ConnectionStrings": { - "ConfigurationDbConnection": "Server=localhost;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", - "PersistedGrantDbConnection": "Server=localhost;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", - "IdentityDbConnection": "Server=localhost;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", - "AdminLogDbConnection": "Server=localhost;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", - "AdminAuditLogDbConnection": "Server=localhost;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", - "DataProtectionDbConnection": "Server=localhost;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;" + "ConfigurationDbConnection": "Server=192.168.8.112;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", + "PersistedGrantDbConnection": "Server=192.168.8.112;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", + "IdentityDbConnection": "Server=192.168.8.112;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", + "AdminLogDbConnection": "Server=192.168.8.112;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", + "AdminAuditLogDbConnection": "Server=192.168.8.112;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", + "DataProtectionDbConnection": "Server=192.168.8.112;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;" }, "AdminApiConfiguration": { "ApiName": "IdentityServer4 Admin Api", diff --git a/src/IdentityServer4/src/Idsrv4.Admin.STS.Identity/appsettings.json b/src/IdentityServer4/src/Idsrv4.Admin.STS.Identity/appsettings.json index 9e4dfd98171a558e15e9386e207f8cb09dd88dfc..d80a55dc92a729ffb715aefe1d9cf7f507230579 100644 --- a/src/IdentityServer4/src/Idsrv4.Admin.STS.Identity/appsettings.json +++ b/src/IdentityServer4/src/Idsrv4.Admin.STS.Identity/appsettings.json @@ -1,9 +1,9 @@ { "ConnectionStrings": { - "ConfigurationDbConnection": "Server=localhost;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", - "PersistedGrantDbConnection": "Server=localhost;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", - "IdentityDbConnection": "Server=localhost;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", - "DataProtectionDbConnection": "Server=localhost;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;" + "ConfigurationDbConnection": "Server=192.168.8.112;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", + "PersistedGrantDbConnection": "Server=192.168.8.112;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", + "IdentityDbConnection": "Server=192.168.8.112;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", + "DataProtectionDbConnection": "Server=192.168.8.112;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;" }, "DatabaseProviderConfiguration": { "ProviderType": "PostgreSQL" diff --git a/src/IdentityServer4/src/Idsrv4.Admin/appsettings.json b/src/IdentityServer4/src/Idsrv4.Admin/appsettings.json index 00b384ac9b9b6ef4653497f70ab2adfd7b512d0a..5ec2ec256047d3b25ed387fa8e2988475a1a2b20 100644 --- a/src/IdentityServer4/src/Idsrv4.Admin/appsettings.json +++ b/src/IdentityServer4/src/Idsrv4.Admin/appsettings.json @@ -1,11 +1,11 @@ { "ConnectionStrings": { - "ConfigurationDbConnection": "Server=localhost;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", - "PersistedGrantDbConnection": "Server=localhost;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", - "IdentityDbConnection": "Server=localhost;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", - "AdminLogDbConnection": "Server=localhost;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", - "AdminAuditLogDbConnection": "Server=localhost;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", - "DataProtectionDbConnection": "Server=localhost;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;" + "ConfigurationDbConnection": "Server=192.168.8.112;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", + "PersistedGrantDbConnection": "Server=192.168.8.112;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", + "IdentityDbConnection": "Server=192.168.8.112;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", + "AdminLogDbConnection": "Server=192.168.8.112;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", + "AdminAuditLogDbConnection": "Server=192.168.8.112;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;", + "DataProtectionDbConnection": "Server=192.168.8.112;Port=5432;Database=idsrv4;User Id=idsrv4;Password=Local@Db;Pooling=true;MaxPoolSize=100;" }, "SeedConfiguration": { "ApplySeed": false diff --git a/src/IdentityServer4/src/Idsrv4.Admin/identityserverdata.json b/src/IdentityServer4/src/Idsrv4.Admin/identityserverdata.json index 60319d6103cc9082c892b457019c0583ba6c4d4d..78aa62930a388083fe6f1bf5871ba1c2c8f64c8b 100644 --- a/src/IdentityServer4/src/Idsrv4.Admin/identityserverdata.json +++ b/src/IdentityServer4/src/Idsrv4.Admin/identityserverdata.json @@ -81,10 +81,42 @@ } ], "Clients": [ + { + "ClientId": "web_admin", + "ClientName": "web_admin", + "ClientUri": "https://localhost:44444/admin", + "AllowedGrantTypes": [ + "authorization_code" + ], + "RequirePkce": true, + "ClientSecrets": [ + { + "Value": "c7c7d023-4bed-f262-64da-6d7a42c24f6c" + } + ], + "RedirectUris": [ + "https://localhost:44444/admin/signin-oidc" + ], + "FrontChannelLogoutUri": "https://localhost:44444/admin/signout-oidc", + "PostLogoutRedirectUris": [ + "https://localhost:44444/admin/signout-callback-oidc" + ], + "AllowedCorsOrigins": [ + "https://localhost:44444" + ], + "AllowedScopes": [ + "roles", + "profile", + "openid", + "email", + "identity_admin_api", + "offline_access" + ] + }, { "ClientId": "identity_admin", "ClientName": "identity_admin", - "ClientUri": "https://localhost:44303/authAdmin", + "ClientUri": "https://localhost:44444/auth/admin", "AllowedGrantTypes": [ "authorization_code" ], @@ -95,14 +127,14 @@ } ], "RedirectUris": [ - "https://localhost:44303/authAdmin/signin-oidc" + "https://localhost:44444/auth/admin/signin-oidc" ], - "FrontChannelLogoutUri": "https://localhost:44303/authAdmin/signout-oidc", + "FrontChannelLogoutUri": "https://localhost:44444/auth/admin/signout-oidc", "PostLogoutRedirectUris": [ - "https://localhost:44303/authAdmin/signout-callback-oidc" + "https://localhost:44444/auth/admin/signout-callback-oidc" ], "AllowedCorsOrigins": [ - "https://localhost:44303/authAdmin" + "https://localhost:44444" ], "AllowedScopes": [ "openid",