From 104638eb18828c4e4dad89e0b04f1cb2a12fb7a2 Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Fri, 11 Sep 2026 16:10:08 +0100 Subject: [PATCH] add uptime kuma auto registration and nuget updates --- .gitignore | 2 + Directory.Packages.props | 64 +++++++++++++------------- SecurityService/Program.cs | 10 +++- SecurityService/SecurityService.csproj | 3 ++ SecurityService/appsettings.json | 8 ++++ 5 files changed, 54 insertions(+), 33 deletions(-) diff --git a/.gitignore b/.gitignore index 0f899fbc..ad352744 100644 --- a/.gitignore +++ b/.gitignore @@ -330,3 +330,5 @@ ASALocalRun/ # MFractors (Xamarin productivity tool) working folder .mfractor/ +/SecurityService/appsettings.development.json +/SecurityService/appsettings.development.json diff --git a/Directory.Packages.props b/Directory.Packages.props index 84e750f6..f224dcc4 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,54 +4,54 @@ - - - - - - - - - + + + + + + + + + - - - - - + + + + + - - - - - - - + + + + + + + - + - + - - + + - - - + + + - + - - + + - + \ No newline at end of file diff --git a/SecurityService/Program.cs b/SecurityService/Program.cs index f4ac6dbc..e05cfa25 100644 --- a/SecurityService/Program.cs +++ b/SecurityService/Program.cs @@ -32,6 +32,7 @@ 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; @@ -229,7 +230,7 @@ else { builder.Services.AddHealthChecks().AddMessagingService().AddCheck("database").AddCheck("issuer"); } - +builder.Services.AddUptimeKuma(); builder.Services.AddHttpLogging(loggingOptions => { @@ -346,4 +347,11 @@ 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(); diff --git a/SecurityService/SecurityService.csproj b/SecurityService/SecurityService.csproj index 44c99338..369adc2a 100644 --- a/SecurityService/SecurityService.csproj +++ b/SecurityService/SecurityService.csproj @@ -43,6 +43,9 @@ + + Always + Always diff --git a/SecurityService/appsettings.json b/SecurityService/appsettings.json index 201acb8e..9d827009 100644 --- a/SecurityService/appsettings.json +++ b/SecurityService/appsettings.json @@ -35,5 +35,13 @@ "Default": "Information", "Microsoft.AspNetCore": "Warning" } + }, + "UptimeKuma": { + "Monitor": { + "Name": "Security Service", + "Url": "https://localhost:5001/health", + "IntervalInSeconds": 60, + "IgnoreTls": true + } } }