diff --git a/DaprTool.Solution.sln.DotSettings b/DaprTool.Solution.sln.DotSettings index 1066fd98aa37c515be4b856e7af5a07e570739bc..b73a902419309781916eb6e6d9e8b880f01227a2 100644 --- a/DaprTool.Solution.sln.DotSettings +++ b/DaprTool.Solution.sln.DotSettings @@ -1,4 +1,5 @@  + True True True True diff --git a/Directory.Packages.props b/Directory.Packages.props index 46c9520e8bbfe1ae782bc51abb579e3c537a2ed7..a64a94de883bc9266c0ae560d21e49f8b0c2c927 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -68,7 +68,7 @@ - + @@ -123,20 +123,20 @@ - + - - + + - + diff --git a/NuGet.Config b/NuGet.Config index c4cf7bd6df8050ebc65ae91305b38284c81c8155..b142f6c42948730b4b46c6af32da609e9bfe2ad4 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -2,9 +2,6 @@ - - - \ No newline at end of file diff --git a/build/DaprTool.Solution.AppHost/Program.cs b/build/DaprTool.Solution.AppHost/Program.cs index 328e8912c7eac907246efa28d8a83f2850fe6084..a625615f8fee81adcec8b32d1a9e99850697c0f8 100644 --- a/build/DaprTool.Solution.AppHost/Program.cs +++ b/build/DaprTool.Solution.AppHost/Program.cs @@ -1,41 +1,41 @@ using DaprTool.BuildingBlocks.Utils.Constant; using Microsoft.Extensions.DependencyInjection; +using Projects; var builder = DistributedApplication.CreateBuilder(args); builder.Services.AddProblemDetails(); -// web admin -var webAdmin = builder.AddProject(Constants.WebAdmin.AppId) - .WithDaprSidecar(Constants.WebAdmin.GetSideCarOptions()) - .WithHttpEndpoint(port: Constants.WebAdmin.ResourceHttpPort); - -// auth-server -var authSts = builder.AddProject(Constants.AuthSts.AppId) +var authSts = builder.AddProject(Constants.AuthSts.AppId) .WithDaprSidecar(Constants.AuthSts.GetSideCarOptions()) - .WithHttpEndpoint(port: Constants.AuthSts.ResourceHttpPort); + .WithExternalHttpEndpoints(); -var authAdmin = builder.AddProject(Constants.AuthAdmin.AppId) +var authAdmin = builder.AddProject(Constants.AuthAdmin.AppId) .WithDaprSidecar(Constants.AuthAdmin.GetSideCarOptions()) - .WithHttpEndpoint(port: Constants.AuthAdmin.ResourceHttpPort); + .WithExternalHttpEndpoints(); -var authApi = builder.AddProject(Constants.AuthApi.AppId) +var authApi = builder.AddProject(Constants.AuthApi.AppId) .WithDaprSidecar(Constants.AuthApi.GetSideCarOptions()) - .WithHttpEndpoint(port: Constants.AuthApi.ResourceHttpPort); + .WithExternalHttpEndpoints(); + +var webAdmin = builder.AddProject(Constants.WebAdmin.AppId) + .WithDaprSidecar(Constants.WebAdmin.GetSideCarOptions()) + .WithReference(authSts) + .WithReference(authApi) + .WithExternalHttpEndpoints(); -// api services -var orderApi = builder.AddProject(Constants.Ordering.AppId) +var orderApi = builder.AddProject(Constants.Ordering.AppId) .WithDaprSidecar(Constants.Ordering.GetSideCarOptions()) - .WithHttpEndpoint(port: Constants.Ordering.ResourceHttpPort); + .WithExternalHttpEndpoints(); -// proxy server -builder.AddProject(Constants.ProxyServer.AppId) - .WithReference(webAdmin) - .WithReference(authAdmin) - .WithReference(authSts) - .WithReference(authApi) - .WithReference(orderApi); +builder.AddProject(Constants.ProxyServer.AppId) + .WithReference(webAdmin) + .WithReference(authAdmin) + .WithReference(authSts) + .WithReference(authApi) + .WithReference(orderApi) + .WithExternalHttpEndpoints(); var app = builder.Build(); -app.Run(); +app.Run(); \ No newline at end of file diff --git a/build/DaprTool.Solution.AppHost/Properties/launchSettings.json b/build/DaprTool.Solution.AppHost/Properties/launchSettings.json index b916666c3212bccbc2f5dbc0705bc16d8776874a..b8e2591e740471c0463d72780f89db9a185de242 100644 --- a/build/DaprTool.Solution.AppHost/Properties/launchSettings.json +++ b/build/DaprTool.Solution.AppHost/Properties/launchSettings.json @@ -10,7 +10,8 @@ "ASPNETCORE_ENVIRONMENT": "Development", "DOTNET_ENVIRONMENT": "Development", "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21298", - "DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22061" + "DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22061", + "DOTNET_ASPIRE_SHOW_DASHBOARD_RESOURCES": "true" } }, "http": { @@ -22,7 +23,9 @@ "ASPNETCORE_ENVIRONMENT": "Development", "DOTNET_ENVIRONMENT": "Development", "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19293", - "DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20129" + "DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20129", + "DOTNET_ASPIRE_SHOW_DASHBOARD_RESOURCES": "true", + "ASPIRE_ALLOW_UNSECURED_TRANSPORT": "true" } } } diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/admin/deployment.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/admin/deployment.yaml deleted file mode 100644 index 1a45619380fdb5250492d00c09264fb381ecfa09..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/admin/deployment.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: admin - labels: - app: admin - annotations: - dapr.io/enabled: 'true' - dapr.io/config: tracing - dapr.io/app-id: admin - dapr.io/enable-api-logging: 'true' -spec: - minReadySeconds: 60 - replicas: 1 - selector: - matchLabels: - app: admin - strategy: - type: Recreate - template: - metadata: - labels: - app: admin - annotations: - dapr.io/enabled: 'true' - dapr.io/config: tracing - dapr.io/app-id: admin - dapr.io/enable-api-logging: 'true' - spec: - containers: - - name: admin - image: registry.cn-shenzhen.aliyuncs.com/project-workspace/web-admin:1.0.5-alpha1 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 - - containerPort: 8443 - envFrom: - - configMapRef: - name: admin-env - terminationGracePeriodSeconds: 180 \ No newline at end of file diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/admin/kustomization.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/admin/kustomization.yaml deleted file mode 100644 index 5933d6551a91ac66ab8bb479881f37e82c16b9c0..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/admin/kustomization.yaml +++ /dev/null @@ -1,18 +0,0 @@ -resources: -- deployment.yaml -- service.yaml - -generatorOptions: - disableNameSuffixHash: true - -configMapGenerator: -- name: admin-env - literals: - - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES=true - - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES=true - - OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY=in_memory - - ASPNETCORE_FORWARDEDHEADERS_ENABLED=true - - OTEL_EXPORTER_OTLP_ENDPOINT=http://aspire-dashboard:18889 - - OTEL_SERVICE_NAME=admin - - ASPNETCORE_URLS=http://+:8080; - diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/admin/service.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/admin/service.yaml deleted file mode 100644 index 2b8ba155d0ebe2292eb82e6d369bd0a16fed0902..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/admin/service.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: admin -spec: - type: ClusterIP - selector: - app: admin - ports: - - name: http - port: 51871 - targetPort: 8080 - - name: https - port: 8443 - targetPort: 8443 diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/auth-admin/deployment.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/auth-admin/deployment.yaml deleted file mode 100644 index 7d058376bb49576b54100380c0d0c765581a632f..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/auth-admin/deployment.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: auth-admin - labels: - app: auth-admin - annotations: - dapr.io/enabled: 'true' - dapr.io/config: tracing - dapr.io/app-id: auth-admin - dapr.io/enable-api-logging: 'true' -spec: - minReadySeconds: 60 - replicas: 1 - selector: - matchLabels: - app: auth-admin - strategy: - type: Recreate - template: - metadata: - labels: - app: auth-admin - annotations: - dapr.io/enabled: 'true' - dapr.io/config: tracing - dapr.io/app-id: auth-admin - dapr.io/enable-api-logging: 'true' - spec: - containers: - - name: auth-admin - image: registry.cn-shenzhen.aliyuncs.com/project-workspace/auth-admin:1.0.5-alpha1 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 - - containerPort: 8443 - envFrom: - - configMapRef: - name: auth-admin-env - terminationGracePeriodSeconds: 180 \ No newline at end of file diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/auth-admin/kustomization.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/auth-admin/kustomization.yaml deleted file mode 100644 index 2a22d1243af55f0f553b43c8c9c5e75ecb731b01..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/auth-admin/kustomization.yaml +++ /dev/null @@ -1,18 +0,0 @@ -resources: -- deployment.yaml -- service.yaml - -generatorOptions: - disableNameSuffixHash: true - -configMapGenerator: -- name: auth-admin-env - literals: - - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES=true - - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES=true - - OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY=in_memory - - ASPNETCORE_FORWARDEDHEADERS_ENABLED=true - - OTEL_EXPORTER_OTLP_ENDPOINT=http://aspire-dashboard:18889 - - OTEL_SERVICE_NAME=auth-admin - - ASPNETCORE_URLS=http://+:8080; - diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/auth-admin/service.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/auth-admin/service.yaml deleted file mode 100644 index caa03a0d09a032cc80175fe6c28214487e72296f..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/auth-admin/service.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: auth-admin -spec: - type: ClusterIP - selector: - app: auth-admin - ports: - - name: http - port: 53871 - targetPort: 8080 - - name: https - port: 8443 - targetPort: 8443 diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/auth-api/deployment.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/auth-api/deployment.yaml deleted file mode 100644 index aec53fc0bc0ddfd433666de088a271bca5f09db5..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/auth-api/deployment.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: auth-api - labels: - app: auth-api - annotations: - dapr.io/enabled: 'true' - dapr.io/config: tracing - dapr.io/app-id: auth-api - dapr.io/enable-api-logging: 'true' -spec: - minReadySeconds: 60 - replicas: 1 - selector: - matchLabels: - app: auth-api - strategy: - type: Recreate - template: - metadata: - labels: - app: auth-api - annotations: - dapr.io/enabled: 'true' - dapr.io/config: tracing - dapr.io/app-id: auth-api - dapr.io/enable-api-logging: 'true' - spec: - containers: - - name: auth-api - image: registry.cn-shenzhen.aliyuncs.com/project-workspace/auth-api:1.0.5-alpha1 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 - - containerPort: 8443 - envFrom: - - configMapRef: - name: auth-api-env - terminationGracePeriodSeconds: 180 \ No newline at end of file diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/auth-api/kustomization.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/auth-api/kustomization.yaml deleted file mode 100644 index 9b6b0fa19fd656ec67fadba0fdcb05686526819e..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/auth-api/kustomization.yaml +++ /dev/null @@ -1,18 +0,0 @@ -resources: -- deployment.yaml -- service.yaml - -generatorOptions: - disableNameSuffixHash: true - -configMapGenerator: -- name: auth-api-env - literals: - - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES=true - - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES=true - - OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY=in_memory - - ASPNETCORE_FORWARDEDHEADERS_ENABLED=true - - OTEL_EXPORTER_OTLP_ENDPOINT=http://aspire-dashboard:18889 - - OTEL_SERVICE_NAME=auth-api - - ASPNETCORE_URLS=http://+:8080; - diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/auth-api/service.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/auth-api/service.yaml deleted file mode 100644 index d6deea6141cdda3292a0de74b598b84ac56d5754..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/auth-api/service.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: auth-api -spec: - type: ClusterIP - selector: - app: auth-api - ports: - - name: http - port: 54871 - targetPort: 8080 - - name: https - port: 8443 - targetPort: 8443 diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/auth-sts/deployment.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/auth-sts/deployment.yaml deleted file mode 100644 index f1c71f8dc45a351abf11c1dd2d51d040e2b16dab..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/auth-sts/deployment.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: auth-sts - labels: - app: auth-sts - annotations: - dapr.io/enabled: 'true' - dapr.io/config: tracing - dapr.io/app-id: auth-sts - dapr.io/enable-api-logging: 'true' -spec: - minReadySeconds: 60 - replicas: 1 - selector: - matchLabels: - app: auth-sts - strategy: - type: Recreate - template: - metadata: - labels: - app: auth-sts - annotations: - dapr.io/enabled: 'true' - dapr.io/config: tracing - dapr.io/app-id: auth-sts - dapr.io/enable-api-logging: 'true' - spec: - containers: - - name: auth-sts - image: registry.cn-shenzhen.aliyuncs.com/project-workspace/auth-sts:1.0.5-alpha1 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 - - containerPort: 8443 - envFrom: - - configMapRef: - name: auth-sts-env - terminationGracePeriodSeconds: 180 \ No newline at end of file diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/auth-sts/kustomization.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/auth-sts/kustomization.yaml deleted file mode 100644 index d8c748b5e24a7ae5b341aaa6cf0657f0f7737c09..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/auth-sts/kustomization.yaml +++ /dev/null @@ -1,18 +0,0 @@ -resources: -- deployment.yaml -- service.yaml - -generatorOptions: - disableNameSuffixHash: true - -configMapGenerator: -- name: auth-sts-env - literals: - - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES=true - - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES=true - - OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY=in_memory - - ASPNETCORE_FORWARDEDHEADERS_ENABLED=true - - OTEL_EXPORTER_OTLP_ENDPOINT=http://aspire-dashboard:18889 - - OTEL_SERVICE_NAME=auth-sts - - ASPNETCORE_URLS=http://+:8080; - diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/auth-sts/service.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/auth-sts/service.yaml deleted file mode 100644 index 32354faa2c2cc98864f8070116cb53561da297a8..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/auth-sts/service.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: auth-sts -spec: - type: ClusterIP - selector: - app: auth-sts - ports: - - name: http - port: 52871 - targetPort: 8080 - - name: https - port: 8443 - targetPort: 8443 diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/dashboard.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/dashboard.yaml deleted file mode 100644 index 78c0a53e5a09ceec58f31043a046234e82f52c2b..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/dashboard.yaml +++ /dev/null @@ -1,52 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: aspire-dashboard - labels: - app: aspire-dashboard -spec: - replicas: 1 - selector: - matchLabels: - app: aspire-dashboard - template: - metadata: - labels: - app: aspire-dashboard - spec: - terminationGracePeriodSeconds: 30 - containers: - - name: aspire-dashboard - image: mcr.microsoft.com/dotnet/aspire-dashboard:8.0 - resources: - requests: - cpu: "500m" - memory: "512Mi" - limits: - memory: "512Mi" - ports: - - name: dashboard-ui - containerPort: 18888 - - name: otlp - containerPort: 18889 - env: - - name: DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS - value: "true" ---- -apiVersion: v1 -kind: Service -metadata: - name: aspire-dashboard -spec: - selector: - app: aspire-dashboard - ports: - - name: dashboard-ui - protocol: TCP - port: 18888 - targetPort: 18888 - - name: otlp - protocol: TCP - port: 18889 - targetPort: 18889 - type: ClusterIP \ No newline at end of file diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/docker-compose.override.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/docker-compose.override.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9cd57711d70404939b7851b478b8d23ac72842f3 --- /dev/null +++ b/build/DaprTool.Solution.AppHost/aspirate-output/docker-compose.override.yaml @@ -0,0 +1,84 @@ +version: '3.8' + +services: + admin: + ports: + - target: 8080 + published: 24401 + - target: 8443 + published: 25501 + + admin-dapr: + command: + - "./daprd" + - "-app-id" + - "admin" + - "-app-port" + - "24401" + + auth-sts: + ports: + - target: 8080 + published: 24404 + - target: 8443 + published: 25504 + + auth-sts-dapr: + command: + - "./daprd" + - "-app-id" + - "auth-sts" + - "-app-port" + - "24404" + + auth-admin: + ports: + - target: 8080 + published: 24403 + - target: 8443 + published: 25503 + + auth-admin-dapr: + command: + - "./daprd" + - "-app-id" + - "auth-admin" + - "-app-port" + - "24403" + + auth-api: + ports: + - target: 8080 + published: 24402 + - target: 8443 + published: 25502 + + auth-api-dapr: + command: + - "./daprd" + - "-app-id" + - "auth-api" + - "-app-port" + - "24402" + + order: + ports: + - target: 8080 + published: 24405 + - target: 8443 + published: 25505 + + order-dapr: + command: + - "./daprd" + - "-app-id" + - "order" + - "-app-port" + - "24405" + + proxy-server: + ports: + - target: 8080 + published: 24400 + - target: 8443 + published: 25500 diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/docker-compose.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/docker-compose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bf1eca3592b38477b6223e9bcf85d8112517d50b --- /dev/null +++ b/build/DaprTool.Solution.AppHost/aspirate-output/docker-compose.yaml @@ -0,0 +1,171 @@ +services: + aspire-dashboard: + container_name: "aspire-dashboard" + image: "mcr.microsoft.com/dotnet/aspire-dashboard:8.0" + environment: + DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS: "true" + ports: + - target: 18888 + published: 18888 + restart: unless-stopped + admin: + container_name: "admin" + image: "registry.cn-shenzhen.aliyuncs.com/project-workspace/web-admin:1.0.12-alpha1" + environment: + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true" + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true" + OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory" + ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true" + OTEL_EXPORTER_OTLP_ENDPOINT: "http://aspire-dashboard:18889" + OTEL_SERVICE_NAME: "admin" + ports: + - target: 8080 + published: 10000 + - target: 8443 + published: 10001 + restart: unless-stopped + admin-dapr: + network_mode: "service:admin" + image: "daprio/daprd:latest" + command: + - "./daprd" + - "-app-id" + - "admin" + - "-app-port" + - "8080" + restart: unless-stopped + depends_on: + - "admin" + auth-sts: + container_name: "auth-sts" + image: "registry.cn-shenzhen.aliyuncs.com/project-workspace/auth-sts:1.0.12-alpha1" + environment: + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true" + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true" + OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory" + ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true" + OTEL_EXPORTER_OTLP_ENDPOINT: "http://aspire-dashboard:18889" + OTEL_SERVICE_NAME: "auth-sts" + ports: + - target: 8080 + published: 10002 + - target: 8443 + published: 10003 + restart: unless-stopped + auth-sts-dapr: + network_mode: "service:auth-sts" + image: "daprio/daprd:latest" + command: + - "./daprd" + - "-app-id" + - "auth-sts" + - "-app-port" + - "8080" + restart: unless-stopped + depends_on: + - "auth-sts" + auth-admin: + container_name: "auth-admin" + image: "registry.cn-shenzhen.aliyuncs.com/project-workspace/auth-admin:1.0.12-alpha1" + environment: + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true" + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true" + OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory" + ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true" + OTEL_EXPORTER_OTLP_ENDPOINT: "http://aspire-dashboard:18889" + OTEL_SERVICE_NAME: "auth-admin" + ports: + - target: 8080 + published: 10004 + - target: 8443 + published: 10005 + restart: unless-stopped + auth-admin-dapr: + network_mode: "service:auth-admin" + image: "daprio/daprd:latest" + command: + - "./daprd" + - "-app-id" + - "auth-admin" + - "-app-port" + - "8080" + restart: unless-stopped + depends_on: + - "auth-admin" + auth-api: + container_name: "auth-api" + image: "registry.cn-shenzhen.aliyuncs.com/project-workspace/auth-api:1.0.12-alpha1" + environment: + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true" + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true" + OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory" + ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true" + OTEL_EXPORTER_OTLP_ENDPOINT: "http://aspire-dashboard:18889" + OTEL_SERVICE_NAME: "auth-api" + ports: + - target: 8080 + published: 10006 + - target: 8443 + published: 10007 + restart: unless-stopped + auth-api-dapr: + network_mode: "service:auth-api" + image: "daprio/daprd:latest" + command: + - "./daprd" + - "-app-id" + - "auth-api" + - "-app-port" + - "8080" + restart: unless-stopped + depends_on: + - "auth-api" + order: + container_name: "order" + image: "registry.cn-shenzhen.aliyuncs.com/project-workspace/order-api:1.0.12-alpha1" + environment: + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true" + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true" + OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory" + ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true" + OTEL_EXPORTER_OTLP_ENDPOINT: "http://aspire-dashboard:18889" + OTEL_SERVICE_NAME: "order" + ports: + - target: 8080 + published: 10008 + - target: 8443 + published: 10009 + restart: unless-stopped + order-dapr: + network_mode: "service:order" + image: "daprio/daprd:latest" + command: + - "./daprd" + - "-app-id" + - "order" + - "-app-port" + - "8080" + restart: unless-stopped + depends_on: + - "order" + proxy-server: + container_name: "proxy-server" + image: "registry.cn-shenzhen.aliyuncs.com/project-workspace/proxy-server:1.0.12-alpha1" + environment: + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true" + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true" + OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory" + ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true" + services__admin__http__0: "http://admin:8080" + services__auth-admin__http__0: "http://auth-admin:8080" + services__auth-sts__http__0: "http://auth-sts:8080" + services__auth-api__http__0: "http://auth-api:8080" + services__order__http__0: "http://order:8080" + OTEL_EXPORTER_OTLP_ENDPOINT: "http://aspire-dashboard:18889" + OTEL_SERVICE_NAME: "proxy-server" + ports: + - target: 8080 + published: 10010 + - target: 8443 + published: 10011 + restart: unless-stopped diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/kustomization.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/kustomization.yaml deleted file mode 100644 index 3f3ba56e70b1f441696c222e2332f06ed5f0ad40..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/kustomization.yaml +++ /dev/null @@ -1,17 +0,0 @@ -namespace: dapr-playground - -resources: -- admin -- auth-sts -- auth-admin -- auth-api -- order-api -- proxy-monitor -- proxy-server -- namespace.yaml -- dashboard.yaml - -generatorOptions: - disableNameSuffixHash: true - - diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/namespace.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/namespace.yaml deleted file mode 100644 index cd0442df06789063e402a5968048ef504c4b075c..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: dapr-playground \ No newline at end of file diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/order-api/deployment.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/order-api/deployment.yaml deleted file mode 100644 index 69db7c15eb63ee02580daf3d965f368e9fc7936f..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/order-api/deployment.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: order-api - labels: - app: order-api - annotations: - dapr.io/enabled: 'true' - dapr.io/config: tracing - dapr.io/app-id: order-api - dapr.io/enable-api-logging: 'true' -spec: - minReadySeconds: 60 - replicas: 1 - selector: - matchLabels: - app: order-api - strategy: - type: Recreate - template: - metadata: - labels: - app: order-api - annotations: - dapr.io/enabled: 'true' - dapr.io/config: tracing - dapr.io/app-id: order-api - dapr.io/enable-api-logging: 'true' - spec: - containers: - - name: order-api - image: registry.cn-shenzhen.aliyuncs.com/project-workspace/order-api:1.0.5-alpha1 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 - - containerPort: 8443 - envFrom: - - configMapRef: - name: order-api-env - terminationGracePeriodSeconds: 180 \ No newline at end of file diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/order-api/kustomization.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/order-api/kustomization.yaml deleted file mode 100644 index 0af82122bb160c463d6ab9d1efb5e99140cfa156..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/order-api/kustomization.yaml +++ /dev/null @@ -1,18 +0,0 @@ -resources: -- deployment.yaml -- service.yaml - -generatorOptions: - disableNameSuffixHash: true - -configMapGenerator: -- name: order-api-env - literals: - - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES=true - - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES=true - - OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY=in_memory - - ASPNETCORE_FORWARDEDHEADERS_ENABLED=true - - OTEL_EXPORTER_OTLP_ENDPOINT=http://aspire-dashboard:18889 - - OTEL_SERVICE_NAME=order-api - - ASPNETCORE_URLS=http://+:8080; - diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/order-api/service.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/order-api/service.yaml deleted file mode 100644 index 5d5aea31dcc37b171d7b1774413a4e2f5732f2f6..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/order-api/service.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: order-api -spec: - type: ClusterIP - selector: - app: order-api - ports: - - name: http - port: 31441 - targetPort: 8080 - - name: https - port: 8443 - targetPort: 8443 diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/proxy-monitor/deployment.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/proxy-monitor/deployment.yaml deleted file mode 100644 index 7cb9ad3f3b4786965f05c98a3eb613a4e8841a7b..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/proxy-monitor/deployment.yaml +++ /dev/null @@ -1,31 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: proxy-monitor - labels: - app: proxy-monitor -spec: - minReadySeconds: 60 - replicas: 1 - selector: - matchLabels: - app: proxy-monitor - strategy: - type: Recreate - template: - metadata: - labels: - app: proxy-monitor - spec: - containers: - - name: proxy-monitor - image: registry.cn-shenzhen.aliyuncs.com/project-workspace/proxy-monitor:1.0.5-alpha1 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 - - containerPort: 8443 - envFrom: - - configMapRef: - name: proxy-monitor-env - terminationGracePeriodSeconds: 180 \ No newline at end of file diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/proxy-monitor/kustomization.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/proxy-monitor/kustomization.yaml deleted file mode 100644 index 7eda7cf57723b6cac02c122146bea559905e70ae..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/proxy-monitor/kustomization.yaml +++ /dev/null @@ -1,18 +0,0 @@ -resources: -- deployment.yaml -- service.yaml - -generatorOptions: - disableNameSuffixHash: true - -configMapGenerator: -- name: proxy-monitor-env - literals: - - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES=true - - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES=true - - OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY=in_memory - - ASPNETCORE_FORWARDEDHEADERS_ENABLED=true - - OTEL_EXPORTER_OTLP_ENDPOINT=http://aspire-dashboard:18889 - - OTEL_SERVICE_NAME=proxy-monitor - - ASPNETCORE_URLS=http://+:8080; - diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/proxy-monitor/service.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/proxy-monitor/service.yaml deleted file mode 100644 index b98f60eb4a7a13e3b8c35a914a167866bdd67aea..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/proxy-monitor/service.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: proxy-monitor -spec: - type: ClusterIP - selector: - app: proxy-monitor - ports: - - name: http - port: 44430 - targetPort: 8080 - - name: https - port: 8443 - targetPort: 8443 diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/proxy-server/deployment.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/proxy-server/deployment.yaml deleted file mode 100644 index df0a426188b518507ac46039eb799f3c5c1a9a8a..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/proxy-server/deployment.yaml +++ /dev/null @@ -1,31 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: proxy-server - labels: - app: proxy-server -spec: - minReadySeconds: 60 - replicas: 1 - selector: - matchLabels: - app: proxy-server - strategy: - type: Recreate - template: - metadata: - labels: - app: proxy-server - spec: - containers: - - name: proxy-server - image: registry.cn-shenzhen.aliyuncs.com/project-workspace/proxy-server:1.0.5-alpha1 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 - - containerPort: 8443 - envFrom: - - configMapRef: - name: proxy-server-env - terminationGracePeriodSeconds: 180 \ No newline at end of file diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/proxy-server/kustomization.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/proxy-server/kustomization.yaml deleted file mode 100644 index be372580e4420769891851cddac8fba175ce2983..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/proxy-server/kustomization.yaml +++ /dev/null @@ -1,23 +0,0 @@ -resources: -- deployment.yaml -- service.yaml - -generatorOptions: - disableNameSuffixHash: true - -configMapGenerator: -- name: proxy-server-env - literals: - - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES=true - - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES=true - - OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY=in_memory - - ASPNETCORE_FORWARDEDHEADERS_ENABLED=true - - services__admin__http__0=http://admin:8080 - - services__auth-admin__http__0=http://auth-admin:8080 - - services__auth-sts__http__0=http://auth-sts:8080 - - services__auth-api__http__0=http://auth-api:8080 - - services__order-api__http__0=http://order-api:8080 - - OTEL_EXPORTER_OTLP_ENDPOINT=http://aspire-dashboard:18889 - - OTEL_SERVICE_NAME=proxy-server - - ASPNETCORE_URLS=http://+:8080; - diff --git a/build/DaprTool.Solution.AppHost/aspirate-output/proxy-server/service.yaml b/build/DaprTool.Solution.AppHost/aspirate-output/proxy-server/service.yaml deleted file mode 100644 index 222329f04eaa456d706f1f59a4984610197453e5..0000000000000000000000000000000000000000 --- a/build/DaprTool.Solution.AppHost/aspirate-output/proxy-server/service.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: proxy-server -spec: - type: ClusterIP - selector: - app: proxy-server - ports: - - name: http - port: 8080 - targetPort: 8080 - - name: https - port: 8443 - targetPort: 8443 diff --git a/build/DaprTool.Solution.AppHost/aspirate-state.json b/build/DaprTool.Solution.AppHost/aspirate-state.json index db47f1fda919adcb637e7eba5e70c469266a927c..04e60c573489953f5c33c9fd431f1753662b4432 100644 --- a/build/DaprTool.Solution.AppHost/aspirate-state.json +++ b/build/DaprTool.Solution.AppHost/aspirate-state.json @@ -4,13 +4,13 @@ "namespace": "dapr-playground", "containerRegistry": "registry.cn-shenzhen.aliyuncs.com", "containerImageTags": [ - "1.0.5-alpha1", + "1.0.12-alpha1", "latest" ], "imagePullPolicy": "IfNotPresent", "containerBuilder": "docker", "containerRepositoryPrefix": "project-workspace", - "outputFormat": "kustomize", + "outputFormat": "compose", "skipFinalKustomizeGeneration": false, "privateRegistryEmail": "aspir8@aka.ms", "includeDashboard": true, diff --git a/build/DaprTool.Solution.AppHost/aspirate.json b/build/DaprTool.Solution.AppHost/aspirate.json index 55d43af728feea5659125ec371fa8c687841c692..a964fe5bddb44bd212f60c0a4385242568164012 100644 --- a/build/DaprTool.Solution.AppHost/aspirate.json +++ b/build/DaprTool.Solution.AppHost/aspirate.json @@ -4,6 +4,7 @@ "Registry": "registry.cn-shenzhen.aliyuncs.com", "RepositoryPrefix": "project-workspace", "Tags": [ + "1.0.7-alpha1", "latest" ], "Builder": "docker" diff --git a/build/DaprTool.Solution.AppHost/manifest.json b/build/DaprTool.Solution.AppHost/manifest.json index 5ee701aedcf41622b2405101ba74c61d2d295fd7..de940a19519bb9e402c6937ad711d65e2a4dd21d 100644 --- a/build/DaprTool.Solution.AppHost/manifest.json +++ b/build/DaprTool.Solution.AppHost/manifest.json @@ -13,18 +13,14 @@ "http": { "scheme": "http", "protocol": "tcp", - "transport": "http" + "transport": "http", + "external": true }, "https": { "scheme": "https", "protocol": "tcp", - "transport": "http" - }, - "http": { - "scheme": "http", - "protocol": "tcp", "transport": "http", - "port": 51871 + "external": true } } }, @@ -34,7 +30,7 @@ "application": "admin", "appId": "admin", "daprHttpMaxRequestSize": 60, - "daprHttpPort": 12010, + "daprHttpPort": 23301, "daprHttpReadBufferSize": 128, "resourcesPath": [ "../../dapr/components" @@ -54,18 +50,14 @@ "http": { "scheme": "http", "protocol": "tcp", - "transport": "http" + "transport": "http", + "external": true }, "https": { "scheme": "https", "protocol": "tcp", - "transport": "http" - }, - "http": { - "scheme": "http", - "protocol": "tcp", "transport": "http", - "port": 52871 + "external": true } } }, @@ -75,7 +67,7 @@ "application": "auth-sts", "appId": "auth-sts", "daprHttpMaxRequestSize": 60, - "daprHttpPort": 12020, + "daprHttpPort": 23304, "daprHttpReadBufferSize": 128, "resourcesPath": [ "../../dapr/components" @@ -95,18 +87,14 @@ "http": { "scheme": "http", "protocol": "tcp", - "transport": "http" + "transport": "http", + "external": true }, "https": { "scheme": "https", "protocol": "tcp", - "transport": "http" - }, - "http": { - "scheme": "http", - "protocol": "tcp", "transport": "http", - "port": 53871 + "external": true } } }, @@ -116,7 +104,7 @@ "application": "auth-admin", "appId": "auth-admin", "daprHttpMaxRequestSize": 60, - "daprHttpPort": 12030, + "daprHttpPort": 23303, "daprHttpReadBufferSize": 128, "resourcesPath": [ "../../dapr/components" @@ -136,18 +124,14 @@ "http": { "scheme": "http", "protocol": "tcp", - "transport": "http" + "transport": "http", + "external": true }, "https": { "scheme": "https", "protocol": "tcp", - "transport": "http" - }, - "http": { - "scheme": "http", - "protocol": "tcp", "transport": "http", - "port": 54871 + "external": true } } }, @@ -157,14 +141,14 @@ "application": "auth-api", "appId": "auth-api", "daprHttpMaxRequestSize": 60, - "daprHttpPort": 12040, + "daprHttpPort": 23302, "daprHttpReadBufferSize": 128, "resourcesPath": [ "../../dapr/components" ] } }, - "order-api": { + "order": { "type": "project.v0", "path": "../../src/Services/Ordering/Presentation/Ordering.Api/Ordering.Api.csproj", "env": { @@ -177,28 +161,24 @@ "http": { "scheme": "http", "protocol": "tcp", - "transport": "http" + "transport": "http", + "external": true }, "https": { "scheme": "https", "protocol": "tcp", - "transport": "http" - }, - "http": { - "scheme": "http", - "protocol": "tcp", "transport": "http", - "port": 31441 + "external": true } } }, - "order-api-dapr": { + "order-dapr": { "type": "dapr.v0", "dapr": { - "application": "order-api", - "appId": "order-api", + "application": "order", + "appId": "order", "daprHttpMaxRequestSize": 60, - "daprHttpPort": 12050, + "daprHttpPort": 23305, "daprHttpReadBufferSize": 128, "resourcesPath": [ "../../dapr/components" @@ -221,19 +201,21 @@ "services__auth-sts__https__0": "{auth-sts.bindings.https.url}", "services__auth-api__http__0": "{auth-api.bindings.http.url}", "services__auth-api__https__0": "{auth-api.bindings.https.url}", - "services__order-api__http__0": "{order-api.bindings.http.url}", - "services__order-api__https__0": "{order-api.bindings.https.url}" + "services__order__http__0": "{order.bindings.http.url}", + "services__order__https__0": "{order.bindings.https.url}" }, "bindings": { "http": { "scheme": "http", "protocol": "tcp", - "transport": "http" + "transport": "http", + "external": true }, "https": { "scheme": "https", "protocol": "tcp", - "transport": "http" + "transport": "http", + "external": true } } } diff --git a/build/DaprTool.Solution.ServiceDefaults/Extensions.cs b/build/DaprTool.Solution.ServiceDefaults/Extensions.cs index b6e80000deac024fb6679426058017951f762856..1eb5e1e16500e93f67311582fceb6ff44af8c953 100644 --- a/build/DaprTool.Solution.ServiceDefaults/Extensions.cs +++ b/build/DaprTool.Solution.ServiceDefaults/Extensions.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Diagnostics.HealthChecks; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.ServiceDiscovery; using OpenTelemetry; using OpenTelemetry.Metrics; using OpenTelemetry.Trace; @@ -28,6 +29,12 @@ public static class Extensions http.AddServiceDiscovery(); }); + builder.Services.Configure(options => + { + options.AllowAllSchemes = true; + options.AllowedSchemes = ["https", "http"]; + }); + return builder; } diff --git a/build/aspirate-state.json b/build/aspirate-state.json new file mode 100644 index 0000000000000000000000000000000000000000..12e8b01b215ff4661b43fbe642416fde7766a857 --- /dev/null +++ b/build/aspirate-state.json @@ -0,0 +1,15 @@ +{ + "projectPath": ".", + "outputPath": "aspirate-output", + "containerImageTags": [ + "latest" + ], + "containerBuilder": "docker", + "outputFormat": "kustomize", + "privateRegistryEmail": "aspir8@aka.ms", + "secrets": { + "salt": "ehVft6Nfok4\u002BqKwF", + "hash": "DK2b5FoZgvZbMiIvg7zVq45iIkk08F\u002BRAZkUCQUYzIY=", + "secrets": {} + } +} \ No newline at end of file diff --git a/src/BuildingBlocks/Utils/Constant/Constants.cs b/src/BuildingBlocks/Utils/Constant/Constants.cs index 9c52cc973024f2cd1af28ad20ca3f6985beca4bd..76a8200b251707ed6cac061bfa8797decad66819 100644 --- a/src/BuildingBlocks/Utils/Constant/Constants.cs +++ b/src/BuildingBlocks/Utils/Constant/Constants.cs @@ -16,7 +16,7 @@ public static class Constants /// public const string ConfigurationStore = "dt-configurationstore"; /// - public static string DefaultActorId = "0"; + public static readonly string DefaultActorId = "0"; /// public const string ClusterSuffix = "Cluster"; /// @@ -26,21 +26,21 @@ public static class Constants /// public const string DaprServiceInvocation = "/v1.0/invoke/{0}/method{1}"; /// - public static DaprApp ProxyServer = new("proxy-server", 12001, 44440, 44444); + public static readonly DaprApp WebAdmin = new(AppId: "admin", DaprHttpPort: 23301, HttpPort: 24401, BasePath: "/admin"); /// - public static DaprApp WebAdmin = new("admin", 12010, 51871, 7273, "/admin"); + public static readonly DaprApp AuthApi = new(AppId: "auth-api", DaprHttpPort: 23302, HttpPort: 24402, BasePath: "/api/auth", Order: 95); /// - public static DaprApp AuthAdmin = new("auth-admin", 12030, 53871, 44303, "/auth/admin", 90); + public static readonly DaprApp AuthAdmin = new(AppId: "auth-admin", DaprHttpPort: 23303, HttpPort: 24403, BasePath: "/auth/admin", Order: 90); /// - public static DaprApp AuthApi = new("auth-api", 12040, 54871, 44302, "/api/auth", 95); + public static readonly DaprApp AuthSts = new(AppId: "auth-sts", DaprHttpPort: 23304, HttpPort: 24404, BasePath: "/auth"); /// - public static DaprApp AuthSts = new("auth-sts", 12020, 52871, 44310, "/auth"); + public static readonly DaprApp Ordering = new(AppId: "order", DaprHttpPort: 23305, HttpPort: 24405); /// - public static DaprApp Ordering = new("order-api", 12050, 31441, 5510); + public static readonly DaprApp Identity = new(AppId: "identity", DaprHttpPort: 23306, HttpPort: 24406); /// - public static DaprApp Identity = new("identity-api", 12060, 32441, 5520); + public static readonly DaprApp Catalog = new(AppId: "catalog", DaprHttpPort: 23307, HttpPort: 24407); /// - public static DaprApp Catalog = new("catalog-api", 12070, 33441, 5530); + public static readonly DaprApp ProxyServer = new(AppId: "proxy-server", DaprHttpPort: 23300, HttpPort: 24400); /// /// api 服务应用 ,Yarp 转发到 dapr cli 通过 dapr service invoke 调用 应用服务 diff --git a/src/BuildingBlocks/Utils/Utils.xml b/src/BuildingBlocks/Utils/Utils.xml index 953903c453d2e4b92f0e31d4cca8e6d8bba7a696..024ddec2d368b0fa7f2eb36c1c36f256398dcaa5 100644 --- a/src/BuildingBlocks/Utils/Utils.xml +++ b/src/BuildingBlocks/Utils/Utils.xml @@ -47,16 +47,13 @@ - - - - + - + @@ -71,6 +68,9 @@ + + + api 服务应用 ,Yarp 转发到 dapr cli 通过 dapr service invoke 调用 应用服务 diff --git a/src/BuildingBlocks/Utils/ValueObjects/DaprApp.cs b/src/BuildingBlocks/Utils/ValueObjects/DaprApp.cs index 911efda88966ff80f362ef332a8b2c6017025342..9d46d2880024defe9e8205238443de7d56075774 100644 --- a/src/BuildingBlocks/Utils/ValueObjects/DaprApp.cs +++ b/src/BuildingBlocks/Utils/ValueObjects/DaprApp.cs @@ -2,7 +2,7 @@ namespace DaprTool.BuildingBlocks.Utils.ValueObjects; -public record DaprApp(string AppId, int? DaprHttpPort, int? ResourceHttpPort, int? AppHttpsPort, string? BasePath = "", int? Order = 100) +public record DaprApp(string AppId, int? DaprHttpPort, int? HttpPort, string? BasePath = "", int? Order = 100) { public string? ResourceHttpsEndpoint => string.Concat(AppId, "-https"); public string? ResourceHttpEndpoint => string.Concat(AppId, "-http"); diff --git a/src/IdentityServer4/src/Idsrv4.Admin.Api/Properties/launchSettings.json b/src/IdentityServer4/src/Idsrv4.Admin.Api/Properties/launchSettings.json index 8eb5998e94a5bd06d32de3c2ab9ecd731a53327c..cb51a84c0d5aa4f4a6caa0dddb8a215c17ef9eba 100644 --- a/src/IdentityServer4/src/Idsrv4.Admin.Api/Properties/launchSettings.json +++ b/src/IdentityServer4/src/Idsrv4.Admin.Api/Properties/launchSettings.json @@ -1,14 +1,23 @@ { "$schema": "http://json.schemastore.org/launchsettings.json", "profiles": { + "http": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:24402", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, "https": { "commandName": "Project", "launchBrowser": true, "launchUrl": "swagger", + "applicationUrl": "https://localhost:25502;http://localhost:24402", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:44302" + } } } } \ 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 3be2da1939a57e8ce1144c0fc8686d65271842ad..06a8a13578dcc4bfadb666d22f400fa3f7de99a9 100644 --- a/src/IdentityServer4/src/Idsrv4.Admin.Api/appsettings.json +++ b/src/IdentityServer4/src/Idsrv4.Admin.Api/appsettings.json @@ -10,8 +10,8 @@ "AdminApiConfiguration": { "ApiName": "IdentityServer4 Admin Api", "ApiVersion": "v1", - "ApiBaseUrl": "https://localhost:44444/api/auth", - "IdentityServerBaseUrl": "https://localhost:44444/auth", + "ApiBaseUrl": "http://localhost:24400/api/auth", + "IdentityServerBaseUrl": "http://localhost:24400/auth", "OidcSwaggerUIClientId": "identity_admin_api_swaggerui", "OidcApiName": "identity_admin_api", "AdministrationRole": "Administrator", diff --git a/src/IdentityServer4/src/Idsrv4.Admin.STS.Identity/Properties/launchSettings.json b/src/IdentityServer4/src/Idsrv4.Admin.STS.Identity/Properties/launchSettings.json index 75510af9674c31242862e9706d7335e1da1b82e0..7fd1c52c3215d5314a907549961083e06ba43897 100644 --- a/src/IdentityServer4/src/Idsrv4.Admin.STS.Identity/Properties/launchSettings.json +++ b/src/IdentityServer4/src/Idsrv4.Admin.STS.Identity/Properties/launchSettings.json @@ -1,12 +1,20 @@ { "profiles": { + "http": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "http://localhost:24404", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, "https": { "commandName": "Project", "launchBrowser": true, + "applicationUrl": "https://localhost:25504;http://localhost:24404", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:44310" + } } } } \ No newline at end of file diff --git a/src/IdentityServer4/src/Idsrv4.Admin.STS.Identity/appsettings.json b/src/IdentityServer4/src/Idsrv4.Admin.STS.Identity/appsettings.json index 6f885bc4dd342dbf311b90f7d9a772f93b83ba69..f66eb0988c168ceec68be1d449f222be38cfcfd2 100644 --- a/src/IdentityServer4/src/Idsrv4.Admin.STS.Identity/appsettings.json +++ b/src/IdentityServer4/src/Idsrv4.Admin.STS.Identity/appsettings.json @@ -68,7 +68,7 @@ "CustomThemeCss": null, "IdentityAdminBasePath": "/auth/admin", "WebAdminBasePath": "/admin", - "ProxyServerUrl": "https://localhost:44444", + "ProxyServerUrl": "http://localhost:24400", "AdministrationRole": "Administrator" }, "CspTrustedDomains": [ diff --git a/src/IdentityServer4/src/Idsrv4.Admin/Idsrv4.Admin.csproj b/src/IdentityServer4/src/Idsrv4.Admin/Idsrv4.Admin.csproj index 589576c61929603e98cecaba78e36aef11fce534..a4f06eb9a4e65aaa3f84447b124f08edb7779054 100644 --- a/src/IdentityServer4/src/Idsrv4.Admin/Idsrv4.Admin.csproj +++ b/src/IdentityServer4/src/Idsrv4.Admin/Idsrv4.Admin.csproj @@ -36,7 +36,7 @@ - + diff --git a/src/IdentityServer4/src/Idsrv4.Admin/Properties/launchSettings.json b/src/IdentityServer4/src/Idsrv4.Admin/Properties/launchSettings.json index 0b02cb6c761069017406c0061d626139c9b127cc..e27c3c4b9b13a45bf90d1d38c27556059b44c3f7 100644 --- a/src/IdentityServer4/src/Idsrv4.Admin/Properties/launchSettings.json +++ b/src/IdentityServer4/src/Idsrv4.Admin/Properties/launchSettings.json @@ -1,12 +1,20 @@ { "profiles": { + "http": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "http://localhost:24403", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, "https": { "commandName": "Project", "launchBrowser": true, + "applicationUrl": "https://localhost:25503;http://localhost:24403", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:44303" + } } } } \ No newline at end of file diff --git a/src/IdentityServer4/src/Idsrv4.Admin/appsettings.json b/src/IdentityServer4/src/Idsrv4.Admin/appsettings.json index 3374c5bd78bfa49757e05e1bb7b16fe3497790bb..f1a6df3b21db0ede3e2df3835a94e51a3761b50d 100644 --- a/src/IdentityServer4/src/Idsrv4.Admin/appsettings.json +++ b/src/IdentityServer4/src/Idsrv4.Admin/appsettings.json @@ -22,7 +22,7 @@ "IdentityAdminRedirectPath": "/auth/admin/signin-oidc", "IdentityServerBasePath": "/auth", "WebAdminBasePath": "/admin", - "ProxyServerUrl": "https://localhost:44444", + "ProxyServerUrl": "http://localhost:24400", "IdentityAdminCookieName": "IdentityServerAdmin", "IdentityAdminCookieExpiresUtcHours": 12, "RequireHttpsMetadata": false, diff --git a/src/ProxyServer/Program.cs b/src/ProxyServer/Program.cs index 08821d9f937e62145b546b11621a6cc7e2cf1a88..d24e113a718ee73e3530b8abb999df38464b7d1a 100644 --- a/src/ProxyServer/Program.cs +++ b/src/ProxyServer/Program.cs @@ -34,7 +34,6 @@ var app = builder.Build(); app.UseMiddleware(); app.UseWebSockets(); -app.UseStaticFiles(); app.UseRouting(); app.UseAntiforgery(); app.MapDefaultEndpoints(); diff --git a/src/ProxyServer/Properties/launchSettings.json b/src/ProxyServer/Properties/launchSettings.json index 0d382ecb407c501356cc131534460995586d47d5..2a5863f806af9a2a6e79c53a92b8588add2445ad 100644 --- a/src/ProxyServer/Properties/launchSettings.json +++ b/src/ProxyServer/Properties/launchSettings.json @@ -1,11 +1,20 @@ { "$schema": "http://json.schemastore.org/launchsettings.json", "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:24400", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, "https": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - "applicationUrl": "https://localhost:44444", + "applicationUrl": "https://localhost:25500;http://localhost:24400", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/src/ProxyServer/ReverseProxyServiceCollectionExtensions.cs b/src/ProxyServer/ReverseProxyServiceCollectionExtensions.cs index 7d596a7b981b5db301161fccc78d3cb22d61c0cd..530f1ffd262d88434d90a0f3fe327f364eb85f1b 100644 --- a/src/ProxyServer/ReverseProxyServiceCollectionExtensions.cs +++ b/src/ProxyServer/ReverseProxyServiceCollectionExtensions.cs @@ -64,9 +64,8 @@ internal static class ReverseProxyServiceCollectionExtensions LoadBalancingPolicy = LoadBalancingPolicies.PowerOfTwoChoices, Destinations = new Dictionary(StringComparer.OrdinalIgnoreCase) { - { "destination1", new DestinationConfig() { Address = string.Concat("https://localhost:", x.AppHttpsPort) } }, + { "destination1", new DestinationConfig() { Address = string.Concat("http://localhost:", x.HttpPort) } }, { "destination2", new DestinationConfig() { Address = string.Concat("http://", x.AppId) } }, - { "destination3", new DestinationConfig() { Address = string.Concat("http://localhost:", x.ResourceHttpPort) } }, } }); diff --git a/src/Services/Ordering/Presentation/Ordering.Api/Properties/launchSettings.json b/src/Services/Ordering/Presentation/Ordering.Api/Properties/launchSettings.json index bc0a7acff19a9c69a3ce7df18bbed6f788c95bf2..0cb8087c6653a7204ffcaa9ddaf3c36208bdc275 100644 --- a/src/Services/Ordering/Presentation/Ordering.Api/Properties/launchSettings.json +++ b/src/Services/Ordering/Presentation/Ordering.Api/Properties/launchSettings.json @@ -1,13 +1,22 @@ { "profiles": { - "https": { + "http": { "commandName": "Project", "launchBrowser": true, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:24405", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - }, + } + }, + "https": { + "commandName": "Project", + "launchBrowser": true, "dotnetRunMessages": true, - "applicationUrl": "https://localhost:5510" + "applicationUrl": "https://localhost:25505;http://localhost:24405", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } } } } \ No newline at end of file diff --git a/src/Services/Ordering/Presentation/Ordering.Api/appsettings.json b/src/Services/Ordering/Presentation/Ordering.Api/appsettings.json index 57f2811b32bd33ce0dc31b608bf8f5e5615a37f7..27c7d852965a81e4b374665bc4606966c80d330e 100644 --- a/src/Services/Ordering/Presentation/Ordering.Api/appsettings.json +++ b/src/Services/Ordering/Presentation/Ordering.Api/appsettings.json @@ -10,9 +10,9 @@ } }, "ConnectionStrings": { - "catalog-api": "Server=192.168.8.112;Port=5432;Database=dapr_catalog;User Id=dapr;Password=Local@Db;Pooling=true;MaxPoolSize=100;", - "identity-api": "Server=192.168.8.112;Port=5432;Database=dapr_identity;User Id=dapr;Password=Local@Db;Pooling=true;MaxPoolSize=100;", - "order-api": "Server=192.168.8.112;Port=5432;Database=dapr_ordering;User Id=dapr;Password=Local@Db;Pooling=true;MaxPoolSize=100;" + "catalog": "Server=192.168.8.112;Port=5432;Database=dapr_catalog;User Id=dapr;Password=Local@Db;Pooling=true;MaxPoolSize=100;", + "identity": "Server=192.168.8.112;Port=5432;Database=dapr_identity;User Id=dapr;Password=Local@Db;Pooling=true;MaxPoolSize=100;", + "order": "Server=192.168.8.112;Port=5432;Database=dapr_ordering;User Id=dapr;Password=Local@Db;Pooling=true;MaxPoolSize=100;" }, "AllowedHosts": "*", "GracePeriodTime": "1", diff --git a/src/Web/WebAdmin/Program.cs b/src/Web/WebAdmin/Program.cs index f95acbb7c2a6aeb895b4b4ab9df8ebd32dce0576..b122158b2de09e98b4ce3b2070e17b84c2a56597 100644 --- a/src/Web/WebAdmin/Program.cs +++ b/src/Web/WebAdmin/Program.cs @@ -74,7 +74,7 @@ builder.Services.AddAuthentication(options => options.SaveTokens = true; options.GetClaimsFromUserInfoEndpoint = true; - + options.TokenValidationParameters = new TokenValidationParameters { NameClaimType = adminConfiguration.TokenValidationClaimName, @@ -83,6 +83,13 @@ builder.Services.AddAuthentication(options => options.Events = new OpenIdConnectEvents { + OnAuthenticationFailed = context => + { + Console.WriteLine(context.Exception?.Message); + Console.WriteLine(context.Exception?.InnerException?.Message); + + return Task.CompletedTask; + }, OnMessageReceived = context => { if (context.Properties is null) return Task.CompletedTask; @@ -123,7 +130,6 @@ builder.Services.AddAuthorization(options => options.FallbackPolicy = options.DefaultPolicy; }); - var app = builder.Build(); app.MapDefaultEndpoints(); @@ -150,11 +156,6 @@ forwardingOptions.KnownProxies.Clear(); app.UseForwardedHeaders(forwardingOptions); -app.UseXXssProtection(options => options.EnabledWithBlockMode()); -app.UseXContentTypeOptions(); -app.UseXfo(options => options.SameOrigin()); -app.UseReferrerPolicy(options => options.NoReferrer()); - #endregion app.UseStaticFiles(); @@ -210,4 +211,4 @@ app.MapRazorComponents() .AddInteractiveWebAssemblyRenderMode() .AddAdditionalAssemblies(typeof(_Imports).Assembly); -app.Run(); \ No newline at end of file +app.Run(); diff --git a/src/Web/WebAdmin/Properties/launchSettings.json b/src/Web/WebAdmin/Properties/launchSettings.json index 543b23e7ea0c6bedec1027c684716b14e66a2653..e86130c6a733f73b4deb327ec149dd8f543cecdf 100644 --- a/src/Web/WebAdmin/Properties/launchSettings.json +++ b/src/Web/WebAdmin/Properties/launchSettings.json @@ -1,15 +1,22 @@ { - "$schema": "http://json.schemastore.org/launchsettings.json", "profiles": { - "https": { + "http": { "commandName": "Project", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, "dotnetRunMessages": true, - "launchBrowser": false, - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "applicationUrl": "https://localhost:7273", + "applicationUrl": "http://localhost:24401" + }, + "https": { + "commandName": "Project", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "dotnetRunMessages": true, + "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", + "applicationUrl": "https://localhost:25501;http://localhost:24401" } - } + }, + "$schema": "http://json.schemastore.org/launchsettings.json" } \ No newline at end of file diff --git a/src/Web/WebAdmin/WebAdmin.csproj b/src/Web/WebAdmin/WebAdmin.csproj index dbc7198a35d65eb33e887402fb8d778b85af9e10..19100b8b8ae0389444a58be8b9b33e65f27e92fd 100644 --- a/src/Web/WebAdmin/WebAdmin.csproj +++ b/src/Web/WebAdmin/WebAdmin.csproj @@ -7,12 +7,11 @@ - + - @@ -20,9 +19,4 @@ - - - Designer - - diff --git a/src/Web/WebAdmin/appsettings.Development.json b/src/Web/WebAdmin/appsettings.Development.json index b8010ded613eb0b2e446a29aafce0c41ba968525..5198043f20b09cccefec9235460cbb9e2a13eab6 100644 --- a/src/Web/WebAdmin/appsettings.Development.json +++ b/src/Web/WebAdmin/appsettings.Development.json @@ -19,8 +19,8 @@ "AdminConfiguration": { "PageTitle": "管理后台", "FaviconUri": "~/favicon.ico", - "AdminRedirectUri": "https://localhost:44444/admin/signin-oidc", - "IdentityServerBaseUrl": "https://localhost:44444/auth", + "AdminRedirectUri": "http://localhost:24400/admin/signin-oidc", + "IdentityServerBaseUrl": "http://localhost:24400/auth", "AdminCookieName": "WebAdmin", "AdminCookieExpiresUtcHours": 12, "RequireHttpsMetadata": false,