Question

How can I create a space with public access to the files but without public file listing?

Posted June 26, 2019 976 views
DigitalOcean

I’m using the python boto3 library to create a bucket in DigitalOcean Spaces, and using ACL='public-read' I can allow public access to the files, but I’m not sure how to restrict listing of files. I see that there is an option in the web UI to do restrict listing of files, but it’s not clear how to do that via the API.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

You should be able to set a bucket level ACL: https://developers.digitalocean.com/documentation/spaces/#set-bucket-acls

Using the AWS cli, the command would be:
aws --endpoint=https://$REGION.digitaloceanspaces.com put-bucket-acl --acl private --bucket $SPACE_NAME

Submit an Answer