KnpLabs / KnpGaufretteBundle

Easily use Gaufrette in your Symfony projects.
http://knplabs.com
MIT License
717 stars 158 forks source link

wasabi.com S3-compatible #188

Open grekpg opened 6 years ago

grekpg commented 6 years ago

I want connect - wasabi.com S3-compatible to KnpGaufretteBundle i dont see adapter for wasabi, but its S3-compatible

my config

knp_gaufrette:
    stream_wrapper: ~
    filesystems:
        product_local_fs:
            adapter: product_local
        product_wasabi_fs:
            adapter: product_wasabi
    adapters:
        product_local:
            local:
                directory: '%kernel.project_dir%/public/products'
        product_wasabi:
            aws_s3:
                service_id: 'app_files_s3_wasabi'
                bucket_name: 'my-network'
                detect_content_type: true
                options:
                    directory: 'my-network'

vich_uploader:
    db_driver: orm
    storage: gaufrette
    mappings:
        products:
            uri_prefix: https://s3.wasabisys.com/my-network
            upload_destination: product_wasabi_fs
            namer: vich_uploader.namer_uniqid
            delete_on_remove: true
            delete_on_update: true
        products_local:
            uri_prefix: /products
            upload_destination: product_local_fs
            delete_on_remove: true
            delete_on_update: true

services :

app_files_s3_wasabi:
    class: Aws\S3\S3Client
    factory: [Aws\S3\S3Client, 'factory']
    arguments:
      -
        version: latest
        region: ""
        credentials:
            key: '%env(wasabi_access_key)%'
            secret: '%env(wasabi_secret_key)%'
my-network - is registered exist bucket, i dump connection details :

vendor/guzzlehttp/psr7/src/Request.php Line: 101

Uri {#27076 ▼
  -scheme: "https"
  -userInfo: ""
  -host: "s3..amazonaws.com"
  -port: null
  -path: "/my-network"
  -query: ""
  -fragment: ""

any idea how correctly connect to wasabi.com ?

RichardHerold commented 6 years ago

I'm the Senior PM for Wasabi. Wasabi should work with the adaptor as long as you can modify the endpoint in the PHP like our example in our KB:

https://wasabi-support.zendesk.com/hc/en-us/articles/360000363572-How-do-I-use-the-AWS-SDK-for-PHP-with-Wasabi-

grekpg commented 6 years ago

services: app_files_s3_wasabi: class: Aws\S3\S3Client factory: [Aws\S3\S3Client, 'factory'] arguments:

        endpoint: 'https://s3.wasabisys.com'
        version: latest
        region: "us-east-1"
        credentials:
            key: '%env(wasabi_access_key)%'
            secret: '%env(wasabi_secret_key)%'

config: product_wasabi: aws_s3: service_id: 'app_files_s3_wasabi' bucket_name: '123123-test' detect_content_type: true

but i get

The configured bucket "123123-test" does not exist.

when i connect directtly form S3Client

$s3Client = S3Client::factory(array( 'endpoint' => 'http://s3.wasabisys.com', 'profile' => 'default', 'region' => 'us-east-1', 'version' => 'latest', ));

$bucket = '123123-test';

$s3Client->doesBucketExist(array('Bucket' => $bucket )); give true