Code Monkey home page Code Monkey logo

googlecloudstorage's Introduction

Google Cloud Storage

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:

  1. Google Cloud project ID
  2. Path to the Google Cloud service account JSON key file. See Service Account for more details.
  3. Google Cloud Storage bucket name
  4. 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:

  1. 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.
  2. Install the service account JSON key file to the local or mounted filesystem with read-only permissions for the Magento user.
  3. Verify the following fields are set and correct in the environment configuration file (env.php):
    1. All required fields
    2. The Google Cloud project name is where the bucket exists
    3. 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.
    4. [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.

googlecloudstorage's People

Contributors

nickolasburr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.