edwardspec / mediawiki-aws-s3

Extension:AWS allows MediaWiki to use Amazon S3 (instead of the local directory) to store images.
https://www.mediawiki.org/wiki/Extension:AWS
GNU General Public License v2.0
42 stars 32 forks source link

ACL Issue with non public bucket #75

Closed Tandokude closed 10 months ago

Tandokude commented 10 months ago

Not sure if this is an honest issue or a preferred configuration for a reason I'm not aware of. I created my S3 bucket in the default, not public configuration. This has not been an issue since I utilize cloudfront to serve the GET requests from the bucket for public view on my mediawiki instance. However, if I leave the bucket not public, I get a 403 Forbidden error in the PutObject request when someone tries to upload a new file. Based on my reading this appears related to the ACL being set to public-read in the createOrStore function in AmazonS3FileBackend.php. Is it possible to set this as a configuration option or is there a reason to set the ACL in this manner?

Thanks as always for this great extension.

edwardspec commented 10 months ago

The following configuration will cause new S3 objects to be created with ACL "private":

$wgFileBackends['s3']['privateWiki'] = true;
Tandokude commented 10 months ago

Thanks that appears to be working since enabling it last night.