Skip to content

Health check for originals storage mount #112

Description

@bitbiter-dev

Context

The API health check endpoint (GET /api/v1/healthz) currently checks the proxy storage directory (/data/proxies). The originals mount (/data/originals) is equally critical for on-demand serving of original files but has no health check.

This issue belongs to Epic 5 (API endpoints) because serving originals is an Epic 5 concern — the Worker only writes proxies, and the API serves originals on demand.

What to do

Add an OriginalsStorageHealthCheck that mirrors ProxyStorageHealthCheck:

  • Healthy → /data/originals exists and is accessible
  • Degraded → directory not found (mount missing; API can still serve proxies)
  • Unhealthy → file system threw an exception

Register it in ServiceCollectionExtensions.AddApiHealthChecks() alongside the existing proxy check:

.AddCheck<OriginalsStorageHealthCheck>("originalsStorage");

Add the corresponding constant to AppDefaults.Storage:

internal const string OriginalsPath = "/data/originals";

Test coverage

Mirror ProxyStorageHealthCheckTests with three cases:

  • Directory exists → Healthy with description
  • Directory does not exist → Degraded with description
  • File system throws → Unhealthy with exception

Notes

  • Reuse IFileSystem (already registered as singleton for the proxy check)
  • Both mounts are read-only for the API (docker-compose.yml mounts :ro)
  • Degraded is appropriate for a missing mount because the API remains functional for non-originals requests

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-for-agentFully specified, ready for an AFK agentv1.0Required for the v1.0 release

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions