Skip to content

feat: add /healthcheck endpoint for external monitoring#77

Open
bitxeno wants to merge 2 commits intomasterfrom
feature/healthcheck
Open

feat: add /healthcheck endpoint for external monitoring#77
bitxeno wants to merge 2 commits intomasterfrom
feature/healthcheck

Conversation

@bitxeno
Copy link
Owner

@bitxeno bitxeno commented Feb 15, 2026

Summary

This PR adds a health check endpoint at /healthcheck (no /api prefix) to enable integration with external monitoring services like healthchecks.io and Uptime-kuma.

Changes

New Endpoint

  • URL: GET /healthcheck
  • Behavior:
    • Returns HTTP 200 when all enabled apps are healthy (not expired)
    • Returns HTTP 503 when any enabled apps have expired

Implementation Details

  • Added IsExpired() method to InstalledApp model for strict expiration check (ExpirationDate < now)
  • Added HasExpiredApps() function in service layer to check for expired apps
  • Endpoint returns simple status response without exposing sensitive app details

Use Cases

Users can now configure external monitoring services:

  • healthchecks.io: Set up a check with the /healthcheck URL
  • Uptime-kuma: Add HTTP monitor expecting status code 200
  • Kubernetes: Use as liveness/readiness probe

When sideloaded apps expire and need refreshing, the endpoint returns 503, triggering alerts from the monitoring service.

Related Issue

Closes #75 (Support success webhooks/alerts - enables watchdog heartbeat functionality)

Add HTTP endpoint at /healthcheck (no /api prefix) that:
- Returns 200 OK when all enabled apps are healthy
- Returns 503 Service Unavailable when any apps are expired
- Includes expired app details in response for debugging

This enables integration with healthchecks.io, Uptime-kuma,
and other external monitoring services that can detect
when sideloaded apps need refreshing.

Relates to #75
- Add IsExpired() method to InstalledApp model for strict expiration check
- Add HasExpiredApps() function in service layer
- Simplify /healthcheck endpoint to use service function
- Remove expired app details from response, only return status

The expiration check now uses strict logic: ExpirationDate < now
instead of NeedRefresh() which includes advance days buffer.
@jfcabral
Copy link

Great idea, I find this to be helpful as it allows us to further improve external monitoring 👍

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.

[Feature] Support success webhooks/alerts

2 participants

Comments