Using bucket's default object ACL

This commit is contained in:
rhoboro 2018-04-13 12:06:39 +09:00
parent 74a9c65290
commit 464973489e
3 changed files with 8 additions and 5 deletions

View File

@ -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'

View File

@ -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

View File

@ -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'