outeredge / googlecloudstorage
Google Cloud Storage integration for Magento.
Installs: 24 142
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 6
Type:magento2-module
Requires
- google/cloud-storage: ~1.43.1
- magento/framework: ^103
- magento/module-media-storage: ^100
- magento/module-store: ^101
- outeredge/magento-base-module: >=2.6.33
- psr/http-message: >=1.0
- psr/log: >=1.0
- dev-outeredge
- 2.0.28
- 2.0.27
- 2.0.26
- 2.0.25
- 2.0.24
- 2.0.23
- 2.0.22
- 2.0.21
- 2.0.20
- 2.0.19
- 2.0.18
- 2.0.17
- 2.0.16
- 2.0.15
- 2.0.14
- 2.0.13
- 2.0.12
- 2.0.11
- 2.0.10
- 2.0.9
- 2.0.8
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.2.x-dev
- 1.2.0.26
- 1.2.0.25
- 1.2.0.24
- 1.2.0.23
- 1.2.0.22
- 1.2.0.21
- 1.2.0.20
- 1.2.0.19
- 1.2.0.18
- 1.2.0.17
- 1.2.0.16
- 1.2.0.15
- 1.2.0.14
- 1.2.0.13
- 1.2.0.12
- 1.2.0.11
- 1.2.0.10
- 1.2.0.9
- 1.2.0.8
- 1.2.0.7
- 1.2.0.6
- 1.2.0.5
- 1.2.0.4
- 1.2.0.3
- 1.2.0.2
- 1.2.0.1
- 1.2.0
- 1.1.0
- 1.0.1
- 1.0.0
- dev-fix-empty-gallery-updatedata-callback
- dev-bensinca-fix-for-breeze-hyva
- dev-php8
- dev-fix-classlist-undefined
- dev-update-image-catcher
- dev-master
This package is auto-updated.
Last update: 2024-11-23 10:18:43 UTC
README
Description
Use Google Cloud Storage to store media assets in Magento.
Installation
We highly recommend installing via Composer for package management.
composer require auroraextensions/googlecloudstorage
Configuration
Once installed, update the environment configuration file. See env.php.sample for an example. The following information should be readily available:
- Google Cloud project ID
- Path to the Google Cloud service account JSON key file. See Service Account for more details.
- Google Cloud Storage bucket name
- Google Cloud Storage bucket region (if applicable)
Next, enable the module with the Magento autoloader.
php bin/magento module:enable AuroraExtensions_GoogleCloudStorage
Synchronization
You can initiate the bulk synchronization process through the Magento backend, just as you would with any other media storage configuration. Additionally, you can initiate the bulk synchronization process from the command line using the provided synchronization CLI command.
php bin/magento gcs:media:sync
IMPORTANT: This process can be very slow, especially if you have a lot of media files.
Service Account
For the purposes of authenticating with Google Cloud Platform, this module leverages the flexibility and ease of use provided by Google Cloud service accounts. Before moving forward, please make sure to complete the following:
- Create a Google Cloud service account with Storage Admin privileges. Once the service account is created, you will be prompted to download a JSON key file. Store this key file in a safe place.
- Install the service account JSON key file to the local or mounted filesystem with read-only permissions for the Magento user.
- Verify the following fields are set and correct in the environment configuration file (env.php):
- All required fields
- The Google Cloud project name is where the bucket exists
- The path to the Google Cloud service account JSON key file (e.g. /etc/gcs.json). Relative paths are assumed to be relative to the Magento root directory.
- [OPTIONAL] If you use the same bucket for multiple projects, you can specify a subdirectory to synchronize to inside the bucket. By default, it will synchronize to /.
For more information on Google Cloud service account keys, please see Creating and Managing Service Account Keys.
For an example configuration file, please see env.php.sample.
Troubleshooting
Given keyfile at path /path/to/magento was invalid
You need to create and install a service account key to authenticate with Google Cloud. See Service Account for specific details on Google Cloud service accounts.