thephpleague / flysystem

Abstraction for local and remote filesystems
https://flysystem.thephpleague.com
MIT License
13.37k stars 827 forks source link

Backblaze #1803

Closed l0gical closed 3 months ago

l0gical commented 3 months ago

Hi All, feel pretty stupid even asking this, but has anyone got this working with Backblaze?

S3 driver v3 3.2.8

No matter what I do, it fails to connect and brings up the whole CORS preflight (from Livewire) as writing temp files to Backblaze.

Any other service provider that I use, AWS, Cloudflare R2 etc with the same driver works absolutely fine. For sanity, with one of the other working providers, I intentionally modified a secret key to see the error, that resulted in CORS (as expected), the issue with Backblaze is therefore absolutely not CORS related, there is something else it is unhappy with, and cannot for the life of me figure this one.

    'b2' => [
        'driver' => 's3',
        'key' => env('B2_KEY_ID'),
        'secret' => env('B2_APPLICATION_KEY'),
        'region' => env('B2_REGION'),
        'bucket' => env('B2_BUCKET'),
        'endpoint' => env('B2_ENDPOINT'),
    ],

livewire.php 'disk' => 'b2',

env B2_KEY_ID=xxxxxxxxxxxxxxxxxx B2_APPLICATION_KEY=xxxxxxxxxxxxxxxxxxxxxxx B2_BUCKET=bucket_name B2_ENDPOINT=https://s3.eu-central-003.backblazeb2.com B2_REGION=eu-central-003

Apologies if I have missed something obvious.

Chris

l0gical commented 3 months ago

Oh and to be sure, I set the CORS settings in the Backblaze bucket for both S3 & their API

Share everything in this bucket with every origin

l0gical commented 3 months ago

I'll answer this myself. Yes it does in fact work with Backblaze, the issue seems to come from Livewire, that throws CORS errors (even though highly unlikely this is the issue) When doing a regular file transfer to the Backblaze disk, that works perfectly fine, will therefore close this.