Skip to content

Healthcheck fails when BASIC_AUTH is enabled #2

Description

@fred-head

Hi,

I noticed a small issue while deploying the latest version with BASIC_AUTH enabled.

Steps to reproduce

  1. Deploy the container with:
    BASIC_AUTH=username:password
  2. Start the container.
  3. Wait for the Docker healthcheck to run.

Expected behavior
The container should remain healthy.

Actual behavior
The Docker healthcheck starts failing because /health returns 401 Unauthorized.

Container logs show messages similar to:

127.0.0.1:xxxxx - "GET /health HTTP/1.1" 401 Unauthorized

As a result, Docker marks the container as unhealthy.

Root cause
The BASIC_AUTH middleware currently protects all endpoints, including /health.

However, the Dockerfile already defines /health as the container healthcheck endpoint:

HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3
CMD curl -f http://localhost:8000/health || exit 1

Since the healthcheck does not send authentication headers, it always receives 401 Unauthorized once BASIC_AUTH is enabled.

Possible solution
Exclude /health from the authentication middleware so Docker healthchecks continue to work while all functional API endpoints remain protected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions