Question

Setting up Drupal 8 s3fs module with DigitalOcean Spaces instead of s3

Posted May 19, 2020 1.1k views
Drupal

I’m attemtping to have digitalocean replace Amazon for file system storage with Drupal 8 using hte s3fs module.

Here is a tutorial for S3 setup with Drupal

Some settings that are required are:

# S3FS setting
$settings['s3fs.access_key'] = 'your access key';
$settings['s3fs.secret_key'] = 'your secret key';
$config['s3fs.settings']['bucket'] = 'yourbucketname';
$settings['s3fs.use_s3_for_public'] = TRUE;
# if you want to use S3 for private files, uncomment the line below:
#$settings['s3fs.use_s3_for_private'] = TRUE;

Does anyone have info on how to do this with DO instead?

Thanks!

edited by MattIPv4

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

What you have so far is correct. After this, you will need these two settings:

$config['s3fs.settings']['use_customhost'] = TRUE;
$config['s3fs.settings']['hostname'] = 'https://yourspaceregion.digitaloceanspaces.com';

These can also be set from the settings page(/admin/config/media/s3fs), and verified on the Actions tab (/admin/config/media/s3fs/actions). On the DigitalOcean side, make sure your domain is set to be allowed for GET/POST/PUT/DELETE so that you can perform all file operations.

Once set up, you will likely want to use the “Copy Local Files to S3” tool on /admin/config/media/s3fs/actions to copy your existing files to Spaces.