Support S3-compatible presigned URL demo upload (HTTP PUT) - #387
Open
FlowingSPDG wants to merge 1 commit into
Open
FlowingSPDG wants to merge 1 commit into
FlowingSPDG wants to merge 1 commit into
Conversation
- Add matchzy_demo_upload_s3 / get5_demo_upload_s3 cvars - Stream PUT with application/octet-stream; omit custom headers for SigV4 - Extend HttpClient timeout for large demos - Docs, sample config, changelog Made-with: Cursor
FlowingSPDG
marked this pull request as ready for review
April 10, 2026 17:47
mrc4tt
added a commit
to mrc4tt/MatchZy
that referenced
this pull request
Aug 1, 2026
Port upstream's demo upload plus upstream PR shobhit-pathak#387 (S3-compatible presigned URLs) onto the fork, which stopped the recording with tv_stoprecord but had no upload path at all. matchzy_demo_upload_s3 switches UploadFileAsync from the panel POST (metadata headers + byte body) to a plain HTTP PUT streaming the .dem as the request body, which is what a presigned S3 URL expects. The MatchZy-/Get5- headers are deliberately not sent on that path, since unsigned headers break SigV4. Three fixes on top of the upstream PR: - The POST path reused _sharedHttpClient, whose 10s timeout is sized for event publishing. A demo runs to hundreds of MB, so every real upload was cancelled mid-transfer. Both paths now use a dedicated client (2h for S3, 30m for POST). - "matchzy_demo_upload_s3 1" could never enable the flag: bool.TryParse rejects "1", and the fallback ANDed against the current value, which defaults false. Accept 1/0 alongside true/false, and treat an empty argument as a no-op. - Dropped a leftover File.OpenRead on the POST path whose stream was never read. matchzy_demo_upload_s3 is surfaced in the config.cfg template so it reaches existing servers through MergeMissingConfigCvars. The upload URL and auth header stay convar-only and are documented as a comment instead: a presigned URL and a token are credentials, and config.cfg is world readable. UploadFileAsync now returns success so StopDemoRecording can fire demo_upload_ended, an event the fork already declared but never sent. The upload settings are snapshotted on the main thread before the Task.Run.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello there. It's been while since I was away from CS2.
I've added demo upload feature for supporting S3 style object storage such as AWS S3 or Cloudflare R2.
Summary
Implements issue #378: optional HTTP PUT of raw
.dembytes tomatchzy_demo_upload_url(e.g. S3 / R2 presigned URL), avoiding intermediary POST body limits for large demos.Changes
matchzy_demo_upload_s3/get5_demo_upload_s3(default: false)Content-Type: application/octet-stream, streaming upload, extended timeout; no MatchZy/Get5 metadata headers (SigV4-safe)config.cfg+ changelogUsage
Presigned URL should be generated with
Content-Type: application/octet-streamto match the client.Made with Cursor