-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add documentation for media storage filesystem
- Loading branch information
George Babarus
committed
May 24, 2020
0 parents
commit 906b317
Showing
33 changed files
with
893 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
venv | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
.. role:: raw-html-m2r(raw) | ||
:format: html | ||
|
||
Magento file (cloud) storage systems integration for media files | ||
=================================================================== | ||
|
||
Storing media files involve some work when you decide to scale horizontally. | ||
Also having to care about disk space and disk mounting may be useless when you are already have a easy to use object storage service. | ||
|
||
There are plenty of cloud static files storage services offered with various feature but most of them have same basic ideas: | ||
|
||
* allow secure upload remotely of files | ||
* deliver static file public or privately | ||
* built in Content delivery network (CDN) | ||
|
||
With this idea in mind you can identify a use-case for e-commerce website for storing images and video for products, categories or CMS pages and deliver them using a CDN. Or even storing private content like downloadable products. | ||
|
||
Using cloud storage should be easy to configure and use, ans should not add additional complexity to the system but on contrary. | ||
|
||
Reed the documentation https://magento-filesystem-extension-docs.readthedocs.io to see some of the key advantages of using this Magento 2 extension to integrate with various cloud file storage systems in a platform agnostic manner. | ||
|
||
|
||
Useful links | ||
============ | ||
|
||
Read more about Object Storage services online: | ||
|
||
* Amazon Simple Storage Service S3 | ||
https://docs.aws.amazon.com/s3/index.html | ||
* Azure Cloud File Storage/Blob storage | ||
https://azure.microsoft.com/en-us/services/storage/blobs | ||
* Google Cloud Storage | ||
https://cloud.google.com/storage | ||
* Digital Ocean Block Storage | ||
https://www.digitalocean.com/products/block-storage/ | ||
* Linode Object storage | ||
https://www.linode.com/products/object-storage/ | ||
|
||
Read more about CDN: | ||
|
||
* Amazon CloudFront | ||
https://aws.amazon.com/cloudfront/ | ||
* Azure CDN | ||
https://docs.microsoft.com/en-us/azure/cdn/ | ||
* Akamai | ||
https://www.akamai.com/ | ||
|
||
|
||
Author | ||
====== | ||
|
||
`George Babarus <https://github.com/georgebabarus>`_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=source | ||
set BUILDDIR=build | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.http://sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line. | ||
SPHINXOPTS = | ||
SPHINXBUILD = sphinx-build | ||
SPHINXPROJ = ReadtheDocsSphinxTheme | ||
SOURCEDIR = . | ||
BUILDDIR = ./../build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!-- Global site tag (gtag.js) - Google Analytics --> | ||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-54395432-3"></script> | ||
<script> | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
|
||
gtag('config', 'UA-54395432-3'); | ||
</script> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% extends "!layout.html" %} | ||
|
||
|
||
{% block extrahead %} | ||
{{ super() }} | ||
<meta name="google-site-verification" content="HFkKCMbj7JNJkz8cCQcdI-1wvQzt9G5yxqEGKhT9dW0" /> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
|
||
******************************************* | ||
Extension architecture | ||
******************************************* | ||
|
||
.. include:: ../messages.rst | ||
|
||
.. note:: | ||
Before going deeper into the development details, please note that the this Magento 2 module is extending core module interfaces, keeping in mind the backward compatibility and keeping the changes as low asa possible. | ||
|
||
.. contents:: Table of Contents | ||
|
||
Upload images in admin area | ||
================================ | ||
|
||
Uploading files form user interfaces or programmatically at product should be compatible with any customization as log as is using Magento standard interfaces. | ||
|
||
Nevertheless the business logic is not changed, and cloud storage services are added using regular/local filesystem interface. | ||
|
||
.. image:: static/upload-image.jpg | ||
:alt: Upload image for product or CMS blocks | ||
|
||
.. note:: | ||
Uploading products attachments for downloadable products works just like uploading the product image showed in the above schema. | ||
|
||
.. note:: | ||
Features: :term:`WOOB` :term:`v0.0.1` | ||
|
||
|
||
Frontend resized image delivery | ||
================================ | ||
|
||
Resized images could be delivered directly from storage system after creating the resized image in the main request or return a proxy url responsible to return the image if not exist. | ||
|
||
The proxy can be implemented as follow: | ||
|
||
* nginx config to request it from storage system and create a fallback request in case of error on Magento resize script | ||
* in case you don't have access to a web server proxy configuration there is a option to return it directly from default Magento image resize script. | ||
|
||
.. image:: static/frontend-image-delivery.jpg | ||
:alt: Upload image for product or CMS blocks | ||
|
||
.. note:: | ||
:term:`SWSCNO` :term:`v0.0.1` | ||
|
||
|
||
Frontend image delivery for original images | ||
============================================ | ||
|
||
Original images could be delivered directly from storage system, or the CDN in front of it, by configuring the base media url in admin configuration under Store -> Configuration. | ||
|
||
.. note:: | ||
:term:`WOOB` :term:`v0.0.1` | ||
|
||
.. raw:: html | ||
:file: ./../_static/analytics.html |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.