From 0126377486257b96879624901948d0c1bc444478 Mon Sep 17 00:00:00 2001 From: cryptooda Date: Sun, 14 Dec 2025 00:16:25 +0700 Subject: [PATCH] Remove obsolete configuration files and project references from Managing.Aspire.AppHost and Managing.Aspire.ServiceDefaults --- .../Managing.Aspire.AppHost.csproj | 20 ---- src/Managing.Aspire.AppHost/Program.cs | 13 -- .../appsettings.Development.json | 8 -- .../appsettings.Oda.json | 26 ---- .../appsettings.ProdLocal.json | 19 --- src/Managing.Aspire.AppHost/appsettings.json | 9 -- .../Extensions.cs | 113 ------------------ .../Managing.Aspire.ServiceDefaults.csproj | 23 ---- 8 files changed, 231 deletions(-) delete mode 100644 src/Managing.Aspire.AppHost/Managing.Aspire.AppHost.csproj delete mode 100644 src/Managing.Aspire.AppHost/Program.cs delete mode 100644 src/Managing.Aspire.AppHost/appsettings.Development.json delete mode 100644 src/Managing.Aspire.AppHost/appsettings.Oda.json delete mode 100644 src/Managing.Aspire.AppHost/appsettings.ProdLocal.json delete mode 100644 src/Managing.Aspire.AppHost/appsettings.json delete mode 100644 src/Managing.Aspire.ServiceDefaults/Extensions.cs delete mode 100644 src/Managing.Aspire.ServiceDefaults/Managing.Aspire.ServiceDefaults.csproj diff --git a/src/Managing.Aspire.AppHost/Managing.Aspire.AppHost.csproj b/src/Managing.Aspire.AppHost/Managing.Aspire.AppHost.csproj deleted file mode 100644 index e7bf7802..00000000 --- a/src/Managing.Aspire.AppHost/Managing.Aspire.AppHost.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - Exe - net8.0 - enable - enable - true - 2d8fdbdd-b3e0-4716-8e00-56064804c76a - - - - - - - - - - - diff --git a/src/Managing.Aspire.AppHost/Program.cs b/src/Managing.Aspire.AppHost/Program.cs deleted file mode 100644 index cb327902..00000000 --- a/src/Managing.Aspire.AppHost/Program.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Projects; - -var builder = DistributedApplication.CreateBuilder(args); - -// Add API projects -var managingApi = builder.AddProject("managing-api"); - -// No need to add containers - your APIs will use their existing connection strings -// from their respective appsettings.json files - -// Connect services to resources - -builder.Build().Run(); \ No newline at end of file diff --git a/src/Managing.Aspire.AppHost/appsettings.Development.json b/src/Managing.Aspire.AppHost/appsettings.Development.json deleted file mode 100644 index 0c208ae9..00000000 --- a/src/Managing.Aspire.AppHost/appsettings.Development.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - } -} diff --git a/src/Managing.Aspire.AppHost/appsettings.Oda.json b/src/Managing.Aspire.AppHost/appsettings.Oda.json deleted file mode 100644 index 2416fa0f..00000000 --- a/src/Managing.Aspire.AppHost/appsettings.Oda.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "ManagingDatabase": { - "ConnectionString": "mongodb://localhost:27017", - "DatabaseName": "ManagingDb" - }, - "InfluxDb": { - "Url": "http://localhost:8086/", - "Organization": "managing-org", - "Token": "Fw2FPL2OwTzDHzSbR2Sd5xs0EKQYy00Q-hYKYAhr9cC1_q5YySONpxuf_Ck0PTjyUiF13xXmi__bu_pXH-H9zA==" - }, - "Privy": { - "AppId": "cm6f47n1l003jx7mjwaembhup", - "AppSecret": "63Chz2z5M8TgR5qc8dznSLRAGTHTyPU4cjdQobrBF1Cx5tszZpTuFgyrRd7hZ2k6HpwDz3GEwQZzsCqHb8Z311bF" - }, - "Discord": { - "ApplicationId": "", - "PublicKey": "", - "TokenId": "", - "SignalChannelId": 966080506473099314, - "TradesChannelId": 998374177763491851, - "TroublesChannelId": 1015761955321040917, - "RequestsChannelId": 1018589494968078356, - "ButtonExpirationMinutes": 2 - }, - "AllowedHosts": "*" -} \ No newline at end of file diff --git a/src/Managing.Aspire.AppHost/appsettings.ProdLocal.json b/src/Managing.Aspire.AppHost/appsettings.ProdLocal.json deleted file mode 100644 index 546af77b..00000000 --- a/src/Managing.Aspire.AppHost/appsettings.ProdLocal.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "ManagingDatabase": { - "ConnectionString": "mongodb://admin:r8oJiDIKbsEi@mongo-db.apps.managing.live:27017/?authMechanism=SCRAM-SHA-256", - "DatabaseName": "ManagingDb" - }, - "InfluxDb": { - "Url": "https://influx-db.apps.managing.live", - "Organization": "managing-org", - "Token": "eOuXcXhH7CS13Iw4CTiDDpRjIjQtEVPOloD82pLPOejI4n0BsEj1YzUw0g3Cs1mdDG5m-RaxCavCMsVTtS5wIQ==" - }, - "Privy": { - "AppId": "cm6f47n1l003jx7mjwaembhup", - "AppSecret": "63Chz2z5M8TgR5qc8dznSLRAGTHTyPU4cjdQobrBF1Cx5tszZpTuFgyrRd7hZ2k6HpwDz3GEwQZzsCqHb8Z311bF" - }, - "ElasticConfiguration": { - "Uri": "http://elasticsearch:9200" - }, - "AllowedHosts": "*" -} \ No newline at end of file diff --git a/src/Managing.Aspire.AppHost/appsettings.json b/src/Managing.Aspire.AppHost/appsettings.json deleted file mode 100644 index 31c092aa..00000000 --- a/src/Managing.Aspire.AppHost/appsettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning", - "Aspire.Hosting.Dcp": "Warning" - } - } -} diff --git a/src/Managing.Aspire.ServiceDefaults/Extensions.cs b/src/Managing.Aspire.ServiceDefaults/Extensions.cs deleted file mode 100644 index 229c194b..00000000 --- a/src/Managing.Aspire.ServiceDefaults/Extensions.cs +++ /dev/null @@ -1,113 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Diagnostics.HealthChecks; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Diagnostics.HealthChecks; -using Microsoft.Extensions.Logging; -using OpenTelemetry; -using OpenTelemetry.Metrics; -using OpenTelemetry.Trace; - -namespace Microsoft.Extensions.Hosting; - -// Adds common .NET Aspire services: service discovery, resilience, health checks, and OpenTelemetry. -// This project should be referenced by each service project in your solution. -// To learn more about using this project, see https://aka.ms/dotnet/aspire/service-defaults -public static class Extensions -{ - public static IHostApplicationBuilder AddServiceDefaults(this IHostApplicationBuilder builder) - { - builder.ConfigureOpenTelemetry(); - - builder.AddDefaultHealthChecks(); - - builder.Services.AddServiceDiscovery(); - - builder.Services.ConfigureHttpClientDefaults(http => - { - // Turn on resilience by default - http.AddStandardResilienceHandler(); - - // Turn on service discovery by default - http.AddServiceDiscovery(); - }); - - // Uncomment the following to restrict the allowed schemes for service discovery. - // builder.Services.Configure(options => - // { - // options.AllowedSchemes = ["https"]; - // }); - - return builder; - } - - public static IHostApplicationBuilder ConfigureOpenTelemetry(this IHostApplicationBuilder builder) - { - builder.Logging.AddOpenTelemetry(logging => - { - logging.IncludeFormattedMessage = true; - logging.IncludeScopes = true; - }); - - builder.Services.AddOpenTelemetry() - .WithMetrics(metrics => - { - metrics.AddAspNetCoreInstrumentation() - .AddHttpClientInstrumentation() - .AddRuntimeInstrumentation(); - }) - .WithTracing(tracing => - { - tracing.AddAspNetCoreInstrumentation() - // Uncomment the following line to enable gRPC instrumentation (requires the OpenTelemetry.Instrumentation.GrpcNetClient package) - //.AddGrpcClientInstrumentation() - .AddHttpClientInstrumentation(); - }); - - builder.AddOpenTelemetryExporters(); - - return builder; - } - - private static IHostApplicationBuilder AddOpenTelemetryExporters(this IHostApplicationBuilder builder) - { - var useOtlpExporter = !string.IsNullOrWhiteSpace(builder.Configuration["OTEL_EXPORTER_OTLP_ENDPOINT"]); - - if (useOtlpExporter) - { - builder.Services.AddOpenTelemetry().UseOtlpExporter(); - } - - // Uncomment the following lines to enable the Azure Monitor exporter (requires the Azure.Monitor.OpenTelemetry.AspNetCore package) - //if (!string.IsNullOrEmpty(builder.Configuration["APPLICATIONINSIGHTS_CONNECTION_STRING"])) - //{ - // builder.Services.AddOpenTelemetry() - // .UseAzureMonitor(); - //} - - return builder; - } - - public static IHostApplicationBuilder AddDefaultHealthChecks(this IHostApplicationBuilder builder) - { - builder.Services.AddHealthChecks() - // Add a default liveness check to ensure app is responsive - .AddCheck("self", () => HealthCheckResult.Healthy(), ["live"]); - - return builder; - } - - public static WebApplication MapDefaultEndpoints(this WebApplication app) - { - // Health check endpoints are now available in all environments - // All health checks must pass for app to be considered ready to accept traffic after starting - app.MapHealthChecks("/health"); - - // Only health checks tagged with the "live" tag must pass for app to be considered alive - app.MapHealthChecks("/alive", new HealthCheckOptions - { - Predicate = r => r.Tags.Contains("live") - }); - - return app; - } -} \ No newline at end of file diff --git a/src/Managing.Aspire.ServiceDefaults/Managing.Aspire.ServiceDefaults.csproj b/src/Managing.Aspire.ServiceDefaults/Managing.Aspire.ServiceDefaults.csproj deleted file mode 100644 index 5875533b..00000000 --- a/src/Managing.Aspire.ServiceDefaults/Managing.Aspire.ServiceDefaults.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - net8.0 - enable - enable - true - - - - - - - - - - - - - - - -