Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions classes/local/store/s3/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ public function set_client($config) {
'version' => AWS_API_VERSION,
];

$options['use_path_style_endpoint'] = !empty($config->use_path_style_endpoint);

if (empty($config->s3_usesdkcreds)) {
$options['credentials'] = ['key' => $config->s3_key, 'secret' => $config->s3_secret];
}
Expand Down Expand Up @@ -475,6 +477,10 @@ public function define_client_section($settings, $config) {
new \lang_string('settings:aws:key_prefix', 'tool_objectfs'),
new \lang_string('settings:aws:key_prefix_help', 'tool_objectfs'), ''));

$settings->add(new \admin_setting_configcheckbox('tool_objectfs/use_path_style_endpoint',
new \lang_string('settings:aws:use_path_style_endpoint', 'tool_objectfs'),
new \lang_string('settings:aws:use_path_style_endpoint_help', 'tool_objectfs'), 1));

return $settings;
}

Expand Down
2 changes: 2 additions & 0 deletions lang/en/tool_objectfs.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@
$string['settings:aws:sdkcredserror'] = 'Couldn\'t find AWS credentials. It\'s unsafe to enable this setting. Follow up <a href="https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_credentials.html">AWS documentation</a>.';
$string['settings:aws:key_prefix'] = 'Prefix to use in bucket';
$string['settings:aws:key_prefix_help'] = 'Prefix to use inside Amazon S3 bucket. Must end with trailing slash when set. Leave blank to use root of bucket.';
$string['settings:aws:use_path_style_endpoint'] = 'Use path-style endpoint';
$string['settings:aws:use_path_style_endpoint_help'] = 'Enable this to use path-style S3 endpoint URLs (e.g., https://s3.amazonaws.com/bucket/key) instead of virtual-hosted style URLs (e.g., https://bucket.s3.amazonaws.com/key). This is required for some S3-compatible storage services like MinIO.';

$string['settings:do:header'] = 'DigitalOcean Spaces Settings';
$string['settings:do:key'] = 'Key';
Expand Down
Loading