diff --git a/authentik/root/monitoring.py b/authentik/root/monitoring.py index a70749880..f3c98b5f5 100644 --- a/authentik/root/monitoring.py +++ b/authentik/root/monitoring.py @@ -58,13 +58,6 @@ class MetricsView(View): return ExportToDjangoView(request) -class LiveView(View): - """View for liveness probe, always returns Http 204""" - - def dispatch(self, request: HttpRequest) -> HttpResponse: - return HttpResponse(status=204) - - class ReadyView(View): """View for readiness probe, always returns Http 204, unless sql or redis is down""" diff --git a/authentik/root/urls.py b/authentik/root/urls.py index 2c5baf3b4..a35061665 100644 --- a/authentik/root/urls.py +++ b/authentik/root/urls.py @@ -4,7 +4,7 @@ from structlog.stdlib import get_logger from authentik.core.views import error from authentik.lib.utils.reflection import get_apps -from authentik.root.monitoring import LiveView, MetricsView, ReadyView +from authentik.root.monitoring import MetricsView, ReadyView LOGGER = get_logger() @@ -44,6 +44,5 @@ for _authentik_app in get_apps(): urlpatterns += [ path("metrics/", MetricsView.as_view(), name="metrics"), - path("-/health/live/", LiveView.as_view(), name="health-live"), path("-/health/ready/", ReadyView.as_view(), name="health-ready"), ] diff --git a/internal/web/proxy.go b/internal/web/proxy.go index e85196edd..41f3c5173 100644 --- a/internal/web/proxy.go +++ b/internal/web/proxy.go @@ -39,6 +39,9 @@ func (ws *WebServer) configureProxy() { } ws.proxyErrorHandler(rw, r, fmt.Errorf("proxy not running")) }) + ws.m.Path("/-/health/live/").HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { + rw.WriteHeader(204) + }) ws.m.PathPrefix("/").HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { if !ws.p.IsRunning() { ws.proxyErrorHandler(rw, r, fmt.Errorf("authentik core not running yet"))