Skip to main content

Storage Backends

Paaster supports three storage backends for paste content. All backends support chunked uploads — each encrypted chunk is stored individually.

Configuration

Set STORAGE_BACKEND in your environment to select the backend:

ValueBackend
s3S3-compatible object storage (default)
mongodbMongoDB GridFS-like chunk storage
filesystemLocal filesystem storage

S3

Uses the AWS SDK v3 to store chunks as individual objects.

Key format: {pasteId}/chunks/{chunkIndex}

Required environment variables:

VariableDescription
S3_BUCKETBucket name (required)
S3_ENDPOINTS3-compatible endpoint URL
S3_REGIONRegion
S3_ACCESS_KEY_IDAccess key
S3_SECRET_ACCESS_KEYSecret key
s3_FORCE_PATH_STYLESet true for Garage (default: false)

No presigned URLs are used — the server proxies all uploads and downloads directly.

MongoDB

Stores chunks as documents in a pasteChunks collection.

Document schema:

{
"pasteId": "string",
"chunkIndex": 0,
"data": "Binary",
"totalChunks": 5
}

Indexed on { pasteId: 1, chunkIndex: 1 }.

The same MongoDB connection used for metadata is reused — no additional configuration needed.

Filesystem

Stores chunks as individual files on disk.

File layout:

{basePath}/{pasteId}/{chunkIndex}

Environment variables:

VariableDefaultDescription
FS_STORAGE_PATH/data/paasterBase directory for chunk storage

Each chunk is stored as a file named by its integer index. The paste directory is removed on deletion.