django-gcloud-storage icon indicating copy to clipboard operation
django-gcloud-storage copied to clipboard

Limit API Call

Open faxioman opened this issue 9 years ago • 9 comments

Details on commit message

faxioman avatar Aug 13 '16 14:08 faxioman

Hi @faxioman, sorry for my late response.

As far as I understand, the pull request is about this, right? https://cloud.google.com/storage/docs/hosting-static-website

How do the files end up in the bucket? The documentation looks like they need to be set to "publicly shared". Do you need to activate this by hand for each file, or do you do this via Python?

I think this is a nice addition to the library, but it should be documented in the README.

strayer avatar Aug 22 '16 10:08 strayer

Hi @Strayer. Yes, you need to set the acl for the file to 'publicly shared'. You can set this behaviour for an entire buket using gsutil cli command:

gsutil -m acl -r ch -u AllUsers:R gs://my-bucket/**

After this command, a new added file always has a publick link.

faxioman avatar Aug 22 '16 10:08 faxioman

Ehm ... sorry ... with the command above you set the permission for current files. This is the command for the default ACL:

gsutil defacl ch -u AllUsers:R gs://my-bucket

faxioman avatar Aug 22 '16 10:08 faxioman

I see, sounds rather easy to set up! I'm wondering if this can somehow be integrated into the test suite, but since the tests automatically create their own buckets and the bucket name needs to be the same as the custom domain, this would require a lot of changes... hmm...

One possibility would be to add a test parameter for the custom domain and have the developer make sure, that the bucket for that domain exists with a valid CNAME record and a correct ACL configuration.

strayer avatar Aug 22 '16 10:08 strayer

When you create a bucket you can access to it via http using:

https://my-bucket.storage.googleapis.com/...

but also using:

https://storage.googleapis.com/my-bucket/...

Could this be helpful?

faxioman avatar Aug 22 '16 10:08 faxioman

I hope I can look into this on the weekend, then I'll be out for some days due to an operation. If not, I'll come back to it as soon as I'm back on my feet!

strayer avatar Aug 26 '16 13:08 strayer

Don't worry Strayer, we'll be in touch after the operation ... and get well soon!

faxioman avatar Aug 29 '16 05:08 faxioman

Hey @faxioman, sorry for ignoring this for so long. I'll try to look into this in the next days!

strayer avatar Dec 03 '16 11:12 strayer

Sorry, ignored it again :( I sadly don't have the time to check this and also implement tests and documentation. If anyone wants to improve those areas for this pull request, feel free to chime in!

strayer avatar Mar 15 '17 12:03 strayer