Skip to content

Commit

Permalink
add new inforamtion about s3 integration + meta tags and links
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebabarus committed Sep 10, 2020
1 parent 343404c commit ad12f50
Show file tree
Hide file tree
Showing 10 changed files with 263 additions and 56 deletions.
5 changes: 5 additions & 0 deletions docs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ What is covered with this extensions?

Currently there are 6 Magento modules developed to achieve fully abstracted filesystem implementation:

.. warning::

All extension are available on `Magento Marketplace <https://marketplace.magento.com/>`_.
`Read more about what you should purchase and install <https://docs.magento.asset42.com/en/latest/extension/installation.html>`_

* Bb_Storage is the core module implementing most of business logic:

* directories mapping
Expand Down
23 changes: 23 additions & 0 deletions docs/source/all-pages/available-links.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

.. _ShopS3: https://marketplace.magento.com/
.. _ShopStorage: https://marketplace.magento.com/
.. _ShopOverwrites: https://marketplace.magento.com/

.. |ShopS3Marketplace| raw:: html

<a href="https://marketplace.magento.com/" target="_blank">Magento Marketplace</a>


.. |ShopBb_StorageS3Marketplace| raw:: html

<a href="https://marketplace.magento.com/" target="_blank">Bb_StorageS3</a>


.. |ShopBb_StorageMarketplace| raw:: html

<a href="https://marketplace.magento.com/" target="_blank">Bb_Storage</a>


.. |ShopBb_StorageOverwritesMarketplace| raw:: html

<a href="https://marketplace.magento.com/" target="_blank">Bb_StorageOverwrites</a>
32 changes: 30 additions & 2 deletions docs/source/amazon-s3/integration.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,42 @@

.. meta::
:description lang=en:
Getting started with Magento 2 and Amazon S3 filesystem integration

.. meta::
:keywords lang=en:
file storage service, cloud, integration, amazon s3

*********************
Amazon S3 integration
*********************

Integrating Amazon S3 filesystem in Magento is available by installing the package bb/mage-file-storage-s3 containing the module named Bb_StorageS3.

Note that this module depends on the main module bb/mage-file-storage to be able to properly configure the connection and define new directories or mapping or existing directories.


.. include:: ./../messages.rst
.. contents:: Table of Contents

Magento S3 API driver
=====================

For now only S3 storage service is supported by this filesystem extension, but many will integration extensions will be available to purchase soon.
All the news about extension road-map will be published on here.

Magento S3 Driver Extension
===========================

For Amazon S3 storage service integration in Magento you will need to purchase an additional extension available on |ShopS3Marketplace|

The package depends on aws/aws-sdk-php: 3.x and bb/mage-file-storage: 1.x, so if you install it from source you also need to install those package.

After installation follow the general configuration process :ref:`available here.<configuration>`

Demo
=====

:ref:`You can find more information in the general demo page. <demo>`



.. include:: ./../all-pages/available-links.rst
8 changes: 8 additions & 0 deletions docs/source/custom-development/extensibility.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
.. meta::
:description lang=en:
Extensibility for Magento 2 filesystem integration feature

.. meta::
:keywords lang=en:
file storage service, cloud, integration, extension

*************
Extensibility
*************
Expand Down
4 changes: 4 additions & 0 deletions docs/source/extension/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
Architecture
****************

Find some ideas related to Magento architecture and the possible solutions for extracting static files to a external filesystem service.

Take this architecture documentation page as a guideline, and not as a part provided by this extensions.

.. include:: ./../messages.rst

.. note::
Expand Down
179 changes: 127 additions & 52 deletions docs/source/extension/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
Configuration
*************

For now available configuration are inserted into the deployment config file /etc/env.php since there are deployment related configs like database connection and are mandatory.

Mainly the configuration consists of 3 components:

* driver_configs which are configurations related to connection to the filesystem provider

* directories -> mapping - in this path you will be able to define new directories paths or overwrite existing ones under ./pub directory

* directories -> configs - in this path you can configure additional settings related to specified directory and driver. eg: custom endpoint delivery path


.. include:: ./../messages.rst

