Skip to content

A Google App Engine microservice for uploading files to Google Cloud Storage

License

Notifications You must be signed in to change notification settings

grow/grow-ext-file-upload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grow-ext-file-upload

Build Status

A Google App Engine microservice to support file uploads for static websites.

Concept

  1. The microservice uses the App Engine app's identity to create a temporary signed URL. The upload destination is validated and and normalized.
  2. The frontend uses the signed URL to upload the file directly to Google Cloud Storage.
  3. The frontend can then, separately record the uploaded destination (i.e. by submitting it through a form).

Usage

  1. Clone this repository.
  2. Use make project=GCP_PROJECT deploy to deploy a standalone service.
  3. Ensure the CORS policy is updated: make bucket=BUCKET cors. (Update cors-policy.json to restrict origins.)

By default, files are uploaded to:

/{application-default bucket}/grow-ext-file-upload/{timestamp}/{file}.{ext}

The upload destination can be customized by using env variables:

  • GROW_FILE_UPLOAD_BUCKET – Override the bucket
  • GROW_FILE_UPLOAD_FOLDER – Override the subfolder

Ensure the application-default service account has access to create files in the appropriate bucket.

About

A Google App Engine microservice for uploading files to Google Cloud Storage

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published