2017 © Pedro PelĂĄez
 

typo3-cms-extension aus-driver-amazon-s3

Provides a FAL driver for the Amazon Web Service AWS S3.

image

andersundsehr/aus-driver-amazon-s3

Provides a FAL driver for the Amazon Web Service AWS S3.

  • Tuesday, July 17, 2018
  • by lagerregal
  • Repository
  • 4 Watchers
  • 7 Stars
  • 10,554 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 10 Forks
  • 10 Open issues
  • 20 Versions
  • 13 % Grown

The README.md

Packagist Release Packagist Downloads GitHub License Code Climate Contributors, (*1)

TYPO3 Extension: Amazon AWS S3 FAL driver (CDN)

This is a driver for the file abstraction layer (FAL) to support Amazon AWS S3., (*2)

You can create a file storage which allows you to upload/download and link the files to an AWS S3 bucket. It also supports the TYPO3 CMS image rendering., (*3)

Requires TYPO3 11.5 - 12.4, (*4)

Issue tracking: GitHub: AWS S3 FAL Driver, (*5)

Packagist: andersundsehr/aus-driver-amazon-s3, (*6)

Installation

  1. Install the TYPO3 extension via composer (recommended) or install the extension via TER (not recommended anymore).

Composer installation:, (*7)

composer require andersundsehr/aus-driver-amazon-s3
  
  1. Add a new file storage with the “AWS S3” driver to root page (pid = 0).
  2. Configure your file storage

Configuration

Driver Configuration

