@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add support for S3 endpoint regions.

Summary:
Allows to use file storage in different Amazon S3 regions as well as it
should support different file storage services with S3 compliant API
(eg.: Bashos' Riak CS).

Test Plan:
1. Create S3 bucket in non-default AWS Region (e.g. EU/Ireland).
2. Set appropriate bucket policy to allow upload & download objects for the specified access credentials.
3. Set `amazon-s3.endpoint` in your configuration file to an appropriate value (e.g. `s3-eu-west-1.amazonaws.com` for EU region).

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3965

authored by

Julius Seporaitis and committed by
epriestley
2b00f5e8 bf4f74db

+10 -1
+4
conf/default.conf.php
··· 883 883 'amazon-s3.access-key' => null, 884 884 'amazon-s3.secret-key' => null, 885 885 886 + // To use a custom endpoint, specify it here. Normally, you do not need to 887 + // configure this. 888 + 'amazon-s3.endpoint' => null, 889 + 886 890 // Set this to a valid Amazon S3 bucket to store files there. You must also 887 891 // configure S3 access keys above. 888 892 'storage.s3.bucket' => null,
+6 -1
src/applications/files/engine/PhabricatorS3FileStorageEngine.php
··· 98 98 99 99 $access_key = PhabricatorEnv::getEnvConfig('amazon-s3.access-key'); 100 100 $secret_key = PhabricatorEnv::getEnvConfig('amazon-s3.secret-key'); 101 + $endpoint = PhabricatorEnv::getEnvConfig('amazon-s3.endpoint'); 101 102 102 103 if (!$access_key || !$secret_key) { 103 104 throw new PhabricatorFileStorageConfigurationException( 104 105 "Specify 'amazon-s3.access-key' and 'amazon-s3.secret-key'!"); 105 106 } 106 107 107 - $s3 = new S3($access_key, $secret_key, $use_ssl = true); 108 + if ($endpoint !== null) { 109 + $s3 = new S3($access_key, $secret_key, $use_ssl = true, $endpoint); 110 + } else { 111 + $s3 = new S3($access_key, $secret_key, $use_ssl = true); 112 + } 108 113 109 114 $s3->setExceptions(true); 110 115