Skip to main content

S3 API: https://cec4d9659f1d7bc6e069f3787a46ef0f.r2.cloudflarestorage.com/frontpics-storage

photos.dev.frontpics.fi

What was fixed

File Bug Fix

1 .env All R2 values were placeholders Set account ID, endpoint, bucket (hoods-storage), public URL 2 worker/r2.service.ts Read R2_BUCKET โ€” env var is R2_BUCKET_NAME Fixed env var name 3 worker/image-processing.processor.ts Destructured non-existent fileId from job โ†’ undefined paths images/undefined/โ€ฆ and broken DB where: { id: undefined } Removed fileId, use imageId for paths, use where: { imageId_variant: { imageId, variant: 'original' } } for the DB update 4 upload-page-client.tsx Wrong field names (filename/sizeBytes), FormData POST to R2 instead of PUT, priceCents instead of basePriceCredits, no licenseTypeId in confirm Full rewrite with correct schema, PUT body=file, license fetch, full metadata One thing you still need to do In .env, fill in your R2 API keys. Go to Cloudflare dashboard โ†’ R2 โ†’ Manage R2 API tokens and create a token with Read+Write on the storage bucket. Then set:

Also โ€” the photos.dev.frontpics.fi custom domain: once you've configured it in the Cloudflare R2 dashboard for the bucket, change R2_PUBLIC_URL to https://photos.dev.frontpics.fi and thumbnails will be served from your custom domain instead of the r2.dev subdomain.