From 10b5cf5976d42239e124ed5e9ffb96ad8d76b9b5 Mon Sep 17 00:00:00 2001 From: Bournwog Date: Sun, 24 Nov 2024 16:50:47 +0300 Subject: [PATCH 1/2] Update mods3mediasource.class.php --- core/model/modx/sources/mods3mediasource.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/model/modx/sources/mods3mediasource.class.php b/core/model/modx/sources/mods3mediasource.class.php index 1a154a0dbda..8594fdc2997 100644 --- a/core/model/modx/sources/mods3mediasource.class.php +++ b/core/model/modx/sources/mods3mediasource.class.php @@ -61,6 +61,11 @@ public function initialize() { $this->driver->set_region($region); } + $hostname = $this->xpdo->getOption('hostname',$properties,''); + if (!empty($hostname)) { + $this->driver->set_hostname($hostname); + } + $this->setBucket($this->xpdo->getOption('bucket',$properties,'')); return $return; @@ -1205,6 +1210,14 @@ public function getDefaultProperties() { 'value' => '', 'lexicon' => 'core:source', ), + 'hostname' => array( + 'name' => 'hostname', + 'desc' => 'prop_s3.hostname_desc', + 'type' => 'textfield', + 'options' => '', + 'value' => '', + 'lexicon' => 'core:source', + ), ); } From 8ef563a20e0f5d5f5155fd047437a2739f7996e7 Mon Sep 17 00:00:00 2001 From: Bournwog Date: Sun, 24 Nov 2024 16:55:11 +0300 Subject: [PATCH 2/2] Update source.inc.php --- core/lexicon/en/source.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/core/lexicon/en/source.inc.php b/core/lexicon/en/source.inc.php index 67adc8ed5d5..fe82568b0e1 100644 --- a/core/lexicon/en/source.inc.php +++ b/core/lexicon/en/source.inc.php @@ -81,6 +81,7 @@ $_lang['prop_s3.url_desc'] = 'The URL of the Amazon S3 instance.'; $_lang['s3_no_move_folder'] = 'The S3 driver does not support moving of folders at this time.'; $_lang['prop_s3.region_desc'] = 'Region of the bucket. Example: us-west-1'; +$_lang['prop_s3.hostname_desc'] = 'Custom hostname to connect to the bucket'; /* file type */ $_lang['PNG'] = 'PNG';