barryvdh / elfinder-flysystem-driver

elFinder driver for Flysystem
183 stars 41 forks source link

How to set root for S3 access #70

Open 3DUNAPI opened 6 years ago

3DUNAPI commented 6 years ago

I have got all the dependancies installed with composer but I still cannot figure out how to configure my roots to get access to my S3 bucket. I am new to php so I don't fully understand how to implement it.

Here is what I have so far:

array(
    'driver' => 'Flysystem',
    's3' => array(
          "key" => "xxxxxxxx",
          "secret" => "xxxxxxxx",
              "region" => "eu-west-1"
                ),
    'URL'           => 'https://s3-eu-west-1.amazonaws.com/bucketname',
    'path'          => '/',   // path relative to bucket
    'bucket' => 'bucketname',
    'acl' => 'public-read'     // depends on your case

    ),

Please can someone point me in the right direction.

og6k commented 6 years ago

this is how I did it: https://github.com/barryvdh/elfinder-flysystem-driver/issues/69

remember to install laravel aws-s3 filesystem. and keep all your keys in .env file, you don't want it to be in a public config file.

3DUNAPI commented 6 years ago

Thanks @og6k I don't have experience of Laravel but I will give it a try. I have been trying to piece this together for two days using the straight php version and haven't had much luck thus far.

bayucandra commented 5 years ago

@3DUNAPI , you can check this config example: https://github.com/bayucandra/ckeditor-elfinder/blob/master/vendor/elFinder/php/connector.minimal.php

Or clone full repo for a quick start: https://github.com/bayucandra/ckeditor-elfinder then put your S3 config to /vendor/elFinder/php/connector.minimal.php for $aws_config variable.