Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c11535ebfc | ||
|
|
129d10c7d1 |
@@ -44,6 +44,7 @@
|
||||
<Using Include="Microsoft.Extensions.Logging" />
|
||||
<Using Include="Microsoft.Extensions.Options" />
|
||||
<Using Include="Microsoft.IdentityModel.Tokens" />
|
||||
<Using Include="Microsoft.FeatureManagement" />
|
||||
|
||||
<!-- Domain Constants -->
|
||||
<Using Static="true" Include="PostFundManagement.Domain.Extensions.Constants" />
|
||||
|
||||
+56
-55
@@ -12,67 +12,68 @@
|
||||
<PackageVersion Include="Scrutor" Version="7.0.0" />
|
||||
|
||||
<!-- Microsoft Extensions & Configuration -->
|
||||
<PackageVersion Include="Microsoft.Extensions.Caching.Hybrid" Version="10.10.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="10.10.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Validation" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.FeatureManagement.AspNetCore" Version="4.7.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Caching.Hybrid" Version="10.11.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="10.11.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Validation" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.FeatureManagement.AspNetCore" Version="4.8.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.14" />
|
||||
|
||||
<!-- Security, Authentication & Identity -->
|
||||
<PackageVersion Include="AccessTokenClient.Extensions" Version="5.1.0" />
|
||||
<PackageVersion Include="Duende.AccessTokenManagement" Version="4.2.0" />
|
||||
<PackageVersion Include="Duende.AccessTokenManagement.OpenIdConnect" Version="4.2.0" />
|
||||
<PackageVersion Include="Duende.AccessTokenManagement" Version="4.3.0" />
|
||||
<PackageVersion Include="Duende.AccessTokenManagement.OpenIdConnect" Version="4.3.0" />
|
||||
<PackageVersion Include="IdentityModel" Version="6.2.0" />
|
||||
<PackageVersion Include="IdentityModel.AspNetCore" Version="4.3.0" />
|
||||
<PackageVersion Include="IdentityModel.AspNetCore.OAuth2introspection" Version="6.2.0" />
|
||||
<PackageVersion Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
|
||||
<PackageVersion Include="KubernetesClient" Version="19.0.2" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Certificate" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="10.0.12" />
|
||||
<PackageVersion Include="KubernetesClient" Version="21.0.8" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Certificate" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="10.0.14" />
|
||||
|
||||
<!-- Upgraded to latest non-vulnerable version -->
|
||||
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="10.0.13" />
|
||||
<PackageVersion Include="System.Security.Cryptography.Xml" Version="10.0.13" />
|
||||
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="10.0.14" />
|
||||
<PackageVersion Include="System.Security.Cryptography.Xml" Version="10.0.14" />
|
||||
|
||||
<!-- Resilience -->
|
||||
<PackageVersion Include="Polly" Version="8.8.0" />
|
||||
<PackageVersion Include="Polly.Extensions" Version="8.8.0" />
|
||||
<PackageVersion Include="Polly" Version="8.8.1" />
|
||||
<PackageVersion Include="Polly.Extensions" Version="8.8.1" />
|
||||
|
||||
<!-- API, Web & Documentation -->
|
||||
<PackageVersion Include="Asp.Versioning.Abstractions" Version="10.2.1" />
|
||||
<PackageVersion Include="Asp.Versioning.Http" Version="10.2.3" />
|
||||
<PackageVersion Include="Asp.Versioning.Mvc.ApiExplorer" Version="10.2.1" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.OutputCaching.StackExchangeRedis" Version="10.0.12" />
|
||||
<PackageVersion Include="Refit.HttpClientFactory" Version="15.2.0" />
|
||||
<PackageVersion Include="Scalar.AspNetCore" Version="2.17.4" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.OutputCaching.StackExchangeRedis" Version="10.0.14" />
|
||||
<PackageVersion Include="Refit.HttpClientFactory" Version="16.4.0" />
|
||||
<PackageVersion Include="Scalar.AspNetCore" Version="2.18.3" />
|
||||
|
||||
<!-- Database & Entity Framework Core -->
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Abstractions" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Analyzers" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.12" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Abstractions" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Analyzers" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.14" />
|
||||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.14" />
|
||||
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.3" />
|
||||
|
||||
<!-- Quartz Scheduler -->
|
||||
<PackageVersion Include="Quartz" Version="4.1.0" />
|
||||
<PackageVersion Include="Quartz.AspNetCore" Version="4.1.0" />
|
||||
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="4.1.0" />
|
||||
<PackageVersion Include="Quartz.Plugins" Version="4.1.0" />
|
||||
<PackageVersion Include="Quartz.Plugins.TimeZoneConverter" Version="4.1.0" />
|
||||
<PackageVersion Include="Quartz.Serialization.SystemTextJson" Version="4.1.0" />
|
||||
<PackageVersion Include="Quartz" Version="4.6.2" />
|
||||
<PackageVersion Include="Quartz.AspNetCore" Version="4.6.2" />
|
||||
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="4.6.2" />
|
||||
<PackageVersion Include="Quartz.Plugins" Version="4.6.2" />
|
||||
<PackageVersion Include="Quartz.Plugins.TimeZoneConverter" Version="4.6.2" />
|
||||
<PackageVersion Include="Quartz.Serialization.SystemTextJson" Version="4.6.2" />
|
||||
|
||||
<!-- Health Checks -->
|
||||
<PackageVersion Include="AspNetCore.HealthChecks.NpgSql" Version="9.0.0" />
|
||||
@@ -83,17 +84,17 @@
|
||||
<PackageVersion Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="9.0.0" />
|
||||
|
||||
<!-- Observability & OpenTelemetry -->
|
||||
<PackageVersion Include="OpenTelemetry" Version="1.18.0" />
|
||||
<PackageVersion Include="OpenTelemetry.Exporter.Console" Version="1.18.0" />
|
||||
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.18.0" />
|
||||
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.18.0" />
|
||||
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.18.0" />
|
||||
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.18.0" />
|
||||
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.18.0" />
|
||||
<PackageVersion Include="OpenTelemetry" Version="1.20.1" />
|
||||
<PackageVersion Include="OpenTelemetry.Exporter.Console" Version="1.20.1" />
|
||||
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.20.1" />
|
||||
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.20.1" />
|
||||
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.20.1" />
|
||||
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.20.1" />
|
||||
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.20.1" />
|
||||
|
||||
<!-- Email & Messaging -->
|
||||
<PackageVersion Include="MailKit" Version="4.18.0" />
|
||||
<PackageVersion Include="MimeKit" Version="4.18.0" />
|
||||
<PackageVersion Include="MailKit" Version="4.18.2" />
|
||||
<PackageVersion Include="MimeKit" Version="4.18.2" />
|
||||
|
||||
<!-- CQRS & Mediator -->
|
||||
<PackageVersion Include="FluentResults" Version="4.0.0" />
|
||||
@@ -101,17 +102,17 @@
|
||||
<PackageVersion Include="Mediator.SourceGenerator" Version="3.0.2" />
|
||||
|
||||
<!-- Cloud Storage -->
|
||||
<PackageVersion Include="AWSSDK.Extensions.NetCore.Setup" Version="4.0.101.4" />
|
||||
<PackageVersion Include="AWSSDK.S3" Version="4.0.103.3" />
|
||||
<PackageVersion Include="AWSSDK.Extensions.NetCore.Setup" Version="4.0.102.7" />
|
||||
<PackageVersion Include="AWSSDK.S3" Version="4.0.104.7" />
|
||||
|
||||
<!-- Analyzers -->
|
||||
<PackageVersion Include="Meziantou.Analyzer" Version="3.0.259" />
|
||||
<PackageVersion Include="Meziantou.Analyzer" Version="3.0.317" />
|
||||
|
||||
<!-- Testing -->
|
||||
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
|
||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
|
||||
<PackageVersion Include="coverlet.collector" Version="10.1.0" />
|
||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.11.0" />
|
||||
<PackageVersion Include="xunit" Version="2.9.3" />
|
||||
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.4" />
|
||||
<PackageVersion Include="xunit.runner.visualstudio" Version="4.0.1" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions;
|
||||
using PostFundManagement.Domain.Health;
|
||||
using PostFundManagement.Domain.Mediator;
|
||||
using PostFundManagement.Infrastructure.Database.Services;
|
||||
using static PostFundManagement.Domain.Extensions.Constants;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
@@ -45,7 +44,7 @@ builder.Services.AddSkorubaApiService(builder.Configuration);
|
||||
builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(TelemetryPipelineBehavior<,>));
|
||||
builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(LoggingPipelineBehavior<,>));
|
||||
|
||||
builder.Services.AddQuartzScheduler(DefaultSchedulerName, builder.Configuration);
|
||||
builder.Services.AddQuartzSchedulerClient(DefaultSchedulerName, builder.Configuration);
|
||||
builder.Services.AddEmailServices(builder.Configuration);
|
||||
builder.Services.AddHashServices(builder.Configuration);
|
||||
builder.Services.AddGarageS3(builder.Configuration);
|
||||
@@ -119,7 +118,9 @@ builder.Services.AddCors(options =>
|
||||
policy.SetIsOriginAllowed(origin =>
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(origin)) return false;
|
||||
|
||||
var clean = origin.TrimEnd('/');
|
||||
|
||||
if (allowedOrigins.Any(a => string.Equals(a.TrimEnd('/'), clean, StringComparison.OrdinalIgnoreCase)))
|
||||
return true;
|
||||
|
||||
@@ -133,10 +134,7 @@ builder.Services.AddCors(options =>
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignore parse failure
|
||||
}
|
||||
catch { /* eat all exceptions */ }
|
||||
|
||||
return false;
|
||||
})
|
||||
|
||||
@@ -31,14 +31,7 @@
|
||||
"Microsoft.EntityFrameworkCore.Database": "Error",
|
||||
"Microsoft.EntityFrameworkCore.Update": "Error"
|
||||
}
|
||||
},
|
||||
"EmailProcessorCron": "0 */5 * * * ?",
|
||||
"Email": {
|
||||
"SmtpServer": "smtp.example.com",
|
||||
"SmtpPort": 587,
|
||||
"SenderEmail": "noreply@example.com",
|
||||
"SenderName": "Example"
|
||||
},
|
||||
},
|
||||
"HasherSettings": {
|
||||
"MinHashLength": 11
|
||||
},
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
using System.Reflection;
|
||||
using System.Security.Claims;
|
||||
using System.Text.Json;
|
||||
using Castle.DynamicProxy;
|
||||
using FluentResults;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using PostFundManagement.Application.Services.Shared;
|
||||
using PostFundManagement.Domain.Attributes;
|
||||
|
||||
|
||||
@@ -9,4 +9,6 @@ public sealed class SmtpSettings
|
||||
public string? Host { get; set; }
|
||||
|
||||
public bool UseSsl { get; set; }
|
||||
|
||||
public string? ProcessorJobCron { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using PostFundManagement.Domain.Abstractions;
|
||||
|
||||
namespace PostFundManagement.Infrastructure.Database.Services;
|
||||
|
||||
public sealed class HeadlessTenantContextService : ITenantContextService
|
||||
{
|
||||
public string? TenantName => "Ifri Technologies";
|
||||
|
||||
public long TenantId => 1;
|
||||
|
||||
public bool ByPassTenantQueryFilter { get; set; } = true;
|
||||
|
||||
public bool IsAdmin => true;
|
||||
|
||||
public bool HasTenantFilter => true;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
# Stage 1: Runtime base
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
|
||||
USER app
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
|
||||
# Stage 2: Build & Restore
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# Copy props and csproj files for layer caching
|
||||
COPY ["Directory.Build.props", "./"]
|
||||
COPY ["Directory.Packages.props", "./"]
|
||||
COPY ["PostFundManagement.snk", "./"]
|
||||
COPY ["LICENSE", "./"]
|
||||
COPY ["PostFundManagement.Jobs/PostFundManagement.Jobs.csproj", "PostFundManagement.Jobs/"]
|
||||
COPY ["PostFundManagement.Application/PostFundManagement.Application.csproj", "PostFundManagement.Application/"]
|
||||
COPY ["PostFundManagement.Domain/PostFundManagement.Domain.csproj", "PostFundManagement.Domain/"]
|
||||
COPY ["PostFundManagement.Infrastructure/PostFundManagement.Infrastructure.csproj", "PostFundManagement.Infrastructure/"]
|
||||
|
||||
# Restore packages
|
||||
RUN dotnet restore "PostFundManagement.Jobs/PostFundManagement.Jobs.csproj"
|
||||
|
||||
# Copy full source code
|
||||
COPY . .
|
||||
|
||||
# Build from the project folder using relative filename
|
||||
WORKDIR "/src/PostFundManagement.Jobs"
|
||||
RUN dotnet build "PostFundManagement.Jobs.csproj" -c Release -o /app/build
|
||||
|
||||
# Stage 3: Publish
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "PostFundManagement.Jobs.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||
|
||||
# Stage 4: Final Runtime
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "PostFundManagement.Jobs.dll"]
|
||||
@@ -0,0 +1,21 @@
|
||||
using PostFundManagement.Domain.Abstractions;
|
||||
|
||||
namespace PostFundManagement.Jobs;
|
||||
|
||||
public class JobsWorker(IJobOrchestrator jobOrchestrator, IFeatureManager featureManager,
|
||||
ILogger<JobsWorker> logger) : BackgroundService
|
||||
{
|
||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||
{
|
||||
if(!await featureManager.IsEnabledAsync(nameof(JobsWorker)))
|
||||
{
|
||||
logger.LogInformation("JobsWorker is disabled.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: scheduler reccuring jobs
|
||||
|
||||
logger.LogInformation("JobsWorker is stopping.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Worker">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UserSecretsId>dotnet-PostFundManagement.Jobs-97b98845-fddb-4212-b877-8dac9f7f86e3</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- File Nesting -->
|
||||
<ItemGroup>
|
||||
<ProjectCapability Include="ConfigurableFileNesting" />
|
||||
<ProjectCapability Include="ConfigurableFileNestingFeatureEnabled" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- CQRS Source Generator -->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Mediator.SourceGenerator">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PostFundManagement.Application\PostFundManagement.Application.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,38 @@
|
||||
using PostFundManagement.Application.Extensions;
|
||||
using PostFundManagement.Domain.Abstractions;
|
||||
using PostFundManagement.Domain.Mediator;
|
||||
using PostFundManagement.Infrastructure.Database.Services;
|
||||
using PostFundManagement.Jobs;
|
||||
|
||||
var builder = Host.CreateApplicationBuilder(args);
|
||||
|
||||
builder.Services.AddFeatureManagement();
|
||||
|
||||
builder.Services.AddSharedServices();
|
||||
builder.Services.AddHostedService<JobsWorker>();
|
||||
builder.Services.AddRegisterServicesWithCaching(builder.Configuration);
|
||||
builder.Services.AddEndpointAndServiceCaching(builder.Configuration);
|
||||
builder.Services.AddTransient<ITenantContextService, HeadlessTenantContextService>();
|
||||
|
||||
builder.Services.AddMediator();
|
||||
builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(TelemetryPipelineBehavior<,>));
|
||||
builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(LoggingPipelineBehavior<,>));
|
||||
|
||||
builder.Services.AddQuartzScheduler(DefaultSchedulerName, builder.Configuration);
|
||||
builder.Services.AddEmailServices(builder.Configuration);
|
||||
builder.Services.AddHashServices(builder.Configuration);
|
||||
builder.Services.AddGarageS3(builder.Configuration);
|
||||
|
||||
builder.Services.AddHttpClient();
|
||||
builder.Services.AddDataProtectionDatabase(builder.Configuration);
|
||||
builder.Services.AddApplicationDbContext(builder.Configuration);
|
||||
|
||||
var host = builder.Build();
|
||||
|
||||
var schedulerFactory = host.Services.GetRequiredService<ISchedulerFactory>();
|
||||
var scheduler = await schedulerFactory.GetScheduler();
|
||||
|
||||
if (scheduler!.Status != SchedulerStatus.Running)
|
||||
await scheduler.Start();
|
||||
|
||||
host.Run();
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/launchsettings.json",
|
||||
"profiles": {
|
||||
"PostFundManagement.Jobs": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"environmentVariables": {
|
||||
"DOTNET_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"FeatureManagement": {
|
||||
"JobsWorker": true,
|
||||
"EmailProcessorJobEnabled": true,
|
||||
"ServiceCaching": false
|
||||
},
|
||||
"GeneralS3Settings": {
|
||||
"ServiceUrl": "https://s3.garage.khongisa.co.za",
|
||||
"Region": "garage",
|
||||
"BucketName": "pfm",
|
||||
"CdnBaseUrl": "https://pfm.cdn.khongisa.co.za"
|
||||
},
|
||||
"Monitoring": {
|
||||
"Address": "http://aspire-dashboard-service.aspire.svc.cluster.local:18889",
|
||||
"ServiceName": "Pfm.Jobs.DEV"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Warning",
|
||||
"Quartz": "Error",
|
||||
"Microsoft.AspNetCore": "Warning",
|
||||
"Microsoft.EntityFrameworkCore.Database": "Error",
|
||||
"Microsoft.EntityFrameworkCore.Update": "Error"
|
||||
}
|
||||
},
|
||||
"Email": {
|
||||
"ProcessorJobCron": "0 */5 * * * ?",
|
||||
"SmtpServer": "smtp.example.com",
|
||||
"SmtpPort": 587,
|
||||
"SenderEmail": "noreply@example.com",
|
||||
"SenderName": "Example"
|
||||
},
|
||||
"HasherSettings": {
|
||||
"MinHashLength": 11
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
+12
-5
@@ -1,4 +1,13 @@
|
||||
<Solution>
|
||||
<Folder Name="/Presentation/">
|
||||
<Project Path="PostFundManagement.Api/PostFundManagement.Api.csproj" />
|
||||
<Project Path="PostFundManagement.Jobs/PostFundManagement.Jobs.csproj" Id="81281806-b5ca-4784-87af-3e8feeac988c" />
|
||||
</Folder>
|
||||
<Folder Name="/Shared/">
|
||||
<Project Path="PostFundManagement.Application/PostFundManagement.Application.csproj" Id="750c7754-53a7-4573-abed-5c436246a04d" />
|
||||
<Project Path="PostFundManagement.Domain/PostFundManagement.Domain.csproj" />
|
||||
<Project Path="PostFundManagement.Infrastructure/PostFundManagement.Infrastructure.csproj" />
|
||||
</Folder>
|
||||
<Folder Name="/Solution Items/">
|
||||
<File Path=".editorconfig" />
|
||||
<File Path=".gitignore" />
|
||||
@@ -9,9 +18,7 @@
|
||||
<File Path="PostFundManagement.snk" />
|
||||
<File Path="README.md" />
|
||||
</Folder>
|
||||
<Project Path="PostFundManagement.Api/PostFundManagement.Api.csproj" />
|
||||
<Project Path="PostFundManagement.Application/PostFundManagement.Application.csproj" Id="750c7754-53a7-4573-abed-5c436246a04d" />
|
||||
<Project Path="PostFundManagement.Domain/PostFundManagement.Domain.csproj" />
|
||||
<Project Path="PostFundManagement.Infrastructure/PostFundManagement.Infrastructure.csproj" />
|
||||
<Project Path="PostFundManagement.Tests/PostFundManagement.Tests.csproj" Id="ce650d27-8a68-436d-b5c1-db25f2286e85" />
|
||||
<Folder Name="/Tests/">
|
||||
<Project Path="PostFundManagement.Tests/PostFundManagement.Tests.csproj" Id="ce650d27-8a68-436d-b5c1-db25f2286e85" />
|
||||
</Folder>
|
||||
</Solution>
|
||||
|
||||
+52
-11
@@ -1,4 +1,55 @@
|
||||
services:
|
||||
pfm-scheduler:
|
||||
image: pfm-scheduler
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./PostFundManagement.Jobs/Dockerfile
|
||||
network: host
|
||||
container_name: pfm-scheduler
|
||||
environment:
|
||||
# Service layer caching feature flag
|
||||
- FeatureManagement__JobsWorker=${FEATURE_JOBS_WORKER:-true}}
|
||||
- FeatureManagement__EmailProcessorJobEnabled=${FEATURE_EMAIL_PROCESSOR_JOB_ENABLED:-true}}
|
||||
- FeatureManagement__ServiceCaching=${FEATURE_SERVICE_CACHING:-false}}
|
||||
|
||||
# Header forwarding overrides
|
||||
- DOTNET_ENVIRONMENT=${ENVIRONMENT:-Development}
|
||||
|
||||
# Postgres Database Overrides
|
||||
- ConnectionStrings__PfmDatabase=Server=${POSTGRES_HOST:-192.168.1.170};Port=${POSTGRES_PORT:-5432};Database=${POSTGRES_DB:-pfm};User Id=${POSTGRES_USER:-pfm-user};Password=${POSTGRES_PASSWORD:-};
|
||||
- ConnectionStrings__PfmSchedulerDatabase=Server=${POSTGRES_HOST:-192.168.1.170};Port=${POSTGRES_PORT:-5432};Database=pfm-scheduler;User Id=${POSTGRES_USER:-pfm-user};Password=${POSTGRES_PASSWORD:-};
|
||||
|
||||
# Garage S3 Settings
|
||||
- GeneralS3Settings__ServiceUrl=${GENERAL_S3_SERVICE_URL:-https://s3.garage.khongisa.co.za}
|
||||
- GeneralS3Settings__Region=${GENERAL_S3_REGION:-garage}
|
||||
- GeneralS3Settings__BucketName=${GENERAL_S3_BUCKET_NAME:-pfm}
|
||||
- GeneralS3Settings__CdnBaseUrl=${GENERAL_S3_CDN_BASE_URL:-https://pfm.cdn.khongisa.co.za}
|
||||
- GeneralS3Settings__AccessKey=${GENERAL_S3_ACCESS_KEY:-}
|
||||
- GeneralS3Settings__SecretKey=${GENERAL_S3_SECRET_KEY:-}
|
||||
|
||||
# HashIds overrides
|
||||
- HasherSettings__MinHashLength=${HASHER_MIN_HASH_LENGTH:-11}
|
||||
- HasherSettings__Salt=${HASHER_SALT:-}
|
||||
|
||||
# Data Protection Overrides
|
||||
- DataProtection__Certificate=${DATA_PROTECTION_CERTIFICATE:-}
|
||||
- DataProtection__Password=${DATA_PROTECTION_CERTIFICATE_PASSWORD:-}
|
||||
|
||||
# Monitoring Overrides
|
||||
- Monitoring__Address=${MONITORING_ADDRESS:-http://aspire-dashboard-service.aspire.svc.cluster.local:18889}
|
||||
- Monitoring__ServiceName=${MONITORING_SERVICE_NAME:-Pfm.DEV}
|
||||
- Monitoring__ApiKey=${MONITORING_API_KEY:-}
|
||||
|
||||
# Email Processor Overrides
|
||||
- Email__ProcessorJobCron=${EMAIL_PROCESSOR_CRON:-0 */5 * * * ?}
|
||||
- Email__Credentials__Password=${EMAIL_CREDENTIALS_PASSWORD:-}
|
||||
- Email__Credentials__Username=${EMAIL_CREDENTIALS_USERNAME:-}
|
||||
- Email__SmtpServer=${EMAIL_SMTP_SERVER:-}
|
||||
- Email__SmtpPort=${EMAIL_SMTP_PORT:-587}
|
||||
|
||||
# Redis overrides
|
||||
- ConnectionStrings__Redis=${REDIS_CONNECTION_STRING:-192.168.1.171:6379,ssl=false,abortConnect=false}
|
||||
restart: unless-stopped
|
||||
pfm-api:
|
||||
image: pfm-api
|
||||
build:
|
||||
@@ -8,10 +59,7 @@ services:
|
||||
container_name: pfm-api
|
||||
ports:
|
||||
- "8075:8080"
|
||||
environment:
|
||||
# Service layer caching feature flag
|
||||
- EnableServiceCaching=false
|
||||
|
||||
environment:
|
||||
# Header forwarding overrides
|
||||
- ASPNETCORE_ENVIRONMENT=${ENVIRONMENT:-Development}
|
||||
- ForwardedHeadersConfiguration__Enabled=true
|
||||
@@ -61,13 +109,6 @@ services:
|
||||
- Monitoring__Address=${MONITORING_ADDRESS:-http://aspire-dashboard-service.aspire.svc.cluster.local:18889}
|
||||
- Monitoring__ServiceName=${MONITORING_SERVICE_NAME:-Pfm.DEV}
|
||||
- Monitoring__ApiKey=${MONITORING_API_KEY:-}
|
||||
|
||||
# Email Processor Overrides
|
||||
- EmailProcessorCron=${EMAIL_PROCESSOR_CRON:-}
|
||||
- Email__Credentials__Password=${EMAIL_CREDENTIALS_PASSWORD:-}
|
||||
- Email__Credentials__Username=${EMAIL_CREDENTIALS_USERNAME:-}
|
||||
- Email__SmtpServer=${EMAIL_SMTP_SERVER:-}
|
||||
- Email__SmtpPort=${EMAIL_SMTP_PORT:-587}
|
||||
|
||||
# Redis overrides
|
||||
- ConnectionStrings__Redis=${REDIS_CONNECTION_STRING:-192.168.1.171:6379,ssl=false,abortConnect=false}
|
||||
|
||||
Reference in New Issue
Block a user