Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Using bucket's default object ACL

rhoboro464973489e9f
diff --git a/docs/topics/media-pipeline.rst b/docs/topics/media-pipeline.rst
index 284ec1a25..0872ac0cd 100644
--- a/docs/topics/media-pipeline.rst
+++ b/docs/topics/media-pipeline.rst
@@ -209,7 +209,8 @@ For information about authentication, see this `documentation`_.
You can modify the Access Control List (ACL) policy used for the stored files,
which is defined by the :setting:`FILES_STORE_GCS_ACL` and
:setting:`IMAGES_STORE_GCS_ACL` settings. By default, the ACL is set to
-``projectPrivate``. To make the files publicly available use the ``publicRead``
+None which means that Cloud Storage applies the bucket's default object ACL to the object.
+To make the files publicly available use the ``publicRead``
policy::
IMAGES_STORE_GCS_ACL = 'publicRead'
diff --git a/scrapy/pipelines/files.py b/scrapy/pipelines/files.py
index af1d5488a..8ea70e5d1 100644
--- a/scrapy/pipelines/files.py
+++ b/scrapy/pipelines/files.py
@@ -207,8 +207,10 @@ class GCSFilesStore(object):
GCS_PROJECT_ID = None
CACHE_CONTROL = 'max-age=172800'
- POLICY = 'projectPrivate' # Overriden from settings.FILES_STORE_GCS_ACL in
- # FilesPipeline.from_settings.
+
+ # The bucket's default object ACL will be applied to the object.
+ # Overriden from settings.FILES_STORE_GCS_ACL in FilesPipeline.from_settings.
+ POLICY = None
def __init__(self, uri):
from google.cloud import storage
diff --git a/scrapy/settings/default_settings.py b/scrapy/settings/default_settings.py
index 7916b9704..d7ca8a835 100644
--- a/scrapy/settings/default_settings.py
+++ b/scrapy/settings/default_settings.py
@@ -159,7 +159,7 @@ FEED_EXPORTERS_BASE = {
FEED_EXPORT_INDENT = 0
FILES_STORE_S3_ACL = 'private'
-FILES_STORE_GCS_ACL = 'projectPrivate'
+FILES_STORE_GCS_ACL = None
FTP_USER = 'anonymous'
FTP_PASSWORD = 'guest'
@@ -182,7 +182,7 @@ HTTPPROXY_ENABLED = True
HTTPPROXY_AUTH_ENCODING = 'latin-1'
IMAGES_STORE_S3_ACL = 'private'
-IMAGES_STORE_GCS_ACL = 'projectPrivate'
+IMAGES_STORE_GCS_ACL = None
ITEM_PROCESSOR = 'scrapy.pipelines.ItemPipelineManager'