fix(peertube): node-uploadx resumable upload to stop 504 on large A/V

Admin MP4 uploads failed at 100% with 'erreur de chargement'. Root cause:
FilepondHandler relayed the whole file to PeerTube via one synchronous
multipart POST; the PeerTube edge proxy answered 504 Gateway Time-out once
the relay exceeded its upstream timeout (xamxam-error log: filepond_peertube 504).

Migrate PeerTubeService::upload() to the resumable protocol
(docs.joinpeertube.org, node-uploadx — NOT Google resumable):
  - POST  /api/v1/videos/upload-resumable       -> 201 + Location
  - PUT   <Location> (Content-Range + application/octet-stream) -> 308/200
  - DELETE <Location> on failure (cancel)

Chunked PUT keeps every request under the PeerTube edge proxy timeout.
Verified live against videos.erg.be: 61.7MB BigBuckBunny MP4 uploads in 13.6s
and returns a real shortUUID.

Signature unchanged; both call sites (ThesisCreateController, FilepondHandler)
unaffected.
This commit is contained in:
Pontoporeia
2026-09-18 16:26:49 +02:00
parent bfde71caaa
commit d3f5802e7f
2 changed files with 154 additions and 31 deletions
+2
View File
@@ -63,6 +63,8 @@
- [x] #decouple-rotation-interval-30min Decouple rotation interval (30min) from idle timeout constant
- [x] #update-docs-security-md-deploy-server-sh Update docs/security.md + deploy-server.sh comment for new idle value
- [x] #extend-smoke-test-for Extend smoke test for rotation and 4h idle boundary
- [x] #fix-14-biome-check Fix 14 biome check errors: unsorted imports in scripts/css-*.mjs + unformatted CSS/JS files
- [x] #fix-peertube-resumable-chunked-upload [!high] fix(peertube): resumable chunked upload to stop 504 on large A/V — Admin MP4 upload fails at 100%: PHP relays whole file to PeerTube via one blocking multipart POST; PeerTube edge nginx returns 504 Gateway Time-out (see xamxam-error log filepond_peertube). Migrate PeerTubeService::upload() to resumable upload protocol with chunked PATCH so no single request exceeds the proxy timeout.
## Deferred / Blocked
- [ ] #just-setup-backs-a [!medium] just setup backs a stale setup-dev.sh (clones php-live-reload, legacy admin/data/ dirs) — needs rewrite or removal