Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added $wgAWSBucketDomain for custom S3 domains #6

Merged
merged 4 commits into from
Jul 8, 2018

Conversation

gboyers
Copy link
Contributor

@gboyers gboyers commented Jul 8, 2018

Added a new variable: $wgAWSBucketDomain

This enables you to use a custom S3 domain (eg files.example.com). This is particularly useful for use with a CDN like CloudFlare.

If you don't set this variable, it defaults to s3.amazonaws.com (same behaviour as current).

Also updated Readme to support users in doing this

gboyers added 4 commits July 8, 2018 18:53
Added $wgAWSBucketDomain, so you can use a custom S3 domain. Defaults to s3.amazonaws.com. Full instructions here: https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html
Added $wgAWSBucketDomain, for custom S3 domains
Updated Readme to include $wgAWSBucketDomain
@edwardspec
Copy link
Owner

Great stuff.

Probably not all CDNs use URL like //<bucket-name>.$wgAWSBucketDomain (it may be //<domain>/<bucket-name>), which could be solved by syntax like

$wgAWSBucketUrl = '$1.s3.amazonaws.com'; // (default)
$wgAWSBucketUrl = '$1.cdn.example.com';
$wgAWSBucketUrl = 'anothercdn.example.com/$1';

... but maybe we don't need to support those (yet). Just recording the idea for future reference.

@edwardspec edwardspec changed the base branch from master to add-wgAWSBucketDomain July 8, 2018 19:12
@edwardspec edwardspec merged commit f4fe825 into edwardspec:add-wgAWSBucketDomain Jul 8, 2018
edwardspec added a commit that referenced this pull request Jul 8, 2018
This adds $wgAWSBucketDomain configuration variable.
See issue #5, pull request #6.
@gboyers
Copy link
Contributor Author

gboyers commented Jul 8, 2018

@edwardspec - I'm picking up an occasional error in the logs now:
AmazonS3FileBackend::doPrepareInternal : The unspecified location constraint is incompatible for the region specific endpoint this request was sent to. in /____/extensions/AWS/s3/AmazonS3FileBackend.php on line 522

Have checked, and LocationConstraint is usually used for the make-bucket action, shouldn't affect any GET/PUT actions.

Any ideas?

@edwardspec
Copy link
Owner

Moved into issue #7, will investigate there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants