craftcms/google-cloud

Google Cloud Storage integration for Craft CMS

Installs: 92 528

Dependents: 1

Suggesters: 0

Security: 0

Stars: 11

Watchers: 4

Forks: 10

Open Issues: 5

Type:craft-plugin

2.2.0 2024-03-21 18:21 UTC

README

This plugin provides a Google Cloud Storage integration for Craft CMS.

Requirements

This plugin requires Craft CMS 4.0.0+ or 5.0.0+.

Installation

You can install this plugin from the Plugin Store or with Composer.

From the Plugin Store

Go to the Plugin Store in your project’s Control Panel and search for “Google Cloud Storage”. Then click on the “Install” button in its modal window.

With Composer

Open your terminal and run the following commands:

# go to the project directory
cd /path/to/my-project.test

# tell Composer to load the plugin
composer require craftcms/google-cloud

# tell Craft to install the plugin
./craft plugin/install google-cloud

Setup

Your Google Cloud bucket must use Google's Fine grained (per object) permissions, not Uniform (per bucket).

On the permissions table for the new bucket, grant Storage Object Viewer to allUsers. The Storage Admin role should be granted to the service account the credentials are tied to.

To create a new asset volume for your Google Cloud Storage bucket, go to Settings → Assets, create a new volume, and set the Volume Type setting to “Google Cloud Storage”.

Tip: The Project ID, Bucket, and Subfolder settings can be set to environment variables. See Environmental Configuration in the Craft docs to learn more about that.