Add the following configurations:, (*8)

  • Bucket: The name of your AWS S3 bucket
  • Region: The region of your bucket (avoid dots in the bucket name)
  • Key and secret key of your AWS account (optional, you can also use IAM roles or environment variables)
  • Public base url (optional): this is the public url of your bucket, if empty its default to “bucketname.s3.amazonaws.com”
  • Protocol: network protocol (https://, http:// or auto detection)

Hint: Amazon AWS S3 bucket configuration

Make sure that your AWS S3 bucket is accessible to public web users., (*9)

For example add the following default permissions to “Edit bucket policy”:, (*10)

Example permissions:, (*11)

{
  "Version": "2008-10-17",
  "Statement": [
      {
          "Sid": "AddPerm",
          "Effect": "Allow",
          "Principal": "*",
          "Action": "s3:GetObject",
          "Resource": "arn:aws:s3:::bucketname/*"
      }
  ]
}

Extension Configuration

Edit in “Extension Manager” the following extension settings:, (*12)

  • dnsPrefetch Use DNS prefetching tag: If enabled, an HTML tag will be included which prefetchs the DNS of the current CDN
  • doNotLoadAmazonLib Don’t load Amazon AWS PHP SDK: If enabled, you have to include the SDK by yourself! (http://aws.amazon.com/de/sdk-for-php/)
  • enablePermissionsCheck Check S3 permissions for each file and folder. This is disabled by default because it is very slow (TYPO3 has to make an AWS request for each file)

Cache Configuration

Customizing TYPO3 Cache Backends

  • ausdriveramazons3_metainfocache retains metadata from AWS S3 on a per-object basis.
  • ausdriveramazons3_requestcache stores the complete response of a specific request, facilitating efficient data access and performance enhancement.

By default, these caches are transient. However, if you choose to configure a persistent cache backend, it's crucial to remember that such a cache will not automatically recognize changes from the data source. In this case, it becomes your responsibility to implement the necessary updates manually., (*13)

Detailed instructions on how to customize these cache backends can be found in the TYPO3 CachingFramework Configuration Guide. Remember, thorough testing is essential when modifying cache backends., (*14)

Example with simple file backend; all changes through TYPO3, (*15)

[
    'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class,
    'backend' => \TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend::class,
    'groups' => [
        'pages'
    ],
];

Example with redis, (*16)

[
    'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class,
    'backend' => \TYPO3\CMS\Core\Cache\Backend\RedisBackend::class,
    'options' => [
        'defaultLifetime' => 0, // infinite
        'database' => 0,
        'hostname' => 'redis',
        'port' => 6379,
    ],
];

Extend Extension

Initialize S3 Client

If you use your own Amazon AWS SDK, you may want to work with your own S3 client object., (*17)

So you have to use the following hook in your own ext_loaclconf.php:, (*18)

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aus_driver_amazon_s3']['initializeClient-preProcessing'][] = \Vendor\ExtensionName\Hooks\AmazonS3DriverHook::class . '->initializeClient';

A hook class might look like this:, (*19)

namespace Vendor\ExtensionName\Hooks;

class AmazonS3DriverHook {

  public function initializeClient(array &$params, $obj){
    $params['s3Client'] = MyAwsFactory::getAwsS3Client($params['configuration']);
  }
}

Initialize public base URL

You can set the public base URL in the configuration of your driver (TYPO3 backend). But maybe you want to set this on an other place., (*20)

So you have to use the following hook in your own ext_loaclconf.php:, (*21)

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aus_driver_amazon_s3']['initializeBaseUrl-postProcessing'][] = \Vendor\ExtensionName\Hooks\AmazonS3DriverHook::class . '->initializeBaseUrl';

A hook class might look like this:, (*22)

namespace Vendor\ExtensionName\Hooks;

class AmazonS3DriverHook {

  public function initializeBaseUrl(array &$params, $obj){
    $params['baseUrl'] = 'https://example.com';
  }
}

Cache Control Header

There is a default setting to set the cache control header's max age for all file types. If you want to use special cache headers, you can use this hook:, (*23)

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aus_driver_amazon_s3']['getCacheControl'][] = 'Vendor\ExtensionName\Hooks\AmazonS3DriverHook->getCacheControl';

You can modify the parameter "cacheControl" as you wish. Please Notice: AWS S3 set the cache header only once - while uploading / creating or copy the file., (*24)

More

If you wish other hooks - don’t be shy: GitHub issue tracking: Amazon S3 FAL Driver, (*25)

The Versions

17/07 2018

dev-master

9999999-dev

Provides a FAL driver for the Amazon Web Service AWS S3.

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

10/05 2018

1.7.1

1.7.1.0

Provides a FAL driver for the Amazon Web Service AWS S3.

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

31/03 2018

1.1.0

1.1.0.0

  Sources   Download

31/03 2018

1.2.0

1.2.0.0

  Sources   Download

31/03 2018

1.3.0

1.3.0.0

  Sources   Download

31/03 2018

1.3.1

1.3.1.0

  Sources   Download

31/03 2018

1.0.7

1.0.7.0

  Sources   Download

31/03 2018

1.0.8

1.0.8.0

  Sources   Download

16/02 2018

1.7.0

1.7.0.0 https://www.andersundsehr.com

Provides a FAL driver for the Amazon Web Service AWS S3.

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

16/02 2018

dev-feature/grumphp

dev-feature/grumphp https://www.andersundsehr.com

Provides a FAL driver for the Amazon Web Service AWS S3.

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

22/11 2017

1.6.0

1.6.0.0 https://www.andersundsehr.com

Provides a FAL driver for the Amazon Web Service AWS S3.

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

08/08 2017

1.5.5

1.5.5.0 https://www.andersundsehr.com

Provides a FAL driver for the Amazon Web Service AWS S3.

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

10/07 2017

1.5.4

1.5.4.0 https://www.andersundsehr.com

Provides a FAL driver for the Amazon Web Service AWS S3.

  Sources   Download

GPL-2.0+

The Requires

 

22/03 2017

1.5.3

1.5.3.0 https://www.andersundsehr.com

Provides a FAL driver for the Amazon Web Service AWS S3.

  Sources   Download

GPL-2.0+

The Requires

 

05/01 2017

1.5.2

1.5.2.0 https://www.andersundsehr.com

Provides a FAL driver for the Amazon Web Service AWS S3.

  Sources   Download

GPL-2.0+

The Requires

 

05/01 2017

1.5.1

1.5.1.0 https://www.andersundsehr.com

Provides a FAL driver for the Amazon Web Service AWS S3.

  Sources   Download

GPL-2.0+

The Requires

 

08/10 2016

1.5.0

1.5.0.0 https://www.andersundsehr.com

Provides a FAL driver for the Amazon Web Service AWS S3.

  Sources   Download

GPL-2.0+

The Requires

 

31/05 2016

1.4.0

1.4.0.0 https://www.andersundsehr.com

Provides a FAL driver for the Amazon Web Service S3.

  Sources   Download

GPL-2.0+

The Requires

 

16/11 2015

1.3.3

1.3.3.0 https://www.andersundsehr.com/blog/technik/typo3-performance-optimierung-durch-cdn

Provides a FAL driver for the Amazon Web Service S3.

  Sources   Download

GPL-2.0+

The Requires

 

16/11 2015

1.3.2

1.3.2.0 https://forge.typo3.org/projects/extension-aus_driver_amazon_s3

Provides a FAL driver for the Amazon Web Service S3.

  Sources   Download

The Requires