mongo-express-docker icon indicating copy to clipboard operation
mongo-express-docker copied to clipboard

Feature Request: Unauthenticated health check

Open masus04 opened this issue 2 years ago • 1 comments

For certain deployments, e.g. Kubernetes with CGE Load Balancers, each pod is required to provide an unauthenticated health check route. This route ("/" by default, but I think it can be configured) should responds with status code 200 OK when the service is running properly.

Currently, mongo-express only supports this requirement if basic auth is disabled, which then leaves it completely unauthenticated.

I propose an additional parameter ME_CONFIG_HEALTH_CHECK_PATH, which creates an unauthenticated route that simply returns 200 OK when called. The fact that the route can be called should suffice as a health check, although more elaborate ones could also be implemented.

Ideally this route should work in combination with ME_CONFIG_SITE_BASEURL, such that the following scenario would be possible:

  • ME_CONFIG_SITE_BASEURL = "/express" -> The mongo-express UI is served on "/express"
  • ME_CONFIG_HEALTH_CHECK_PATH = "/" -> Health checks can be run on "/"

masus04 avatar May 09 '22 07:05 masus04

I realized, this primarily belongs to the mongo-express/mongo-express repo and opened an issue there as well.

masus04 avatar May 09 '22 07:05 masus04

Resolved with https://github.com/mongo-express/mongo-express/issues/849

BlackthornYugen avatar Sep 13 '22 02:09 BlackthornYugen