PHPackages                             obj63mc/silverstripe-google-cloud-storage - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. obj63mc/silverstripe-google-cloud-storage

ActiveSilverstripe-vendormodule[File &amp; Storage](/categories/file-storage)

obj63mc/silverstripe-google-cloud-storage
=========================================

SilverStripe module to store assets in Google Cloud Storage rather than on the local filesystem.

1.1.1(4y ago)113.3k6[1 PRs](https://github.com/obj63mc/silverstripe-google-cloud-storage/pulls)MITPHP

Since Jan 31Pushed 2y ago2 watchersCompare

[ Source](https://github.com/obj63mc/silverstripe-google-cloud-storage)[ Packagist](https://packagist.org/packages/obj63mc/silverstripe-google-cloud-storage)[ RSS](/packages/obj63mc-silverstripe-google-cloud-storage/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (5)Versions (8)Used By (0)

silverstripe-google-cloud-storage
=================================

[](#silverstripe-google-cloud-storage)

SilverStripe module to store assets in Google Cloud Storage rather than on the local filesystem.

Note: This is a pre-release, and does not implement any kind of bucket policy for protected assets. There is an example ACL for public/protected assets [here](./acl-examples.md)

This was initially based off of

Environment setup
-----------------

[](#environment-setup)

The module requires a few environment variables to be set. These are mandatory.

- `GC_KEY_FILE`: JSON of your google service account json file
- `GC_BUCKET_NAME`: The name of the cloud storage bucket bucket to store assets in.

For the GC\_KEY\_FILE environment variable, simply copy all contents into one line and place in your .env file like -

```
    GOOGLE_KEY_FILE={"type": "service_account","project_id": ...

```

Installation
------------

[](#installation)

- Define the environment variables listed above.
- [Install Composer from https://getcomposer.org](https://getcomposer.org/download/)
- Run `composer require obj63mc/silverstripe-google-cloud-storage`

This will install the most recent applicable version of the module given your other Composer requirements.

**Note:** This currently immediately replaces the built-in local asset store that comes with SilverStripe with one based on Google Cloud Storage. Any files that had previously been uploaded to an existing asset store will be unavailable (though they won't be lost - just run `composer remove obj63mc/silverstripe-google-cloud-storage` to remove the module and restore access).

Configuration
-------------

[](#configuration)

Assets are classed as either 'public' or 'protected' by SilverStripe. Public assets can be freely downloaded, whereas protected assets (e.g. assets not yet published) shouldn't be directly accessed.

'public' assets are stored by default in a directory called 'public' in the root of your bucket. If you would like to change this prefix/path simply update the environment variable of `GC_PUBLIC_BUCKET_PREFIX`. You will want to configure this folder and any assets under it to have an ACL that anyone can read.

'protected' assets are stored by default in a directory called 'protected' in the root of your bucket. If you would like to change this prefix/path simply update the environment variable of `GC_PROTECTED_BUCKET_PREFIX`. You will want to configure this folder to be private and only your google project admins and the account service key have admin access.

Configuring Google Cloud Storage Bucket
---------------------------------------

[](#configuring-google-cloud-storage-bucket)

This is an example for setting up your Google Cloud Storage Bucket. This assumes you have Google Cloud SDK and command line tools installed.

1. Create the Bucket - `gsutil mb gs://[BUCKET_NAME]/`
2. Get the default ACL, you will need the project id from the ACL `gsutil acl get gs://[BUCKET_NAME]/`
3. Set the bucket so your service account key can access the bucket (note only needed if not running on google app engine or cloud compute). Replace \[YOUR\_ACCOUNT\_NAME\]/the email address with your service account key email address.

    ```
     gsutil defacl ch -u gcloud-[YOUR_ACCOUNT_NAME]@appspot.gserviceaccount.com:OWNER gs://[BUCKET_NAME]
     gsutil acl ch -u gcloud-[YOUR_ACCOUNT_NAME]@appspot.gserviceaccount.com:OWNER gs://[BUCKET_NAME]

    ```
4. Lets create the 'public' folder and set it so anyone can read it.

    ```
     touch test.txt
     gsutil cp test.txt gs://[BUCKET_NAME]/public
     gsutil acl ch -r -u AllUsers:R gs://[BUCKET_NAME]/public

    ```

Your bucket should now be configured and have proper protected/public folders for your assets.

Auto Generated Assets from the CMS (Tinymce.js/Error Pages)
-----------------------------------------------------------

[](#auto-generated-assets-from-the-cms-tinymcejserror-pages)

### TinyMCE

[](#tinymce)

Currently anytime you run a flush on your site and access the CMS, new versions of tinymce code and other JS may be outputted to your assets directory. Instead of referencing these from your cloud storage, this module now includes an adapter to make sure this stays on the local filesystem as intended.

### ErrorPages - currently error pages static files will be uploaded to GCS. Due to this you would need to update the path that these are generated to by editing your main sites config .yml file, default set from this project is:

[](#errorpages---currently-error-pages-static-files-will-be-uploaded-to-gcs--due-to-this-you-would-need-to-update-the-path-that-these-are-generated-to-by-editing-your-main-sites-config-yml-file-default-set-from-this-project-is)

```
    SilverStripe\ErrorPage\ErrorPage:
        store_filepath: 'error-pages'

```

You can also turn off the static file generation via -

```
    SilverStripe\ErrorPage\ErrorPage:
      enable_static_file: false

```

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~206 days

Recently: every ~258 days

Total

6

Last Release

1618d ago

Major Versions

0.1.0 → 1.0.02019-03-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/7b58123837a8364d4ff51b9e31f46aecac3667a74a12e01a061a5c75484668f4?d=identicon)[obj63mc](/maintainers/obj63mc)

---

Top Contributors

[![obj63mc](https://avatars.githubusercontent.com/u/443120?v=4)](https://github.com/obj63mc "obj63mc (10 commits)")

### Embed Badge

![Health badge](/badges/obj63mc-silverstripe-google-cloud-storage/health.svg)

```
[![Health](https://phpackages.com/badges/obj63mc-silverstripe-google-cloud-storage/health.svg)](https://phpackages.com/packages/obj63mc-silverstripe-google-cloud-storage)
```

###  Alternatives

[silverstripe/framework

The SilverStripe framework

7213.5M2.5k](/packages/silverstripe-framework)[bummzack/sortablefile

An extension for SilverStripe that adds sorting to UploadField.

70622.7k54](/packages/bummzack-sortablefile)[silverstripe/asset-admin

Asset management for the SilverStripe CMS

192.5M79](/packages/silverstripe-asset-admin)[unclecheese/dropzone

An HTML5 upload field for the CMS and frontend forms.

46130.7k6](/packages/unclecheese-dropzone)[silverstripe/s3

Adds SilverStripe support for using the S3 adapter for Flysystem

20297.0k1](/packages/silverstripe-s3)[axllent/silverstripe-scaled-uploads

Automatically scale down and rotate uploaded images for Silverstripe

2580.3k8](/packages/axllent-silverstripe-scaled-uploads)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
