Repository navigation
Server: Store S3 files through aws-lite - #646
Merged
Merged
Conversation
lehni
marked this pull request as ready for review
October 25, 2026 00:32
Replace the AWS SDK and multer-s3 with @aws-lite/client and @aws-lite/s3 as optional peers, keeping the shape of the `s3` config. - Require region and credentials, so aws-lite never falls back to the environment or ~/.aws - Upload streams in 8 MB parts with our own loop until aws-lite releases its S3.Upload() fix, and buffers in one PutObject - Use our own multer storage engine, with the object options as strings that apply to all stored files - Build file urls from the bucket and endpoint without config.url
lehni
force-pushed
the
refactor/s3-aws-lite
branch
from
October 25, 2026 00:36
476f5bb to
3e1c36d
Compare
lehni
enabled auto-merge (rebase)
October 25, 2026 00:37
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.
S3 storages use
@aws-lite/clientand@aws-lite/s3(0.4 MB, 3 packages) instead of@aws-sdk/client-s3,@aws-sdk/lib-storageand the multer-s3 fork (19 MB, 37 packages, plus a git dependency).s3config keeps its shape (endpoint,region,credentials). Credentials are always passed explicitly, so nothing is read from the environment or~/.aws. SDK-only options likeforcePathStyleare listed as unsupported._addFile(). Streams go through our own multipart loop (8 MB parts, at least one part, aborted on errors) until aws-lite releases itsS3.Upload()fix (fix(s3): FixUploadrequest params, buffer and empty bodies, and memory use aws-lite/aws-lite#222). Buffers go through onePutObject.acl,cacheControl,contentDisposition,contentEncoding,storageClass,serverSideEncryptionandsseKmsKeyIdare strings only, and now also apply to files the server adds. The callback forms are gone.urlor from the bucket and endpoint.Tests use aws-lite's own testing mode, so the real client builds every request. Checked against Exoscale with lineto's development bucket: setup, URLs, a 12 MB stream of unknown length, type detection, buffers, listing and removal pass. The empty-stream case uploads fine; Exoscale only adds
charset=UTF-8totext/plain, as with the AWS SDK.Behaviour changes for apps: install
@aws-lite/clientand@aws-lite/s3instead of the AWS packages; callback forms of the upload options are removed. lineto uses neither.