Merge pull request #140 from FN-Florian/master

Add S3_REDGION varaible
This commit is contained in:
Christian Haschek
2022-06-27 08:19:06 +02:00
committed by GitHub
4 changed files with 7 additions and 4 deletions

View File

@@ -41,6 +41,7 @@ _buildConfig() {
echo "define('S3_ACCESS_KEY', '${S3_ACCESS_KEY:-}');"
echo "define('S3_SECRET_KEY', '${S3_SECRET_KEY:-}');"
echo "define('S3_ENDPOINT', '${S3_ENDPOINT:-}');"
echo "define('S3_REGION', '${S3_REGION:-}');"
echo "define('FTP_SERVER', '${FTP_SERVER:-}');"
echo "define('FTP_PORT', ${FTP_PORT:-21});"
echo "define('FTP_USER', '${FTP_USER:-}');"

View File

@@ -67,6 +67,7 @@ You can also store all uploaded files on S3 or S3 compatible storage like [Minio
|S3_ACCESS_KEY | string | Access key for your bucket|
|S3_SECRET_KEY | string | Secret key for your bucket |
|S3_ENDPOINT | URL | Server URL. If you're using S3 compatible software like [Minio](https://min.io/) you can enter the URL here |
|S3_REGION | string | Region of your bucket |
### FTP

View File

@@ -57,6 +57,7 @@ Every other variable can be referenced against the [default PictShare configurat
- S3_BUCKET (string | Name of your S3 bucket)
- S3_ACCESS_KEY (string | Access Key for your Bucket)
- S3_SECRET_KEY (string | Secrety Key)
- S3_REGION (string | S3 bucket region)
- S3_ENDPOINT (url | If you are using a selfhosted version of S3 like Minio, put your URL here)
- ENCRYPTION_KEY (string | If you want to use encryption for storage controllers, put your encryption key here. [Read more](https://github.com/HaschekSolutions/pictshare/blob/master/rtfm/ENCRYPTION.md))

View File

@@ -16,7 +16,7 @@ class S3Storage implements StorageController
require_once(ROOT.DS.'storage-controllers'.DS.'s3'.DS.'aws-autoloader.php');
$this->s3 = new Aws\S3\S3Client([
'version' => 'latest',
'region' => 'us-east-1',
'region' => (is_defined('S3_REGION') && S3_REGION ?S3_REGION:'us-east-1'),
'endpoint' => S3_ENDPOINT,
'use_path_style_endpoint' => true,
'credentials' => [