mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
[SG-497] BEEEP - Health Checks API Project (#2237)
* health check services added * health check extension added * added get connection string * made changes to hrslth check method * Added database health check * added identity server health check * added identity server health check * Added logger publisher * latest changes * removed file * Added mail server check for dev * Added authorization to health check url path * commented * Added exception to switch * Removed exclude code coverage * Added health check for redis * Added todos * Added storage queue checks * Added checks for mail * Removed unused references and fixed linting issue * Lint issues * Moved healthchecks to sharedWeb project and exposed builder as a parameter to configure more health checks based on a project * Added health check to API project * dependencies updated * Removed ef core health check dependencies * Added checks to only add a health check when the connection string exists, moved health check from startup to extension class * Merged with master and fixed conflicts * Fixed lint issues * Added check for amazon ses * merged with master * fixed lint * Removed Amazon SES health check
This commit is contained in:
@ -8,9 +8,11 @@ using Bit.Core.Utilities;
|
||||
using IdentityModel;
|
||||
using System.Globalization;
|
||||
using Bit.Core.IdentityServer;
|
||||
using Bit.SharedWeb.Health;
|
||||
using Microsoft.IdentityModel.Logging;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using Bit.SharedWeb.Utilities;
|
||||
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using Bit.Core.Auth.Identity;
|
||||
|
||||
@ -133,6 +135,9 @@ public class Startup
|
||||
services.AddDefaultServices(globalSettings);
|
||||
services.AddCoreLocalizationServices();
|
||||
|
||||
//health check
|
||||
services.AddHealthChecks(globalSettings);
|
||||
|
||||
#if OSS
|
||||
services.AddOosServices();
|
||||
#else
|
||||
@ -206,7 +211,17 @@ public class Startup
|
||||
app.UseMiddleware<CurrentContextMiddleware>();
|
||||
|
||||
// Add endpoints to the request pipeline.
|
||||
app.UseEndpoints(endpoints => endpoints.MapDefaultControllerRoute());
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapDefaultControllerRoute();
|
||||
|
||||
endpoints.MapHealthChecks("/healthz");
|
||||
|
||||
endpoints.MapHealthChecks("/healthz/extended", new HealthCheckOptions
|
||||
{
|
||||
ResponseWriter = HealthCheckServiceExtensions.WriteResponse
|
||||
});
|
||||
});
|
||||
|
||||
// Add Swagger
|
||||
if (Environment.IsDevelopment() || globalSettings.SelfHosted)
|
||||
|
Reference in New Issue
Block a user