barryvdh / elfinder-flysystem-driver

elFinder driver for Flysystem
183 stars 41 forks source link

Issue connecting s3 bucket #67

Open dmarcos89 opened 6 years ago

dmarcos89 commented 6 years ago

Hi, i am having issues configuring my s3 bucket. Not sure where exactly in the config it should go, disks? roots?

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Upload dir
    |--------------------------------------------------------------------------
    |
    | The dir where to store the images (relative from public)
    |
    */
    'dir' => ['Images'],

    /*
    |--------------------------------------------------------------------------
    | Filesystem disks (Flysytem)
    |--------------------------------------------------------------------------
    |
    | Define an array of Filesystem disks, which use Flysystem.
    | You can set extra options, example:
    |
    | 'my-disk' => [
    |        'URL' => url('to/disk'),
    |        'alias' => 'Local storage',
    |    ]
    */
    'disks' => [
        // 'uploads' => [
        //     'driver' => 'local',
        //     'root' => public_path('uploads'),
        // ],
        // 'public' => [
        //     'driver' => 'local',
        //     'root' => storage_path('app/public'),
        //     'url' => env('APP_URL').'/storage',
        //     'visibility' => 'public',
        // ],
        // 's3' => [
        //     'driver' => 's3',
        //     'key' => env('AWS_KEY'),
        //     'secret' => env('AWS_SECRET'),
        //     'region' => env('AWS_REGION'),
        //     'bucket' => env('AWS_BUCKET'),
        // ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Routes group config
    |--------------------------------------------------------------------------
    |
    | The default group settings for the elFinder routes.
    |
    */

    'route' => [
        'prefix'     => config('backpack.base.route_prefix', 'admin').'/elfinder',
        'middleware' => ['web', 'admin'], //Set to null to disable middleware filter
    ],

    /*
    |--------------------------------------------------------------------------
    | Access filter
    |--------------------------------------------------------------------------
    |
    | Filter callback to check the files
    |
    */

    'access' => 'Barryvdh\Elfinder\Elfinder::checkAccess',

    /*
    |--------------------------------------------------------------------------
    | Roots
    |--------------------------------------------------------------------------
    |
    | By default, the roots file is LocalFileSystem, with the above public dir.
    | If you want custom options, you can set your own roots below.
    |
    */

    'roots' => null,
    // 'roots' => [
    //     's3' => [
    //         'driver' => 's3',
    //         'key' => env('AWS_KEY'),
    //         'secret' => env('AWS_SECRET'),
    //         'region' => env('AWS_REGION'),
    //         'bucket' => env('AWS_BUCKET'),
    //     ],
    // ],

    /*
    |--------------------------------------------------------------------------
    | Options
    |--------------------------------------------------------------------------
    |
    | These options are merged, together with 'roots' and passed to the Connector.
    | See https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options-2.1
    |
    */

    'options' => [],

];

When placing it in roots:

Invalid backend configuration.
Readable volumes not available.

When placing it in disks:

Invalid backend response.
Error occurred on the server side.
HTTP error 500

Does my bucket need to have public access? Any help will be much appreciated. Thanks in advance!

og6k commented 6 years ago

I am having this same issue, did you ever get it fixed?