Skip to content
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
6 changes: 6 additions & 0 deletions classes/local/store/s3/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,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 @@ -492,6 +494,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
14 changes: 14 additions & 0 deletions lang/en/tool_objectfs.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,20 @@
$string['settings:aws:region'] = 'region';
$string['settings:aws:region_help'] = 'Amazon S3 API gateway region.';
$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';
$string['settings:do:key_help'] = 'DO Spaces key credential.';
$string['settings:do:secret'] = 'Secret';
$string['settings:do:secret_help'] = 'DO Spaces secret credential.';
$string['settings:do:space'] = 'Space';
$string['settings:do:space_help'] = 'DO Space to store files in.';
$string['settings:do:region'] = 'Region';
$string['settings:do:region_help'] = 'DO Spaces API gateway region.';
$string['settings:azure:header'] = 'Azure Blob Storage Settings';
$string['settings:aws:sdkcredsok'] = 'AWS credentials found. This setting can be safely enabled.';
$string['settings:aws:secret'] = 'Secret';
$string['settings:aws:secret_help'] = 'Amazon S3 secret credential.';
Expand Down
Loading