This plugin requires Craft CMS 3.3.0 or later, and Imager X 3.0 or later. External storages are only available in the Pro edition of Imager.
To install the plugin, follow these instructions.
Open your terminal and go to your Craft project:
Then tell Composer to load the plugin:
composer require RedEyeDevelopment/imager-x-storage-driver-for-fort-rabbit
In the Control Panel, go to Settings → Plugins and click the “Install” button for Imager X Storage Driver for FortRabbit.
Configure the storage driver by adding new key named
fortrabbit to the
storagesConfig config setting in your imager-x.php config file, with the following configuration:
'storageConfig' => [ 'fortrabbit' => [ 'endpoint' => '', 'accessKey' => '', 'secretAccessKey' => '', 'region' => '', 'bucket' => '', 'folder' => '', 'requestHeaders' => array(), ] ],
Enable the storage driver by adding the key
fortrabbit to Imager's
storages config setting:
'storages' => ['fortrabbit'],
Here's an example config, note that the endpoint has to be a complete URL with scheme, and as always you need to make sure that
imagerUrl is pointed to the right location:
'imagerUrl' => 'https://SUBDOMAIN.objects.frb.io/transforms/', 'storages' => ['fortrabbit'], 'storageConfig' => [ 'fortrabbit' => [ 'endpoint' => 'https://objects.us1.frbit.com', 'accessKey' => 'MYACCESSKEY', 'secretAccessKey' => 'MYSECRETKEY', 'region' => 'us-east-1', 'bucket' => 'MYBUCKET', 'folder' => 'transforms', 'requestHeaders' => array(), ] ],
Also remember to always empty your Imager transforms cache when adding or removing external storages, as the transforms won't be uploaded if the transform already exists in the cache.