From bfb43ab85620b8c2a46590031ab2494ec9d9cf33 Mon Sep 17 00:00:00 2001 From: FN-Florian Date: Mon, 20 Jun 2022 08:50:13 +0200 Subject: [PATCH 1/5] Update s3.controller.php add S3_REGION variable --- storage-controllers/s3.controller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage-controllers/s3.controller.php b/storage-controllers/s3.controller.php index d1326db..1783b03 100644 --- a/storage-controllers/s3.controller.php +++ b/storage-controllers/s3.controller.php @@ -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' => S3_REGION, 'endpoint' => S3_ENDPOINT, 'use_path_style_endpoint' => true, 'credentials' => [ @@ -105,4 +105,4 @@ class S3Storage implements StorageController 'Key' => $hash ]); } -} \ No newline at end of file +} From 496496752495dc6c45f2ea3dcf154bd15df81339 Mon Sep 17 00:00:00 2001 From: FN-Florian Date: Sat, 25 Jun 2022 23:55:06 +0200 Subject: [PATCH 2/5] Update DOCKER.md --- rtfm/DOCKER.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rtfm/DOCKER.md b/rtfm/DOCKER.md index 961a89b..2663e73 100644 --- a/rtfm/DOCKER.md +++ b/rtfm/DOCKER.md @@ -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)) @@ -67,4 +68,4 @@ Every other variable can be referenced against the [default PictShare configurat - FTP_PASS (string | FTP Password) - FTP_BASEDIR (string | Base path where files will be stored. Must end with / eg `/web/pictshare/`) -- CONTENTCONTROLLERS (CSV string | If set, will whitelist content controllers for your instance. Must be uppercase and can be comma separated. Example: Only Pictures: `IMAGE`, Pictures and Videos: `IMAGE,VIDEO`) \ No newline at end of file +- CONTENTCONTROLLERS (CSV string | If set, will whitelist content controllers for your instance. Must be uppercase and can be comma separated. Example: Only Pictures: `IMAGE`, Pictures and Videos: `IMAGE,VIDEO`) From 25b39bbd864bef27836b60011738ec22db49722b Mon Sep 17 00:00:00 2001 From: FN-Florian Date: Sat, 25 Jun 2022 23:56:31 +0200 Subject: [PATCH 3/5] Update CONFIG.md --- rtfm/CONFIG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/rtfm/CONFIG.md b/rtfm/CONFIG.md index ac9d86b..65b40e2 100644 --- a/rtfm/CONFIG.md +++ b/rtfm/CONFIG.md @@ -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 From 9d8d5f3d36d323985397871a5fcb089c4f322987 Mon Sep 17 00:00:00 2001 From: FN-Florian Date: Mon, 27 Jun 2022 00:07:32 +0200 Subject: [PATCH 4/5] Update start.sh --- docker/rootfs/start.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/rootfs/start.sh b/docker/rootfs/start.sh index 16d74c5..c42c9ca 100644 --- a/docker/rootfs/start.sh +++ b/docker/rootfs/start.sh @@ -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:-}');" @@ -84,4 +85,4 @@ touch /var/log/nginx/pictshare/error.log nginx -tail -f /var/log/nginx/pictshare/*.log \ No newline at end of file +tail -f /var/log/nginx/pictshare/*.log From 240c7359a8d91e0f120515f94531ec91175049fb Mon Sep 17 00:00:00 2001 From: FN-Florian Date: Mon, 27 Jun 2022 00:08:24 +0200 Subject: [PATCH 5/5] Update s3.controller.php --- storage-controllers/s3.controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage-controllers/s3.controller.php b/storage-controllers/s3.controller.php index 1783b03..dc727b7 100644 --- a/storage-controllers/s3.controller.php +++ b/storage-controllers/s3.controller.php @@ -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' => S3_REGION, + 'region' => (is_defined('S3_REGION') && S3_REGION ?S3_REGION:'us-east-1'), 'endpoint' => S3_ENDPOINT, 'use_path_style_endpoint' => true, 'credentials' => [