mongo-express / mongo-express-docker

a dockerized mongo-express for viewing mongoDB in the browser
MIT License
198 stars 92 forks source link

ME_CONFIG_HEALTH_CHECK_PATH has no effect #127

Open lordslair opened 6 days ago

lordslair commented 6 days ago

Hi,

Apparently, a couple of ENV Vars have no impact on mongo-express I tried to have access to /status URL for Kubernetes livenessProbe (healthcheck)

Apparently, with or without setting the env var, it fails, and returns a 404

Here, the snippet from the K8s YAML:

      containers:
      - name: mongo-express
        image: mongo-express:1.0.0
        env:
[...]
        - name: ME_CONFIG_HEALTH_CHECK_PATH
          value: "/status"
        # Network
        ports:
        - name: mongo-express
          containerPort: 8081
        # Healthcheck
        livenessProbe:
            httpGet:
              path: /status
              port: 8081
            initialDelaySeconds: 10
            timeoutSeconds: 5

The ENV VArs are properly progagated:

mongo-express-7f4dddfc6-4fcqc:/node_modules/mongo-express# env | grep CHECK
ME_CONFIG_HEALTH_CHECK_PATH=/status

And there's the mongo-express related logs

No custom config.js found, loading config.default.js
Welcome to mongo-express
------------------------

Mongo Express server listening at http://0.0.0.0:8081
Server is open to allow connections from anyone (0.0.0.0)
basicAuth credentials are "admin:pass", it is recommended you change this in your config.js!
GET /status 404 495.004 ms - 145
GET /status 404 696.116 ms - 145

I tried without setting ME_CONFIG_HEALTH_CHECK_PATH, and same thing, HTTP404 on /status (as I suppose it's the deafult value)

Is there something I missed, or is it a bug ?

rtritto commented 5 days ago

Code of Docker version should be outdated.

Feature is introduced with https://github.com/mongo-express/mongo-express/pull/940.

Please can you check the code?

lordslair commented 5 days ago

I will do so, and test locally the proposed modifications to check if that fixes the issue