-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #155 from TomaszKandula/dev
merge: dev to master
- Loading branch information
Showing
48 changed files
with
576 additions
and
174 deletions.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
...Sender.WebApi/Configuration/CorsPolicy.cs → ...ender.Backend.Configuration/CorsPolicy.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...der.WebApi/Configuration/DockerSupport.cs → ...er.Backend.Configuration/DockerSupport.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...Sender.Backend/EmailSender.Backend.Configuration/EmailSender.Backend.Configuration.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<LangVersion>10</LangVersion> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.9.0" /> | ||
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" /> | ||
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="10.0.1" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.26" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.26" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.1.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="6.0.26" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.26"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="Microsoft.Extensions.Caching.Redis" Version="2.2.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="6.0.26" /> | ||
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.35.0" /> | ||
<PackageReference Include="Polly" Version="8.2.1" /> | ||
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" /> | ||
<PackageReference Include="Serilog.Sinks.AzureBlobStorage" Version="3.2.0" /> | ||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" /> | ||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.5.0" /> | ||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.35.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\EmailSender.Backend.Core\EmailSender.Backend.Core.csproj" /> | ||
<ProjectReference Include="..\EmailSender.Backend.Shared\EmailSender.Backend.Shared.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
31 changes: 31 additions & 0 deletions
31
EmailSender.Backend/EmailSender.Backend.Configuration/HealthCheckSupport.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using Microsoft.AspNetCore.Diagnostics.HealthChecks; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.Extensions.Diagnostics.HealthChecks; | ||
using Newtonsoft.Json; | ||
|
||
namespace EmailSender.Backend.Configuration; | ||
|
||
public static class HealthCheckSupport | ||
{ | ||
public static HealthCheckOptions WriteResponse() | ||
{ | ||
return new HealthCheckOptions | ||
{ | ||
ResponseWriter = async (context, report) => | ||
{ | ||
var result = new | ||
{ | ||
status = report.Status.ToString(), | ||
errors = report.Entries.Select(pair | ||
=> new | ||
{ | ||
key = pair.Key, | ||
value = Enum.GetName(typeof(HealthStatus), pair.Value.Status) | ||
}) | ||
}; | ||
context.Response.ContentType = "application/json"; | ||
await context.Response.WriteAsync(JsonConvert.SerializeObject(result)); | ||
} | ||
}; | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
...Api/Configuration/Logger/Configuration.cs → ...end.Configuration/Logger/Configuration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
EmailSender.Backend/EmailSender.Backend.Configuration/PollySupport.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace EmailSender.Backend.Configuration; | ||
|
||
[ExcludeFromCodeCoverage] | ||
public static class PollySupport | ||
{ | ||
public static void SetupRetryPolicyWithPolly(IServiceCollection services) | ||
{ | ||
services.AddHttpClient("RetryHttpClient", options => | ||
{ | ||
options.DefaultRequestHeaders.Add("Accept", "application/json"); | ||
options.Timeout = TimeSpan.FromMinutes(5); | ||
options.DefaultRequestHeaders.ConnectionClose = true; | ||
}).AddPolicyHandler(PollyPolicyHandler.SetupRetry()); | ||
} | ||
} |
5 changes: 4 additions & 1 deletion
5
...er.WebApi/Configuration/SwaggerSupport.cs → ...r.Backend.Configuration/SwaggerSupport.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_connect_timeout 90; | ||
proxy_send_timeout 90; | ||
proxy_read_timeout 90; | ||
proxy_buffering off; | ||
proxy_cache_valid 200 30m; | ||
proxy_cache_valid 404 1m; |
19 changes: 0 additions & 19 deletions
19
EmailSender.Persistence/EmailSender.Persistence.Database/Initializer/DbInitializer.cs
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
EmailSender.Persistence/EmailSender.Persistence.Database/Initializer/IDbInitialize.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.