Skip to content

Conversation

@Mr-Neutr0n
Copy link

Summary

  • When OPENCODE_SERVER_PASSWORD is set, the Basic Auth middleware was applied to all routes, including /global/health. Health check endpoints should be publicly accessible so monitoring tools and load balancers can verify the server is running without needing credentials.
  • Added a path check in the auth middleware to skip authentication for /global/health.

Fixes #12805

Test plan

  • Start server with OPENCODE_SERVER_PASSWORD set
  • Verify GET /global/health returns 200 without credentials
  • Verify other endpoints still require Basic Auth when OPENCODE_SERVER_PASSWORD is set
  • Verify all endpoints work normally when OPENCODE_SERVER_PASSWORD is not set

When OPENCODE_SERVER_PASSWORD is set, the auth middleware was applied to
all routes including /global/health. Health check endpoints should be
accessible without authentication so that monitoring tools and load
balancers can verify the server is running.

Skip the basicAuth check when the request path is /global/health.

Fixes anomalyco#12805
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

Hey! Your PR title Exempt /global/health from auth middleware doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@mohamedbouddi7777-dev
Copy link

mohamedbouddi7777-dev commented Feb 9, 2026 via email

Copy link

@mohamedbouddi7777-dev mohamedbouddi7777-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mohamedbouddi7777-dev
Copy link

**and@mohamedbouddi7777-dev **

@Mr-Neutr0n Mr-Neutr0n changed the title Exempt /global/health from auth middleware fix(server): exempt /global/health from auth middleware Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Health check password protected

2 participants