Klowner / tussle

Tus daemon written in Typescript using a pluggable architecture
MIT License
37 stars 2 forks source link

cloudflare s3 example maybe broken #6

Closed phpb-com closed 1 year ago

phpb-com commented 1 year ago

I tried to play with the CF S3 example (using iDrive E2 storage as an S3 endpoint) and always end-up with the objects named 'files' in the root of the bucket. I am not sure what config is required beyond all of the access/secret/endpoint/etc things. For now I gave up since I did not want to spend digging through the layers of code to see where the problem is. If you have a complete working example that I could learn from, that would be great. Thanks.

Klowner commented 1 year ago

The /files is the endpoint path. https://github.com/Klowner/tussle/blob/main/examples/cloudflare-worker-s3/src/client.ts#L5

In the before-create handler you can alter the location further.

phpb-com commented 1 year ago

Thanks for the reply. I do understand that /files is the endpoint path. The problem is that the file name ends up with the name '/files' in the object storage and it is not the correct size. I suspect that there is something going on with the multipart upload that is not reassembled right. This is probably due to my config, since I did change the concurrency of the upload.

Klowner commented 1 year ago

Ah, are you using the parallel uploads feature of the client? That requires that the server implementation supports the concatenation extension, which tussle currently does not, so you will definitely have poor results.

phpb-com commented 1 year ago

Aha, that makes sense. I'll try to combine example with Uppy and remove the concurrency. Sorry about the confusion.