Repository navigation
feat: storage streaming - #22
Merged
Merged
Conversation
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.
Summary
Storage and upload behavior
Paste bodies are limited to 1 MiB by default. Raw request bodies are read in bounded 64 KiB chunks into private temporary files while size and SHA-256 are calculated.
Bodies are stored inline in PostgreSQL only when they:
TEXTBIN_INLINE_PASTE_BYTES(8 KiB by default)All other bodies use the configured local or S3-compatible backend. Development uses SeaweedFS through Docker Compose; simple self-hosting can select local filesystem storage.
Safety and durability
Raw browser responses only allow passive
text/plainandapplication/jsoncontent inline. HTML, XML, SVG, JavaScript, binary, and other user-provided types are attachments. Responses includeX-Content-Type-Options: nosniffand a sandboxed CSP.API and CLI compatibility
Text responses retain the existing
datastring. Binary responses use:{ \"data\": null, \"data_base64\": \"/wAB\", \"data_encoding\": \"base64\", \"content_type\": \"application/octet-stream\" }The Rust client now exposes paste data as bytes and preserves the text/binary discriminator. The workspace version is bumped to
0.2.0to document this deliberate pre-1.0 compatibility change. CLI raw output preserves arbitrary bytes exactly.Database changes
content_typepending_uploadscleanup journal with claim leasesCI and verification
GitHub Actions exercises memory, local filesystem, and real S3-compatible storage through a matrix. SeaweedFS is only started for the S3 matrix entry.
Validated locally with:
mix precommit— 268 testscargo test --workspace— 53 testsmake lint— Credo and Clippy passA final Oracle review returned SHIP with no remaining blockers.