Skip to content

Google Cloud setup

Eric Carmichael edited this page Apr 10, 2018 · 13 revisions

NOTE: You need to be on the google-cloud-storage branch to use Google Cloud Storage

Storage setup

Create 2 buckets, 1 public and 1 private, for example:

  • coda-private
  • coda-public

coda-private

Set bucket permissions so it is not publicly readable.

Set this CORS configuration:

[
    {
        "origin": ["*"],
        "responseHeader": ["Content-Type"],
        "method": ["GET", "PUT", "OPTIONS", "HEAD"],
        "maxAgeSeconds": 3600
    }
]

coda-public

Set the public to publicly readable by all users:

image

Configure the project

Add these lines to your .env, replacing any other storage configuration:

# Google Cloud Storage
DEFAULT_FILE_STORAGE=apps.web.storage.CodalabGoogleCloudStorage
GS_PUBLIC_BUCKET_NAME=coda-public
GS_PRIVATE_BUCKET_NAME=coda-private
GOOGLE_APPLICATION_CREDENTIALS=/app/certs/google-storage-api.json

This assumes your google-storage-api.json api credentials are in the <project root>/certs directory.

Clone this wiki locally