Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="HealthMonitoring.Client" Version="2026.9.2.29" />
<PackageVersion Include="MediatR" Version="14.2.0" />
<PackageVersion Include="MessagingService.Client" Version="2026.9.2.149" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="10.0.12" />
Expand Down Expand Up @@ -55,4 +56,4 @@
<PackageVersion Include="Selenium.WebDriver" Version="4.49.0" />
<PackageVersion Include="Reqnroll.NUnit" Version="3.3.4" />
</ItemGroup>
</Project>
</Project>
20 changes: 9 additions & 11 deletions SecurityService/Program.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using ClientProxyBase;
using HealthChecks.UI.Client;
using HealthMonitoring.Client;
using MediatR;
using MessagingService.Client;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Http.Json;
using Microsoft.AspNetCore.HttpLogging;
Expand All @@ -31,10 +32,10 @@
using Shared.Logger;
using Shared.Logger.TennantContext;
using Shared.Middleware;
using Shared.Monitoring;
using Shared.Serialisation;
using System.Reflection;
using System.Security.Cryptography;
using Shared.Monitoring;
using static OpenIddict.Abstractions.OpenIddictConstants;
using static OpenIddict.Abstractions.OpenIddictConstants.Permissions;
using ILogger = Microsoft.Extensions.Logging.ILogger;
Expand All @@ -60,7 +61,11 @@
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true)
.AddJsonFile($"/home/txnproc/config/appsettings.local.json", optional: true, reloadOnChange: true)
.AddEnvironmentVariables();
.AddEnvironmentVariables()
.AddInMemoryCollection(new Dictionary<string, string?>
{
["HealthMonitoring:Service:Version"] = Assembly.GetEntryAssembly()?.GetName().Version?.ToString() ?? "0.0.0.0"
});

// Build a snapshot of configuration so we can use it immediately (e.g. for Sentry)
var builtConfig = configBuilder.Build();
Expand Down Expand Up @@ -235,7 +240,7 @@
else {
builder.Services.AddHealthChecks().AddMessagingService().AddCheck<DatabaseHealthCheck>("database").AddCheck<IssuerHealthCheck>("issuer");
}
builder.Services.AddUptimeKuma();
builder.Services.AddHealthMonitoringRegistration(builder.Configuration);

builder.Services.AddHttpLogging(loggingOptions =>
{
Expand Down Expand Up @@ -352,11 +357,4 @@
app.MapHealthChecks("health", new HealthCheckOptions { Predicate = _ => true, ResponseWriter = Shared.HealthChecks.HealthCheckMiddleware.WriteResponse });
app.MapHealthChecks("healthui", new HealthCheckOptions { Predicate = _ => true, ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse });

app.Lifetime.ApplicationStarted.Register(() =>
{
app.RegisterWithUptimeKumaAsync()
.GetAwaiter()
.GetResult();
});

app.Run();
1 change: 1 addition & 0 deletions SecurityService/SecurityService.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" />
<PackageReference Include="HealthMonitoring.Client" />
<PackageReference Include="MediatR" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" />
Expand Down
23 changes: 17 additions & 6 deletions SecurityService/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,23 @@
"Microsoft.AspNetCore": "Warning"
}
},
"UptimeKuma": {
"Monitor": {
"HealthMonitoring": {
"Service": {
"ServiceId": "security-service",
"Name": "Security Service",
"Url": "https://localhost:5001/health",
"IntervalInSeconds": 60,
"IgnoreTls": true
}
"Description": "Security Service",
"HealthUrl": "https://localhost:5001/healthui",
Comment thread
StuartFerguson marked this conversation as resolved.
Resolved
"IgnoreCertificateErrors": true
},
"Dependencies": [
{
"DependencyName": "Messaging Service",
"TargetServiceId": "messaging-service"
},
{
"DependencyName": "database",
"TargetServiceId": "sql-server"
}
]
}
}
Loading