diff --git a/src/Umbraco.Web.UI/config/HealthChecks.config b/src/Umbraco.Web.UI/config/HealthChecks.config index 4e927e8bb6..5cb99e195b 100644 --- a/src/Umbraco.Web.UI/config/HealthChecks.config +++ b/src/Umbraco.Web.UI/config/HealthChecks.config @@ -8,19 +8,19 @@ For details on the format of this configuration file see: https://our.umbraco.com/documentation/reference/config/healthchecks --> - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + diff --git a/src/Umbraco.Web/HealthCheck/HealthCheckController.cs b/src/Umbraco.Web/HealthCheck/HealthCheckController.cs index 34d201d5fe..dee62e936b 100644 --- a/src/Umbraco.Web/HealthCheck/HealthCheckController.cs +++ b/src/Umbraco.Web/HealthCheck/HealthCheckController.cs @@ -82,7 +82,7 @@ namespace Umbraco.Web.HealthCheck public object GetStatus(Guid id) { var check = GetCheckById(id); - + try { //Core.Logging.LogHelper.Debug("Running health check: " + check.Name); @@ -113,4 +113,4 @@ namespace Umbraco.Web.HealthCheck return check; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Scheduling/HealthCheckNotifier.cs b/src/Umbraco.Web/Scheduling/HealthCheckNotifier.cs index d6e72f936b..7d42a90e58 100644 --- a/src/Umbraco.Web/Scheduling/HealthCheckNotifier.cs +++ b/src/Umbraco.Web/Scheduling/HealthCheckNotifier.cs @@ -16,7 +16,7 @@ namespace Umbraco.Web.Scheduling private readonly ApplicationContext _appContext; private readonly IHealthCheckResolver _healthCheckResolver; - public HealthCheckNotifier(IBackgroundTaskRunner runner, int delayMilliseconds, int periodMilliseconds, + public HealthCheckNotifier(IBackgroundTaskRunner runner, int delayMilliseconds, int periodMilliseconds, ApplicationContext appContext) : base(runner, delayMilliseconds, periodMilliseconds) { diff --git a/src/Umbraco.Web/WebBootManager.cs b/src/Umbraco.Web/WebBootManager.cs index dbab3d2346..faf1418b42 100644 --- a/src/Umbraco.Web/WebBootManager.cs +++ b/src/Umbraco.Web/WebBootManager.cs @@ -544,6 +544,19 @@ namespace Umbraco.Web () => PluginManager.ResolveTypes()); HealthCheckNotificationMethodResolver.Current = new HealthCheckNotificationMethodResolver(LoggerResolver.Current.Logger, () => PluginManager.ResolveTypes()); + + // Disable duplicate community health checks which appear in Our.Umbraco.HealtchChecks and Umbraco Core. + // See this issue to understand why https://github.com/umbraco/Umbraco-CMS/issues/4174 + var disabledHealthCheckTypes = new[] + { + "Our.Umbraco.HealthChecks.Checks.Security.HstsCheck", + "Our.Umbraco.HealthChecks.Checks.Security.TlsCheck" + }.Select(TypeFinder.GetTypeByName).WhereNotNull(); + + foreach (var type in disabledHealthCheckTypes) + { + HealthCheckResolver.Current.RemoveType(type); + } } ///