Skip to content

Re-validation cron for registered servers #4

@funkiirabu

Description

@funkiirabu

Problem

Once a server is registered, there's no periodic check that it's still alive, still has a valid OpenAPI spec, or still responds with 402 challenges. Servers could go offline and remain listed indefinitely.

Solution

Add a cron job that periodically re-validates registered servers.

Checks to run

  • Server URL is reachable (HTTP 200 or 402)
  • /openapi.json still exists and parses correctly
  • Endpoint count matches (detect added/removed endpoints)
  • 402 challenge still works on a sample endpoint
  • Recipient address hasn't changed

Behavior

  • Run daily (or every 6 hours)
  • On failure: set server.status = 'unreachable' after N consecutive failures
  • On recovery: automatically restore to active
  • Update server.endpointData if endpoints changed
  • Log validation results for debugging

Implementation

  • Next.js API route: POST /api/cron/revalidate
  • Protected by CRON_SECRET (same pattern as other crons)
  • Uses @suimpp/discovery check internally

Context

Deferred from Phase 4 scope. Currently servers are validated once at registration and never rechecked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions