$s3 = function()
{
return new \Aws\S3\S3Client([
'credentials' => [
'key' => 'xxxxxxxxxxxx',
'secret' => 'xxxxxxxxxxxxx'
],
'region' => 'us-east-1',
'version' => 'latest',
'endpoint' => 'https://s3.us-east-1.amazonaws.com'
]);
};
$config['fsAdapters']['data'] = function() use($s3)
{
return new \League\Flysystem\AwsS3v3\AwsS3Adapter($s3(), 'xxxxxx', 'data');
};
$config['externalDataUrl'] = function($externalPath, $canonical){
return 'https://xxxx.s3.us-east-1.amazonaws.com/data/' . $externalPath;
};
$config['fsAdapters']['internal-data'] = function() use($s3)
{
return new \League\Flysystem\AwsS3v3\AwsS3Adapter($s3(), 'xxx', 'internal_data');
};
could you help out ... i can get the old data to show on my site..Amazing easy install. Just did it in my test env before switching this weekend finally to XF2.1.
One question. I would like to add an own domain via Cloudflare to the S3 bucket for delivering the files from the data folder form my domain.
Is this possible?
yes. iirc, you create a cname of your choice and connect it to the bucket url. and then replace the url in config file to match that subdomain. works very well as you can then set cloudflare to cache this parth using page rules.Is this possible?
$config['externalDataUrl'] = function($externalPath, $canonical)
{
return 'https://BUCKETNAME.s3.ap-southeast-1.amazonaws.com/data/' . $externalPath;
};
https://BUCKETNAME.s3.ap-southeast-1.amazonaws.com
. and then replace the line in the above code to... https://cdn.yourdomain.tld/data/
. (correct the s3 datacenter part!)You need to copy the old files to the bucket.I can have new uploaded files to work but the old files like avatar and attachment don't work
PHP:$s3 = function() { return new \Aws\S3\S3Client([ 'credentials' => [ 'key' => 'xxxxxxxxxxxx', 'secret' => 'xxxxxxxxxxxxx' ], 'region' => 'us-east-1', 'version' => 'latest', 'endpoint' => 'https://s3.us-east-1.amazonaws.com' ]); }; $config['fsAdapters']['data'] = function() use($s3) { return new \League\Flysystem\AwsS3v3\AwsS3Adapter($s3(), 'xxxxxx', 'data'); }; $config['externalDataUrl'] = function($externalPath, $canonical){ return 'https://xxxx.s3.us-east-1.amazonaws.com/data/' . $externalPath; }; $config['fsAdapters']['internal-data'] = function() use($s3) { return new \League\Flysystem\AwsS3v3\AwsS3Adapter($s3(), 'xxx', 'internal_data'); };
has anyone got this to work with amazon s3 .. just move the data folder and interna_data but still my images are still broken
code_cache
, that continue to be and are required to be stored locally for XF to run.We use essential cookies to make this site work, and optional cookies to enhance your experience.