Enable Google Cloud Storage storage backend
Feature description
(This feature request began as a community forum post here.)
Google Cloud Storage provides a file hosting environment using approximately the same API as Amazon S3. The django-storages
package that Baserow uses to optionally interact with Amazon S3 also provides a Google Cloud Storage storage backend:
https://django-storages.readthedocs.io/en/latest/backends/gcloud.html
That backend requires a similar-but-different set of configuration variables be present in the Django configuration.
This feature request is to test if Google Cloud Storage can be enabled by modifying the Django configuration to set those variables from the corresponding environment variables, as is currently done for Amazon S3, e.g. something like this:
# baserow.config.settings.base
# Optional Google Cloud Storage storage configuration
if os.getenv("GS_BUCKET_NAME", "") != "":
DEFAULT_FILE_STORAGE = 'config.storage_backends.GoogleCloudMediaStorage'
GS_BUCKET_NAME = 'GS_BUCKET_NAME'
# "The storage must always overwrite existing files."
GS_FILE_OVERWRITE = True
if os.getenv("GS_PROJECT_ID", "") != "":
GS_PROJECT_ID = os.getenv("GS_PROJECT_ID")
if os.getenv("GS_CUSTOM_ENDPOINT", "") != "":
GS_CUSTOM_ENDPOINT = os.getenv("GS_CUSTOM_ENDPOINT")
if os.getenv("GS_DEFAULT_ACL", "") != "":
GS_CUSTOM_ENDPOINT = os.getenv("GS_DEFAULT_ACL")
if os.getenv("GS_QUERYSTRING_AUTH", "") != "":
GS_CUSTOM_ENDPOINT = os.getenv("GS_QUERYSTRING_AUTH")