BGreen965
Member
@VersoBit and others, Can you share what you ended up doing to get Cloudfare R2 up and running fully for you. Looking at the most up to date add on, it doesn't appear any code changes are needed anymore. I think I'm getting tripped up with the end point, bucket, prefix fields. I've tried a lot of different combo's but, I'm getting this error you were getting when trying to stream an attachment on an otherwise public R2 bucket. I have the "domain connected" with cdn.mydomain.com and Thumbnails and avatars are viewable on the site and directly. I am also hosting the files in Linode's Object storage without issue and have just been using rclone to keep R2 up to date while I try to figure this out (keeping production mostly on Linode except during some testing).
I'm giving up for now, but this is the last combo I tried. The error I'm getting doesn't make sense, because the add on uses ListObjectsV2 now and list-type should be supported....
Code:
Error executing "ListObjectsV2" on "https://<account-id-number>.r2.cloudflarestorage.com/?list-type=2&prefix=<bucketname>%2Finternal_data%2Fattachments%2F52%2F52920-09fa37e7cc527ec2a4a5e0bb8b6be2ae.data%2F&max-keys=1"; AWS HTTP error: Server error: `GET https://<account-id-number>.r2.cloudflarestorage.com/?list-type=2&prefix=<bucketname>%2Finternal_data%2Fattachments%2F52%2F52920-09fa37e7cc527ec2a4a5e0bb8b6be2ae.data%2F&max-keys=1` resulted in a `501 Not Implemented` response: <?xml version="1.0" encoding="UTF-8"?><Error><Code>NotImplemented</Code><Message>ListBuckets search parameter list-type (truncated...) NotImplemented (server): ListBuckets search parameter list-type not implemented - <?xml version="1.0" encoding="UTF-8"?><Error><Code>NotImplemented</Code><Message>ListBuckets search parameter list-type not implemented</Message></Error> in src/addons/XFAws/_vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php at line 195
I'm giving up for now, but this is the last combo I tried. The error I'm getting doesn't make sense, because the add on uses ListObjectsV2 now and list-type should be supported....
Code:
$s3 = function()
{
return new \Aws\S3\S3MultiRegionClient([
'credentials' => [
'key' => ‘***’,
'secret' => ‘***’
],
'version' => 'latest',
'endpoint' => 'https://r2.cloudflarestorage.com'
]);
};
$config['fsAdapters']['data'] = function() use($s3)
{
return new \League\Flysystem\AwsS3v3\AwsS3Adapter($s3(), ‘<accountid>’, ‘<bucket>/data');
};
$config['externalDataUrl'] = function($externalPath, $canonical)
{
return 'https://cdn.***.com/data/' . $externalPath;
};
$config['fsAdapters']['internal-data'] = function() use($s3)
{
return new \League\Flysystem\AwsS3v3\AwsS3Adapter($s3(), ‘<accountid>, ‘<bucket>/internal_data');
};