Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DigitalOcean spaces #102

Open
ChristianGiupponi opened this issue Jan 9, 2018 · 3 comments
Open

DigitalOcean spaces #102

ChristianGiupponi opened this issue Jan 9, 2018 · 3 comments

Comments

@ChristianGiupponi
Copy link

Any plan to support DigitalOcean Spaces? I have see that is s3 compatible but the command for s3 will append amazon's url which causes problem:

artisan db:backup --database=mysql --destination=s3 --destinationPath=my-space/backups/ --timestamp="Ymd-Hi" --compression=gzip

This will produce an error:

Error executing "ListObjects" on "https://s3.ams3.digitaloceanspaces.com.amazonaws.com/backups%2Fclickaid?prefix=my-space%2Fbackups%2F20180109-1431.gz%2F&max-keys=1&encoding-type=url"; AWS HTTP error: cURL error 6: Could not resolve h  
  ost: s3.ams3.digitaloceanspaces.com.amazonaws.com (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
@patrickriemer
Copy link

patrickriemer commented Mar 3, 2018

I had the same problem and solved it by changing the configuration as follows:

.env

AWS_DEFAULT_REGION=sgp1
AWS_BUCKET=YOUR_BUCKET
AWS_URL=digitaloceanspaces.com

filesystem.php

'driver' => 's3',
'version' => '2006-03-01',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'endpoint' => "https://".env('AWS_DEFAULT_REGION').".".env('AWS_URL')

Don't forget to run "php artisan config:cache" if you have cached your configuration.

@ghost
Copy link

ghost commented Oct 3, 2018

@patrickriemer

Is this the setup you put in your backup_manager.php config file? Or does the backup manager package pull from filesystem.php and override those credentials?

I got the concept but a little confused on the configs since there is a separate config for this package.

@KeitelDOG
Copy link

KeitelDOG commented Nov 27, 2018

@ patrickriemer I don't get it, the Backup Manager has its own config file backup-manager.php like :

's3' => [
        'type' => 'AwsS3',
        'key'    => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_SECRET_ACCESS_KEY'),
        'region' => env('AWS_DEFAULT_REGION'),
        'bucket' => env('AWS_BUCKET'),
        'root'   => '',
    ],

I have tried a custom one :

'do_space' => [
        'type' => 'AwsS3',
        'key'    => env('MEGALOBIZ_DO_KEY'),
        'secret' => env('MEGALOBIZ_DO_SECRET'),
        'region' => env('MEGALOBIZ_DO_REGION'),
        'bucket' => env('MEGALOBIZ_DO_BUCKET'),
        'endpoint' => env('MEGALOBIZ_DO_ENDPOINT'),
        'root'   => 'backups/'.env('MEGALOBIZ_DO_BUCKET_ENV'),
    ],

But I received error : Could not resolve host: megalobiz.s3.ny3.amazonaws.com , it won't use the endpoint value which is not standard of course, I added it manually in the list.

However in filesystems.php config, I upload files just fine with the save .env variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants