Deploy fails with 413 Payload Too Large - Implement R2 storage for audio files #8
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
rust
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/release-kit#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The current
deploy publishimplementation bundles audio files into the Cloudflare Pages deployment zip, causing a 413 Payload Too Large error. Cloudflare Pages Direct Upload API has a 25MB limit, which is insufficient for album releases with audio files.Current (broken) flow:
Root Cause
album.tomlhas anr2_bucketfield, but R2 is not implemented (crates/deployer/src/cloudflare/mod.rs:2)Solution
Implement proper separation using Cloudflare R2 for audio storage and Pages for static content.
Correct architecture:
Domain Architecture
Primary domain (from
album.toml):myalbum.example.commyalbum.example.com→ Cloudflare Pagescdn.myalbum.example.com→ R2 bucketBenefits:
.pages.devor.r2.devin production URLsImplementation Plan
1. R2 Bucket Management
deploy publish{project-name}-audio2. Custom Domain for R2
cdn.{domain}→ R2 bucket public URL3. Audio Upload to R2
{project-name}/audio/track.flachttps://cdn.{domain}/{project-name}/audio/track.flac4. Generator Updates
crates/generatorto accept R2 URLs for audioplayer.jstemplate to use R2 URLs instead of relative paths5. Split Deployment Flow
6. API-Driven Teardown (No Local State)
Derive everything from album.toml + API queries:
Advantages:
statuscommand pattern7. Configuration Updates
deploy configureto document R2 permissionsr2_bucketandpages_projectfields from album.tomlsubdomainfield for custom domain configuration8. Helper Commands
deploy listto show all deployed projectsdeploy statusto show R2 bucket infoAPI Token Permissions
Update required permissions:
Testing Checklist
Files to Modify
crates/cli/src/commands/deploy.rs- R2 upload logic, split deployment, DNS managementcrates/deployer/src/cloudflare/mod.rs- R2 API client, DNS API clientcrates/generator/src/lib.rs- Accept R2 URLs for audiocrates/cli/src/commands/build.rs- Pass audio URLs to generatorcrates/core/src/types.rs- Update CloudflareConfig (remove obsolete fields)Open Questions
cdn.{domain}oraudio.{domain}or make it configurable?Related
This is a critical blocker - the deploy feature is non-functional without R2 support.