Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Dashboard Card for CodeGate Server Health #417

Closed
@lukehinds

Description

@lukehinds

Dashboard Card for CodeGate Server Health

Summary
Create a new Dashboard card to display the health status of the CodeGate server by querying the /api/health endpoint
This feature should could validate that the server’s CA certificate chains back correctly for additional security assurance, to help users needing a cert (aka CoPilot)

server.py#L101


Background & Motivation

  • Developers need a quick, at-a-glance indicator of whether CodeGate server is operational.
  • Currently, there’s no immediate visual feedback within the dashboard to confirm successful server connectivity or certificate validity.
  • By adding a dedicated health status card, we improve the user experience and reduce troubleshooting time if the server is down or certificates are misconfigured.

NOTE: As always, start small, simple and validate, the following acts as a guideline of where this could lead.


Requirements

  1. Health Endpoint Check
    • The dashboard should automatically send a request to the /api/health endpoint at set intervals (e.g., every 30 seconds or on page load).
    • The result should clearly indicate “Healthy” or “Unhealthy” status.
  2. Certificate Validation
    • When requesting the /api/health endpoint, the client should validate the server’s certificate chain.
    • The dashboard should display a warning if the CA chain is invalid or not trusted.
  3. UI/UX
    • Introduce a “Health Status” card on the main dashboard screen (or in the sidebar if that’s more appropriate).
    • The card could show:
      • Status: “Healthy” (green) or “Unhealthy” (red).
      • Last Check: Timestamp of the most recent successful/failed check.
      • Certificate Validation: Indicate whether the cert chain is valid (“Valid CA Chain”) or invalid (“Untrusted CA”).
    • If Unhealthy, optionally provide a link to troubleshooting docs or logs.
  4. Configuration & Extensibility
    • Expose a configuration option for the refresh interval in a settings panel if needed.
    • The certificate chain validation step should be pluggable to support future enhancements (e.g., custom CAs or more detailed SSL checks).
  5. Error Handling & Logging
    • If the server is unreachable or certificate validation fails, log an event in CodeGate’s logging system.
    • Provide a clear user-facing error message in the dashboard card.

Implementation Ideas

  • Endpoint:
    • Use the existing /api/health endpoint which returns a JSON object with a status (e.g., { "status": "ok" }).
  • Certificate Chain Validation:
    • Utilize a standard library function in the front-end (if available) or a proxy in the backend that verifies the server certificate.
    • Alternatively, rely on the browser’s native certificate validation for HTTPS requests, capturing errors in JavaScript for display.
  • UI:
    • Use a simple card component that fetches data on a set interval or on component mount.
    • Switch the card’s style based on the success/failure of the check.

Acceptance Criteria

  1. The dashboard displays a new card labeled “CodeGate Server Health” or equivalent.
  2. On page load, the card queries /api/health and shows one of the following states:
    • Healthy: If the endpoint returns a successful response and certificate validation passes.
    • Unhealthy: If the endpoint returns an error or certificate validation fails.
  3. The card shows a timestamp of the most recent health check.
  4. If an Unhealthy state is detected, the user is provided with a warning or brief troubleshooting steps.
  5. Logs are recorded for both successful and failed checks.

Additional Notes / Suggestions

  • Consider caching responses and only refreshing the UI at configurable intervals to avoid unnecessary API calls.
  • Extra credits for providing a quick link to logs or server status pages for deeper diagnostics.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions