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
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
OriginalsStorageHealthCheckthat mirrorsProxyStorageHealthCheck:/data/originalsexists and is accessibleRegister it in
ServiceCollectionExtensions.AddApiHealthChecks()alongside the existing proxy check:Add the corresponding constant to
AppDefaults.Storage:Test coverage
Mirror
ProxyStorageHealthCheckTestswith three cases:Notes
IFileSystem(already registered as singleton for the proxy check)docker-compose.ymlmounts:ro)Degradedis appropriate for a missing mount because the API remains functional for non-originals requests