.. contents:: Table of Contents
Expand All @@ -28,29 +39,48 @@ The feature flag for media storage is media_storage/enabled.
[
'media_storage' => [
'enabled' => true,
'directories' => [
'enabled' => true,
'directories' => [
'mapping' => [
'media' => [
'main_connection' => 's3_public',
'connections' => [
'main_driver' => 's3_lo',
'driver_configs' => [
'file' => 'file',
'bbS3' => 's3_public'
's3' => 's3_lo'
],
'directories' => [
'directories' => [
'catalog' => [
'main_driver' => 's3_lo',
'driver_configs' => [
'file' => 'file',
's3' => 's3_lo'
],
'directories' => [
'product/cache' => [
'main_driver' => 's3_lo'
]
]
],
'downloadable' => [
'main_connection' => 's3_private',
'connections' => [
'main_driver' => 's3_aws',
'driver_configs' => [
'file' => 'file',
'bbS3' => 's3_private'
's3' => 's3_lo'
]
]
],
'invalid-mapping' => [
'main_driver' => 'invalid-mapping',
],
'other' => [
'main_driver' => 'file'
],
'empty-mapping' => []
]
]
],
'configs' => [
'media' => [
's3_public' => [
's3_lo' => [
'directory_prefix' => 'media',
'reverse_proxy_path' => 'lo-proxy',
'overwrite_base_url' => true,
Expand All @@ -60,55 +90,100 @@ The feature flag for media storage is media_storage/enabled.
]
]
],
'media/catalog' => [
's3_lo' => [
'directory_prefix' => 'media/catalog',
'overwrite_base_url' => true,
'reverse_proxy_path' => 'lo-proxy',
'fallback_directory' => [
'directory_code' => 'media',
'driver_code' => 'file'
]
]
],
'media/catalog/product/cache' => [
's3_lo' => [
'directory_prefix' => 'media/catalog/product/cache',
'overwrite_base_url' => true,
'reverse_proxy_path' => 'lo-proxy',
'fallback_directory' => [
'directory_code' => 'media',
'driver_code' => 'file'
]
]
],
'media/downloadable' => [
's3_private' => [
's3_aws' => [
'directory_prefix' => 'media/downloadable',
'overwrite_base_url' => false,
'reverse_proxy_path' => '',
'overwrite_base_url' => true,
'reverse_proxy_path' => 'aws-proxy',
'fallback_directory' => [
'directory_code' => 'media',
'driver_code' => 'file'
]
]
],
'media/other' => [
'file' => [
'directory_prefix' => 'media/other',
]
],
'media/invalid-mapping' => [
'invalid-mapping' => [
]
]
]
],
'connections' => [
's3_private' => [
'driver_code' => 'bbS3',
'driver' => 'Bb\\StorageS3\\Filesystem\\Driver\\S3',
'stream_code' => 's31',
'region' => 'us-east-1',
'bucket' => '<PRIVATE_BUCKET>',
'driver_configs' => [
's3_do' => [
'driver_code' => 's3',
'stream_code' => 's3m',
'region' => 'fra1',
'bucket' => 'testbb',
'credentials' => [
'key' => 'minio',
'secret' => 'minio123'
'key' => '',
'secret' => ''
],
'endpoint' => [
'origin' => 'http://minio:9000',
'frontend' => 'http://127.0.0.1:9000/<PRIVATE_BUCKET>',
'origin' => 'https://fra1.digitaloceanspaces.com',
'frontend' => 'https://fra1.digitaloceanspaces.com/testbb',
],
'debug' => true
],
's3_public' => [
'driver_code' => 'bbS3',
'driver' => 'Bb\\StorageS3\\Filesystem\\Driver\\S3',
'stream_code' => 's31',
's3_aws' => [
'driver_code' => 's3',
'stream_code' => 's3m',
'region' => 'eu-central-1',
'bucket' => 'magento.storage',
'credentials' => [
'key' => '',
'secret' => ''
],
'endpoint' => [
'origin' => 'https://s3.eu-central-1.amazonaws.com',
'frontend' => 'https://s3.eu-central-1.amazonaws.com',
],
'debug' => true
],
's3_lo' => [
'driver_code' => 's3',
'stream_code' => 's3l',
'region' => 'us-east-1',
'bucket' => '<PUBLIC_BUCKET>',
'bucket' => 'testbb',
'credentials' => [
'key' => 'minio',
'secret' => 'minio123'
],
'endpoint' => [
'origin' => 'http://minio:9000',
'frontend' => 'http://127.0.0.1:9000/<PUBLIC_BUCKET>',
'frontend' => 'http://127.0.0.1:9000/testbb',
],
'debug' => true
],
]
]
]
]
];
.. _configuration/directory_mapping:

Expand All @@ -121,18 +196,19 @@ Directory mapping link a specific path (eg: media/download from below example) t
[
'media_storage' => [
'directories' => [
'enabled' => true,
'directories' => [
'mapping' => [
'media' => [
'main_connection' => 's3_public',
'connections' => [
'main_driver' => 's3_lo',
'driver_configs' => [
'file' => 'file',
'bbS3' => 's3_public'
's3' => 's3_lo'
],
'directories' => [
'directories' => [ // this are subdirectories
'downloadable' => [
'main_connection' => 's3_private',
'connections' => [
'main_driver' => 's3_private', // other driver config identifier here
'driver_configs' => [
'file' => 'file',
'bbS3' => 's3_private'
]
Expand Down Expand Up @@ -199,23 +275,22 @@ Connection details may be different depending on the Driver used for the service
[
'media_storage' => [
'connections' => [
's3_private' => [
'driver_code' => 'bbS3',
'driver' => 'Bb\\StorageS3\\Filesystem\\Driver\\S3',
'stream_code' => 's31', # should be at most 3 letters.
'region' => 'us-east-1',
'bucket' => '<PRIVATE_BUCKET>',
'driver_configs' => [
's3_do' => [
'driver_code' => 's3', // Driver code registered by driver nodule
'stream_code' => 's3m', // this is a stream code, some modules need it. use 3 letters code unique per connection
'region' => 'fra1',
'bucket' => 'testbb',
'credentials' => [
'key' => 'minio',
'secret' => 'minio123'
'key' => '',
'secret' => ''
],
'endpoint' => [
'origin' => 'http://minio:9000',
'frontend' => 'http://127.0.0.1:9000/<PRIVATE_BUCKET>',
'origin' => 'https://fra1.digitaloceanspaces.com',
'frontend' => 'https://fra1.digitaloceanspaces.com/testbb',
],
'debug' => true
]
],
]
]
]
Expand Down
9 changes: 9 additions & 0 deletions docs/source/extension/demo.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _demo:

.. meta::
:description lang=en:
File Storage Demo of Amazon S3 storage integration into Magento 2.
Expand All @@ -10,6 +12,13 @@
Demo
************

This demo page will guide you through main features affected by media files relocation. In this scenario the extension is configured to map pub/media file to external filesystem.

Even if there are some configuration needed, maybe some changes in codebase, the overall system should become more robust after a proper configuration.

Keep in mind that depending on the implementation of a 3rd party extension it may brake during the configuration of magento core directories mapping to external filesystems.


.. include:: ./../messages.rst
.. contents:: Table of Contents

Expand Down

0 comments on commit ad12f50

Please sign in to comment.