diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 2ecaebc..d027baf 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -20,5 +20,5 @@ jobs: - name: Restore dependencies run: dotnet restore - name: Build - run: dotnet build --no-restore + run: dotnet build -c Release --no-restore diff --git a/deployments/docker-compose/docker-compose.yaml b/deployments/docker-compose/docker-compose.yaml index e2f1632..8d1381e 100644 --- a/deployments/docker-compose/docker-compose.yaml +++ b/deployments/docker-compose/docker-compose.yaml @@ -16,7 +16,7 @@ services: - "5001:80" - "5000:443" depends_on: - - db + - sql - rabbitmq - jaeger - elasticsearch @@ -47,7 +47,7 @@ services: - 5004:80 - 5003:443 depends_on: - - db + - sql - rabbitmq - jaeger - elasticsearch @@ -79,7 +79,7 @@ services: - 6005:80 - 5005:443 depends_on: - - db + - sql - rabbitmq - jaeger - elasticsearch @@ -110,7 +110,7 @@ services: - 6012:80 - 5012:443 depends_on: - - db + - sql - rabbitmq - jaeger - elasticsearch @@ -142,10 +142,10 @@ services: - 6010:80 - 5010:443 depends_on: - - db + - sql - rabbitmq - jaeger - - eventstore.db + - eventstore - elasticsearch - kibana - mongo @@ -163,8 +163,8 @@ services: ####################################################### # SqlServer ####################################################### - db: - container_name: sqldb + sql: + container_name: sql image: mcr.microsoft.com/mssql/server:2022-latest restart: unless-stopped ports: @@ -196,8 +196,8 @@ services: # Rabbitmq ####################################################### rabbitmq: - image: rabbitmq:3-management container_name: rabbitmq + image: rabbitmq:3-management restart: unless-stopped ports: - 5672:5672 @@ -228,7 +228,8 @@ services: ####################################################### # EventStoreDB ####################################################### - eventstore.db: + eventstore: + container_name: eventstore image: eventstore/eventstore:21.2.0-buster-slim restart: on-failure environment: @@ -251,7 +252,7 @@ services: # Mongo ####################################################### mongo: - image: mongo:4 + image: mongo:5 container_name: mongo restart: unless-stopped # environment: @@ -261,9 +262,6 @@ services: - booking ports: - 27017:27017 - volumes: - - mongo:/data/db - ####################################################### # Elastic Search @@ -310,8 +308,6 @@ networks: volumes: db-data: external: false - mongo: - driver: local elasticsearch-data: diff --git a/deployments/docker-compose/infrastracture.yaml b/deployments/docker-compose/infrastracture.yaml index 2558920..f14c7d0 100644 --- a/deployments/docker-compose/infrastracture.yaml +++ b/deployments/docker-compose/infrastracture.yaml @@ -5,8 +5,8 @@ services: # Rabbitmq ####################################################### rabbitmq: - image: rabbitmq:3-management container_name: rabbitmq + image: rabbitmq:3-management restart: unless-stopped ports: - 5672:5672 @@ -18,8 +18,8 @@ services: ####################################################### # SqlServer ####################################################### - db: - container_name: sqldb + sql: + container_name: sql image: mcr.microsoft.com/mssql/server:2022-latest restart: unless-stopped ports: @@ -50,8 +50,8 @@ services: # Jaeger ####################################################### jaeger: - image: jaegertracing/all-in-one container_name: jaeger + image: jaegertracing/all-in-one restart: unless-stopped networks: - booking @@ -68,7 +68,8 @@ services: ####################################################### # EventStoreDB ####################################################### - eventstore.db: + eventstore: + container_name: eventstore image: eventstore/eventstore:21.2.0-buster-slim restart: on-failure environment: @@ -91,7 +92,7 @@ services: # Mongo ####################################################### mongo: - image: mongo:4 + image: mongo:5 container_name: mongo restart: unless-stopped # environment: @@ -101,8 +102,6 @@ services: - booking ports: - 27017:27017 - volumes: - - mongo:/data/db ####################################################### @@ -162,8 +161,6 @@ networks: volumes: db-data: external: false - mongo: - driver: local elasticsearch-data: diff --git a/src/BuildingBlocks/BuildingBlocks.csproj b/src/BuildingBlocks/BuildingBlocks.csproj index 61fca02..252ed49 100644 --- a/src/BuildingBlocks/BuildingBlocks.csproj +++ b/src/BuildingBlocks/BuildingBlocks.csproj @@ -8,31 +8,31 @@ - - - - + + + + - - + + - + - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + @@ -44,36 +44,37 @@ - + - + - + - - - + + + - + - + - + + - + - + @@ -83,23 +84,24 @@ - + - - - - - - - - + + + + + + + + - - + + + @@ -121,28 +123,27 @@ - + - - - - + + + - - - + + + - + - - - + + + diff --git a/src/BuildingBlocks/HealthCheck/Extensions.cs b/src/BuildingBlocks/HealthCheck/Extensions.cs index 86f14ee..fb43c9c 100644 --- a/src/BuildingBlocks/HealthCheck/Extensions.cs +++ b/src/BuildingBlocks/HealthCheck/Extensions.cs @@ -16,6 +16,10 @@ public static class Extensions { public static IServiceCollection AddCustomHealthCheck(this IServiceCollection services) { + var healthOptions = services.GetOptions(nameof(HealthOptions)); + + if (!healthOptions.Enabled) return services; + var appOptions = services.GetOptions(nameof(AppOptions)); var sqlOptions = services.GetOptions(nameof(DatabaseOptions)); var rabbitMqOptions = services.GetOptions(nameof(RabbitMqOptions)); @@ -23,7 +27,9 @@ public static class Extensions var logOptions = services.GetOptions(nameof(LogOptions)); var healthChecksBuilder = services.AddHealthChecks() - .AddRabbitMQ(rabbitConnectionString: $"amqp://{rabbitMqOptions.UserName}:{rabbitMqOptions.Password}@{rabbitMqOptions.HostName}") + .AddRabbitMQ( + rabbitConnectionString: + $"amqp://{rabbitMqOptions.UserName}:{rabbitMqOptions.Password}@{rabbitMqOptions.HostName}") .AddElasticsearch(logOptions.Elastic.ElasticServiceUrl); if (mongoOptions.ConnectionString is not null) @@ -43,6 +49,10 @@ public static class Extensions public static WebApplication UseCustomHealthCheck(this WebApplication app) { + var healthOptions = app.Configuration.GetOptions(nameof(HealthOptions)); + + if (!healthOptions.Enabled) return app; + app.UseHealthChecks("/healthz", new HealthCheckOptions { diff --git a/src/BuildingBlocks/HealthCheck/HealthOptions.cs b/src/BuildingBlocks/HealthCheck/HealthOptions.cs new file mode 100644 index 0000000..7b98301 --- /dev/null +++ b/src/BuildingBlocks/HealthCheck/HealthOptions.cs @@ -0,0 +1,6 @@ +namespace BuildingBlocks.HealthCheck; + +public class HealthOptions +{ + public bool Enabled { get; set; } = true; +} diff --git a/src/BuildingBlocks/Logging/ElasticOptions.cs b/src/BuildingBlocks/Logging/ElasticOptions.cs index 26fbc87..5c57758 100644 --- a/src/BuildingBlocks/Logging/ElasticOptions.cs +++ b/src/BuildingBlocks/Logging/ElasticOptions.cs @@ -2,7 +2,7 @@ public class ElasticOptions { - public bool Enable { get; set; } + public bool Enabled { get; set; } public string ElasticServiceUrl { get; set; } public string ElasticSearchIndex { get; set; } -} \ No newline at end of file +} diff --git a/src/BuildingBlocks/Logging/Extensions.cs b/src/BuildingBlocks/Logging/Extensions.cs index 825b70a..5fa1288 100644 --- a/src/BuildingBlocks/Logging/Extensions.cs +++ b/src/BuildingBlocks/Logging/Extensions.cs @@ -38,7 +38,7 @@ namespace BuildingBlocks.Logging .Enrich.FromLogContext() .ReadFrom.Configuration(context.Configuration); - if (logOptions.Elastic is { Enable: true }) + if (logOptions.Elastic is { Enabled: true }) { loggerConfiguration.WriteTo.Elasticsearch( new ElasticsearchSinkOptions(new Uri(logOptions.Elastic.ElasticServiceUrl)) @@ -48,7 +48,26 @@ namespace BuildingBlocks.Logging }); } - if (logOptions.File is { Enable: true }) + + if (logOptions?.Sentry is {Enabled: true}) + { + var minimumBreadcrumbLevel = Enum.TryParse(logOptions.Level, true, out var minBreadcrumbLevel) + ? minBreadcrumbLevel + : LogEventLevel.Information; + + var minimumEventLevel = Enum.TryParse(logOptions.Sentry.MinimumEventLevel, true, out var minEventLevel) + ? minEventLevel + : LogEventLevel.Error; + + loggerConfiguration.WriteTo.Sentry(o => + { + o.Dsn = logOptions.Sentry.Dsn; + o.MinimumBreadcrumbLevel = minimumBreadcrumbLevel; + o.MinimumEventLevel = minimumEventLevel; + }); + } + + if (logOptions.File is { Enabled: true }) { var root = env.ContentRootPath; Directory.CreateDirectory(Path.Combine(root, "logs")); diff --git a/src/BuildingBlocks/Logging/FileOptions.cs b/src/BuildingBlocks/Logging/FileOptions.cs index d3021a8..223e824 100644 --- a/src/BuildingBlocks/Logging/FileOptions.cs +++ b/src/BuildingBlocks/Logging/FileOptions.cs @@ -2,7 +2,7 @@ public class FileOptions { - public bool Enable { get; set; } + public bool Enabled { get; set; } public string Path { get; set; } public string Interval { get; set; } -} \ No newline at end of file +} diff --git a/src/BuildingBlocks/Logging/LogOptions.cs b/src/BuildingBlocks/Logging/LogOptions.cs index 763ae45..c7d880d 100644 --- a/src/BuildingBlocks/Logging/LogOptions.cs +++ b/src/BuildingBlocks/Logging/LogOptions.cs @@ -4,7 +4,9 @@ { public string Level { get; set; } public ElasticOptions Elastic { get; set; } + + public SentryOptions Sentry { get; set; } public FileOptions File { get; set; } public string LogTemplate { get; set; } } -} \ No newline at end of file +} diff --git a/src/BuildingBlocks/Logging/SentryOptions.cs b/src/BuildingBlocks/Logging/SentryOptions.cs new file mode 100644 index 0000000..3b036d2 --- /dev/null +++ b/src/BuildingBlocks/Logging/SentryOptions.cs @@ -0,0 +1,9 @@ +namespace BuildingBlocks.Logging; + +public class SentryOptions +{ + public bool Enabled { get; set; } + public string Dsn { get; set; } + public string MinimumBreadcrumbLevel { get; set; } + public string MinimumEventLevel { get; set; } +} diff --git a/src/BuildingBlocks/PersistMessageProcessor/Data/DesignTimeDbContextFactory.cs b/src/BuildingBlocks/PersistMessageProcessor/Data/DesignTimeDbContextFactory.cs index 91a4279..6d0ae2f 100644 --- a/src/BuildingBlocks/PersistMessageProcessor/Data/DesignTimeDbContextFactory.cs +++ b/src/BuildingBlocks/PersistMessageProcessor/Data/DesignTimeDbContextFactory.cs @@ -9,8 +9,7 @@ public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory(); - builder.UseSqlServer( - "Data Source=.\\sqlexpress;Initial Catalog=PersistMessageDB;Persist Security Info=False;Integrated Security=SSPI;TrustServerCertificate=True"); + builder.UseSqlServer("Server=localhost;Database=PersistMessageDB;User ID=sa;Password=@Aa123456;TrustServerCertificate=True"); return new PersistMessageDbContext(builder.Options); } } diff --git a/src/BuildingBlocks/Swagger/ServiceCollectionExtensions.cs b/src/BuildingBlocks/Swagger/ServiceCollectionExtensions.cs index f032b99..cc96b21 100644 --- a/src/BuildingBlocks/Swagger/ServiceCollectionExtensions.cs +++ b/src/BuildingBlocks/Swagger/ServiceCollectionExtensions.cs @@ -5,6 +5,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; +using Unchase.Swashbuckle.AspNetCore.Extensions.Extensions; namespace BuildingBlocks.Swagger; @@ -17,7 +18,7 @@ public static class ServiceCollectionExtensions // https://github.com/dotnet/aspnet-api-versioning/tree/88323136a97a59fcee24517a514c1a445530c7e2/examples/AspNetCore/WebApi/MinimalOpenApiExample public static IServiceCollection AddCustomSwagger(this IServiceCollection services, IConfiguration configuration, - Assembly assembly) + params Assembly[] assemblies) { // https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis/openapi services.AddEndpointsApiExplorer(); @@ -31,9 +32,14 @@ public static class ServiceCollectionExtensions { options.OperationFilter(); - var xmlFile = XmlCommentsFilePath(assembly); - if (File.Exists(xmlFile)) options.IncludeXmlComments(xmlFile); + foreach (var assembly in assemblies) + { + var xmlFile = XmlCommentsFilePath(assembly); + if (File.Exists(xmlFile)) options.IncludeXmlComments(xmlFile); + } + + options.AddEnumsWithValuesFixFilters(); options.AddSecurityRequirement(new OpenApiSecurityRequirement { diff --git a/src/BuildingBlocks/TestBase/TestContainers.cs b/src/BuildingBlocks/TestBase/TestContainers.cs index 19ef810..72826ed 100644 --- a/src/BuildingBlocks/TestBase/TestContainers.cs +++ b/src/BuildingBlocks/TestBase/TestContainers.cs @@ -48,7 +48,7 @@ public static class TestContainers Username = Guid.NewGuid().ToString("D"), Password = Guid.NewGuid().ToString("D"), }) - .WithImage("mongo:4") + .WithImage("mongo:5") .WithCleanUp(true) .Build(); diff --git a/src/Services/Booking/src/Booking.Api/appsettings.docker.json b/src/Services/Booking/src/Booking.Api/appsettings.docker.json index 06769cf..1c95bd3 100644 --- a/src/Services/Booking/src/Booking.Api/appsettings.docker.json +++ b/src/Services/Booking/src/Booking.Api/appsettings.docker.json @@ -9,7 +9,7 @@ "PersistMessageOptions": { "Interval": 30, "Enabled": true, - "ConnectionString": "Server=db;Database=PersistMessageDB;User ID=sa;Password=@Aa123456" + "ConnectionString": "Server=sql;Database=PersistMessageDB;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" }, "RabbitMqOptions": { "HostName": "rabbitmq", diff --git a/src/Services/Booking/src/Booking.Api/appsettings.json b/src/Services/Booking/src/Booking.Api/appsettings.json index a794e5e..da3ee97 100644 --- a/src/Services/Booking/src/Booking.Api/appsettings.json +++ b/src/Services/Booking/src/Booking.Api/appsettings.json @@ -6,13 +6,19 @@ "Level": "information", "LogTemplate": "{Timestamp:HH:mm:ss} [{Level:u4}] {Message:lj}{NewLine}{Exception}", "Elastic": { - "Enable": true, + "Enabled": true, "ElasticServiceUrl": "http://localhost:9200" }, "File": { - "enable": false, - "path": "logs/logs.txt", - "interval": "day" + "Enabled": false, + "Path": "logs/logs.txt", + "Interval": "day" + }, + "Sentry": { + "Enabled": false, + "Dsn": "", + "MinimumBreadcrumbLevel": "information", + "MinimumEventLevel":"error" } }, "Jwt": { @@ -37,10 +43,13 @@ "ConnectionString": "mongodb://localhost:27017", "DatabaseName": "booking-db" }, + "HealthOptions": { + "Enabled": false + }, "PersistMessageOptions": { "Interval": 30, "Enabled": true, - "ConnectionString": "Server=.\\sqlexpress;Database=PersistMessageDB;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" + "ConnectionString": "Server=localhost;Database=PersistMessageDB;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" }, "AllowedHosts": "*" } diff --git a/src/Services/Booking/src/Booking.Api/appsettings.test.json b/src/Services/Booking/src/Booking.Api/appsettings.test.json index cb72535..088abe0 100644 --- a/src/Services/Booking/src/Booking.Api/appsettings.test.json +++ b/src/Services/Booking/src/Booking.Api/appsettings.test.json @@ -24,6 +24,6 @@ "PersistMessageOptions": { "Interval": 30, "Enabled": true, - "ConnectionString": "Server=.\\sqlexpress;Database=PersistMessageDB_Test;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" + "ConnectionString": "Server=localhost;Database=PersistMessageDB_Test;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" } } diff --git a/src/Services/Booking/src/Booking/Booking.csproj b/src/Services/Booking/src/Booking/Booking.csproj index 704b1db..856bc39 100644 --- a/src/Services/Booking/src/Booking/Booking.csproj +++ b/src/Services/Booking/src/Booking/Booking.csproj @@ -6,7 +6,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Services/Booking/tests/IntegrationTest/Integration.Test.csproj b/src/Services/Booking/tests/IntegrationTest/Integration.Test.csproj index 3eadc6e..c21a265 100644 --- a/src/Services/Booking/tests/IntegrationTest/Integration.Test.csproj +++ b/src/Services/Booking/tests/IntegrationTest/Integration.Test.csproj @@ -12,18 +12,9 @@ - - - + - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - + diff --git a/src/Services/Flight/src/Flight.Api/appsettings.docker.json b/src/Services/Flight/src/Flight.Api/appsettings.docker.json index 3e97e65..bfc897b 100644 --- a/src/Services/Flight/src/Flight.Api/appsettings.docker.json +++ b/src/Services/Flight/src/Flight.Api/appsettings.docker.json @@ -7,7 +7,7 @@ } }, "DatabaseOptions": { - "DefaultConnection": "Server=db;Database=FlightDB;User ID=sa;Password=@Aa123456" + "DefaultConnection": "Server=sql;Database=FlightDB;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" }, "Jwt": { "Authority": "https://localhost:5005", @@ -23,7 +23,7 @@ "PersistMessageOptions": { "Interval": 30, "Enabled": true, - "ConnectionString": "Server=db;Database=PersistMessageDB;User ID=sa;Password=@Aa123456" + "ConnectionString": "Server=sql;Database=PersistMessageDB;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" }, "AllowedHosts": "*" } diff --git a/src/Services/Flight/src/Flight.Api/appsettings.json b/src/Services/Flight/src/Flight.Api/appsettings.json index 4b77b07..43ca496 100644 --- a/src/Services/Flight/src/Flight.Api/appsettings.json +++ b/src/Services/Flight/src/Flight.Api/appsettings.json @@ -6,17 +6,23 @@ "Level": "information", "LogTemplate": "{Timestamp:HH:mm:ss} [{Level:u4}] {Message:lj}{NewLine}{Exception}", "Elastic": { - "Enable": true, + "Enabled": true, "ElasticServiceUrl": "http://localhost:9200" }, "File": { - "enable": false, - "path": "logs/logs.txt", - "interval": "day" + "Enabled": false, + "Path": "logs/logs.txt", + "Interval": "day" + }, + "Sentry": { + "Enabled": false, + "Dsn": "", + "MinimumBreadcrumbLevel": "information", + "MinimumEventLevel": "error" } }, "DatabaseOptions": { - "DefaultConnection": "Server=.\\sqlexpress;Database=FlightDB;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" + "DefaultConnection": "Server=localhost;Database=FlightDB;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" }, "MongoOptions": { "ConnectionString": "mongodb://localhost:27017", @@ -36,7 +42,10 @@ "PersistMessageOptions": { "Interval": 30, "Enabled": true, - "ConnectionString": "Server=.\\sqlexpress;Database=PersistMessageDB;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" + "ConnectionString": "Server=localhost;Database=PersistMessageDB;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" + }, + "HealthOptions": { + "Enabled": false }, "AllowedHosts": "*" } diff --git a/src/Services/Flight/src/Flight.Api/appsettings.test.json b/src/Services/Flight/src/Flight.Api/appsettings.test.json index c78fbb4..d1d3a72 100644 --- a/src/Services/Flight/src/Flight.Api/appsettings.test.json +++ b/src/Services/Flight/src/Flight.Api/appsettings.test.json @@ -1,6 +1,6 @@ { "DatabaseOptions": { - "DefaultConnection": "Server=.\\sqlexpress;Database=FlightDB_Test;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" + "DefaultConnection": "Server=localhost;Database=FlightDB_Test;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" }, "RabbitMqOptions": { "HostName": "localhost", @@ -20,6 +20,6 @@ "PersistMessageOptions": { "Interval": 2, "Enabled": true, - "ConnectionString": "Server=.\\sqlexpress;Database=PersistMessageDB_Test;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" + "ConnectionString": "Server=localhost;Database=PersistMessageDB_Test;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" } } diff --git a/src/Services/Flight/src/Flight/Data/DesignTimeDbContextFactory.cs b/src/Services/Flight/src/Flight/Data/DesignTimeDbContextFactory.cs index bc85b4c..3c9559b 100644 --- a/src/Services/Flight/src/Flight/Data/DesignTimeDbContextFactory.cs +++ b/src/Services/Flight/src/Flight/Data/DesignTimeDbContextFactory.cs @@ -9,7 +9,7 @@ namespace Flight.Data { var builder = new DbContextOptionsBuilder(); - builder.UseSqlServer("Data Source=.\\sqlexpress;Initial Catalog=FlightDB;Persist Security Info=False;Integrated Security=SSPI;TrustServerCertificate=True"); + builder.UseSqlServer("Server=localhost;Database=FlightDB;User ID=sa;Password=@Aa123456;TrustServerCertificate=True"); return new FlightDbContext(builder.Options, null); } } diff --git a/src/Services/Flight/src/Flight/Flight.csproj b/src/Services/Flight/src/Flight/Flight.csproj index 23644c6..7523afd 100644 --- a/src/Services/Flight/src/Flight/Flight.csproj +++ b/src/Services/Flight/src/Flight/Flight.csproj @@ -5,9 +5,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Services/Flight/tests/EndToEndTest/EndToEnd.Test.csproj b/src/Services/Flight/tests/EndToEndTest/EndToEnd.Test.csproj index 64d526d..ae8780f 100644 --- a/src/Services/Flight/tests/EndToEndTest/EndToEnd.Test.csproj +++ b/src/Services/Flight/tests/EndToEndTest/EndToEnd.Test.csproj @@ -15,18 +15,9 @@ - - - + - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - + diff --git a/src/Services/Flight/tests/IntegrationTest/Integration.Test.csproj b/src/Services/Flight/tests/IntegrationTest/Integration.Test.csproj index ca1ce89..1807978 100644 --- a/src/Services/Flight/tests/IntegrationTest/Integration.Test.csproj +++ b/src/Services/Flight/tests/IntegrationTest/Integration.Test.csproj @@ -12,18 +12,9 @@ - - - + - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - + diff --git a/src/Services/Flight/tests/UnitTest/Unit.Test.csproj b/src/Services/Flight/tests/UnitTest/Unit.Test.csproj index 47357b0..1807978 100644 --- a/src/Services/Flight/tests/UnitTest/Unit.Test.csproj +++ b/src/Services/Flight/tests/UnitTest/Unit.Test.csproj @@ -12,14 +12,9 @@ - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - + + + diff --git a/src/Services/Identity/src/Identity.Api/appsettings.docker.json b/src/Services/Identity/src/Identity.Api/appsettings.docker.json index f05529b..5243321 100644 --- a/src/Services/Identity/src/Identity.Api/appsettings.docker.json +++ b/src/Services/Identity/src/Identity.Api/appsettings.docker.json @@ -1,12 +1,12 @@ { "App": "Identity-Service", "DatabaseOptions": { - "DefaultConnection": "Server=db;Database=IdentityDB;User ID=sa;Password=@Aa123456" + "DefaultConnection": "Server=sql;Database=IdentityDB;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" }, "PersistMessageOptions": { "Interval": 30, "Enabled": true, - "ConnectionString": "Server=db;Database=PersistMessageDB;User ID=sa;Password=@Aa123456" + "ConnectionString": "Server=sql;Database=PersistMessageDB;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" }, "RabbitMqOptions": { "HostName": "rabbitmq", diff --git a/src/Services/Identity/src/Identity.Api/appsettings.json b/src/Services/Identity/src/Identity.Api/appsettings.json index b76b8e3..894d814 100644 --- a/src/Services/Identity/src/Identity.Api/appsettings.json +++ b/src/Services/Identity/src/Identity.Api/appsettings.json @@ -3,7 +3,7 @@ "Name": "Identity-Service" }, "DatabaseOptions": { - "DefaultConnection": "Server=.\\sqlexpress;Database=IdentityDB;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" + "DefaultConnection": "Server=localhost;Database=IdentityDB;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" }, "RabbitMqOptions": { "HostName": "localhost", @@ -20,19 +20,28 @@ "Level": "information", "LogTemplate": "{Timestamp:HH:mm:ss} [{Level:u4}] {Message:lj}{NewLine}{Exception}", "Elastic": { - "Enable": true, + "Enabled": true, "ElasticServiceUrl": "http://localhost:9200" }, "File": { - "enable": false, - "path": "logs/logs.txt", - "interval": "day" + "Enabled": false, + "Path": "logs/logs.txt", + "Interval": "day" + }, + "Sentry": { + "Enabled": false, + "Dsn": "", + "MinimumBreadcrumbLevel": "information", + "MinimumEventLevel":"error" } }, + "HealthOptions": { + "Enabled": false + }, "PersistMessageOptions": { "Interval": 30, "Enabled": true, - "ConnectionString": "Server=.\\sqlexpress;Database=PersistMessageDB;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" + "ConnectionString": "Server=localhost;Database=PersistMessageDB;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" }, "AllowedHosts": "*" } diff --git a/src/Services/Identity/src/Identity.Api/appsettings.test.json b/src/Services/Identity/src/Identity.Api/appsettings.test.json index 08307a2..3d40033 100644 --- a/src/Services/Identity/src/Identity.Api/appsettings.test.json +++ b/src/Services/Identity/src/Identity.Api/appsettings.test.json @@ -1,6 +1,6 @@ { "DatabaseOptions": { - "DefaultConnection": "Server=.\\sqlexpress;Database=IdentityDB_Test;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" + "DefaultConnection": "Server=localhost;Database=IdentityDB_Test;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" }, "RabbitMqOptions": { "HostName": "localhost", @@ -20,6 +20,6 @@ "PersistMessageOptions": { "Interval": 30, "Enabled": true, - "ConnectionString": "Server=.\\sqlexpress;Database=PersistMessageDB_Test;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" + "ConnectionString": "Server=localhost;Database=PersistMessageDB_Test;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" } } diff --git a/src/Services/Identity/src/Identity/Data/DesignTimeDbContextFactory.cs b/src/Services/Identity/src/Identity/Data/DesignTimeDbContextFactory.cs index 007590a..f7dc16a 100644 --- a/src/Services/Identity/src/Identity/Data/DesignTimeDbContextFactory.cs +++ b/src/Services/Identity/src/Identity/Data/DesignTimeDbContextFactory.cs @@ -9,7 +9,7 @@ public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory(); - builder.UseSqlServer("Server=.\\sqlexpress;Database=IdentityDB;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True"); + builder.UseSqlServer("Server=localhost;Database=IdentityDB;User ID=sa;Password=@Aa123456;TrustServerCertificate=True"); return new IdentityContext(builder.Options, null); } } diff --git a/src/Services/Identity/tests/IntegrationTest/Integration.Test.csproj b/src/Services/Identity/tests/IntegrationTest/Integration.Test.csproj index c552b88..5cefc2e 100644 --- a/src/Services/Identity/tests/IntegrationTest/Integration.Test.csproj +++ b/src/Services/Identity/tests/IntegrationTest/Integration.Test.csproj @@ -12,18 +12,9 @@ - - - + - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - + diff --git a/src/Services/Passenger/src/Passenger.Api/appsettings.docker.json b/src/Services/Passenger/src/Passenger.Api/appsettings.docker.json index 2af01bc..d76441c 100644 --- a/src/Services/Passenger/src/Passenger.Api/appsettings.docker.json +++ b/src/Services/Passenger/src/Passenger.Api/appsettings.docker.json @@ -1,12 +1,13 @@ { "App": "Passenger-Service", "DatabaseOptions": { - "DefaultConnection": "Server=db;Database=PassengerDB;User ID=sa;Password=@Aa123456" + + "DefaultConnection": "Server=sql;Database=PassengerDB;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" }, "PersistMessageOptions": { "Interval": 30, "Enabled": true, - "ConnectionString": "Server=db;Database=PersistMessageDB;User ID=sa;Password=@Aa123456" + "ConnectionString": "Server=sql;Database=PersistMessageDB;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" }, "Jwt": { "Authority": "https://localhost:5005", diff --git a/src/Services/Passenger/src/Passenger.Api/appsettings.json b/src/Services/Passenger/src/Passenger.Api/appsettings.json index d7cbb30..8099f02 100644 --- a/src/Services/Passenger/src/Passenger.Api/appsettings.json +++ b/src/Services/Passenger/src/Passenger.Api/appsettings.json @@ -3,7 +3,7 @@ "Name": "Passenger-Service" }, "DatabaseOptions": { - "DefaultConnection": "Server=.\\sqlexpress;Database=PassengerDB;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" + "DefaultConnection": "Server=localhost;Database=PassengerDB;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" }, "MongoOptions": { "ConnectionString": "mongodb://localhost:27017", @@ -24,19 +24,28 @@ "Level": "information", "LogTemplate": "{Timestamp:HH:mm:ss} [{Level:u4}] {Message:lj}{NewLine}{Exception}", "Elastic": { - "Enable": true, + "Enabled": true, "ElasticServiceUrl": "http://localhost:9200" }, "File": { - "enable": false, - "path": "logs/logs.txt", - "interval": "day" + "Enabled": false, + "Path": "logs/logs.txt", + "Interval": "day" + }, + "Sentry": { + "Enabled": false, + "Dsn": "", + "MinimumBreadcrumbLevel": "information", + "MinimumEventLevel":"error" } }, + "HealthOptions": { + "Enabled": false + }, "PersistMessageOptions": { "Interval": 30, "Enabled": true, - "ConnectionString": "Server=.\\sqlexpress;Database=PersistMessageDB;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" + "ConnectionString": "Server=localhost;Database=PersistMessageDB;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" }, "AllowedHosts": "*" } diff --git a/src/Services/Passenger/src/Passenger.Api/appsettings.test.json b/src/Services/Passenger/src/Passenger.Api/appsettings.test.json index 194eb82..71ea34c 100644 --- a/src/Services/Passenger/src/Passenger.Api/appsettings.test.json +++ b/src/Services/Passenger/src/Passenger.Api/appsettings.test.json @@ -1,6 +1,6 @@ { "DatabaseOptions": { - "DefaultConnection": "Server=.\\sqlexpress;Database=PassengerDB;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" + "DefaultConnection": "Server=localhost;Database=PassengerDB_Test;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" }, "RabbitMqOptions": { "HostName": "localhost", @@ -20,6 +20,6 @@ "PersistMessageOptions": { "Interval": 30, "Enabled": true, - "ConnectionString": "Server=.\\sqlexpress;Database=PersistMessageDB_Test;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True" + "ConnectionString": "Server=localhost;Database=PersistMessageDB_Test;User ID=sa;Password=@Aa123456;TrustServerCertificate=True" } } diff --git a/src/Services/Passenger/src/Passenger/Data/DesignTimeDbContextFactory.cs b/src/Services/Passenger/src/Passenger/Data/DesignTimeDbContextFactory.cs index e875be8..950e3c2 100644 --- a/src/Services/Passenger/src/Passenger/Data/DesignTimeDbContextFactory.cs +++ b/src/Services/Passenger/src/Passenger/Data/DesignTimeDbContextFactory.cs @@ -9,8 +9,7 @@ public class DesignTimeDbContextFactory: IDesignTimeDbContextFactory(); - builder.UseSqlServer( - "Data Source=.\\sqlexpress;Initial Catalog=PassengerDB;Persist Security Info=False;Integrated Security=SSPI;TrustServerCertificate=True"); + builder.UseSqlServer("Server=localhost;Database=PassengerDB;User ID=sa;Password=@Aa123456;TrustServerCertificate=True"); return new PassengerDbContext(builder.Options, null); } } diff --git a/src/Services/Passenger/src/Passenger/Passenger.csproj b/src/Services/Passenger/src/Passenger/Passenger.csproj index 5080fe6..8e10d56 100644 --- a/src/Services/Passenger/src/Passenger/Passenger.csproj +++ b/src/Services/Passenger/src/Passenger/Passenger.csproj @@ -6,7 +6,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Services/Passenger/tests/IntegrationTest/Integration.Test.csproj b/src/Services/Passenger/tests/IntegrationTest/Integration.Test.csproj index 9d636b2..f96ccb9 100644 --- a/src/Services/Passenger/tests/IntegrationTest/Integration.Test.csproj +++ b/src/Services/Passenger/tests/IntegrationTest/Integration.Test.csproj @@ -12,18 +12,9 @@ - - - + - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - +