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

Add hostname to s3 source #16650

Open
wants to merge 2 commits into
base: 2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/lexicon/en/source.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
13 changes: 13 additions & 0 deletions core/model/modx/sources/mods3mediasource.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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',
),
);
}

Expand Down
Loading