From 832d782cb870194f4c0702aae2c0c62077b0638f Mon Sep 17 00:00:00 2001 From: Frostist <37545822+Frostist@users.noreply.github.com> Date: Sat, 10 Jan 2026 12:10:36 +0200 Subject: [PATCH 1/5] Fix formatting for Minio Settings. Was missing a ) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 88d61e74..928da2b3 100644 --- a/README.md +++ b/README.md @@ -334,7 +334,7 @@ Use the AWS plugin for the objectfs addon. - **Secret**: Min.io Secret - **Bucket**: S3 Bucket name - **AWS region**: Doesn't matter -- **Base URL***: Your ip address of Min.io server or url. (If it's internal, see issue page [here](https://github.com/catalyst/moodle-tool_objectfs/issues/579). +- **Base URL***: Your ip address of Min.io server or url. (If it's internal, see issue page [here](https://github.com/catalyst/moodle-tool_objectfs/issues/579)). - **Key Prefix**: useful for adding a prefix for all data stored in bucket. Can be used to reuse the same CloudFront distribution for both Moodle itself and the pre-signed URLs files. ### Azure Blob Storage settings From 5659c885b3b703dc913d6a0ec2dcc0732d9c39b8 Mon Sep 17 00:00:00 2001 From: Frostist <37545822+Frostist@users.noreply.github.com> Date: Sat, 10 Jan 2026 12:20:04 +0200 Subject: [PATCH 2/5] Enable path-style endpoint in S3 client settings Added support for path-style endpoint configuration in S3 client. --- classes/local/store/s3/client.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/classes/local/store/s3/client.php b/classes/local/store/s3/client.php index ac097031..0537d83f 100644 --- a/classes/local/store/s3/client.php +++ b/classes/local/store/s3/client.php @@ -182,6 +182,10 @@ public function set_client($config) { if ($config->s3_base_url) { $options['endpoint'] = $config->s3_base_url; } + + if (!empty($config->s3_path_style_endpoint)) { + $options['use_path_style_endpoint'] = false; + } $this->client = \Aws\S3\S3Client::factory($options); } @@ -511,7 +515,14 @@ public function define_client_section($settings, $config) { new \lang_string('settings:aws:base_url_help', 'tool_objectfs'), '' )); - + + $settings->add(new \admin_setting_configcheckbox( + 'tool_objectfs/s3_path_style_endpoint', + new \lang_string('settings:aws:path_style_endpoint', 'tool_objectfs'), + new \lang_string('settings:aws:path_style_endpoint_help', 'tool_objectfs'), + 0 + )); + $settings->add(new \admin_setting_configtext( 'tool_objectfs/key_prefix', new \lang_string('settings:aws:key_prefix', 'tool_objectfs'), From 730d3f7715f88924d688769e4f13cf4d135f0b90 Mon Sep 17 00:00:00 2001 From: Frostist <37545822+Frostist@users.noreply.github.com> Date: Sat, 10 Jan 2026 12:20:44 +0200 Subject: [PATCH 3/5] Add AWS path style endpoint settings lang Added settings for AWS path style endpoint configuration. --- lang/en/tool_objectfs.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lang/en/tool_objectfs.php b/lang/en/tool_objectfs.php index 6ee7edbb..6c59bb7f 100644 --- a/lang/en/tool_objectfs.php +++ b/lang/en/tool_objectfs.php @@ -135,6 +135,8 @@ $string['settings:aws:key_help'] = 'Amazon S3 key credential.'; $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:path_style_endpoint'] = 'Path style endpoint'; +$string['settings:aws:path_style_endpoint_help'] = 'Use path style endpoints for S3 client.'; $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 AWS documentation.'; From 82b2fcac5c6fa2ac7e64a637e71780263ff3fe1d Mon Sep 17 00:00:00 2001 From: Frostist <37545822+Frostist@users.noreply.github.com> Date: Sun, 12 Apr 2026 06:14:32 +0200 Subject: [PATCH 4/5] Fix s3_path_style_endpoint configuration to correctly enable path-style endpoints --- classes/local/store/s3/client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/local/store/s3/client.php b/classes/local/store/s3/client.php index 5e9946ac..b6c2fb2d 100644 --- a/classes/local/store/s3/client.php +++ b/classes/local/store/s3/client.php @@ -185,7 +185,7 @@ public function set_client($config) { } if (!empty($config->s3_path_style_endpoint)) { - $options['use_path_style_endpoint'] = false; + $options['use_path_style_endpoint'] = true; } $this->client = \Aws\S3\S3Client::factory($options); From 47edf700b2dd5f86e42af31548535e15c7c6372d Mon Sep 17 00:00:00 2001 From: Frostist <37545822+Frostist@users.noreply.github.com> Date: Wed, 15 Apr 2026 11:35:36 +0200 Subject: [PATCH 5/5] Change s3_path_style_endpoint to boolean type --- classes/local/store/s3/client.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/local/store/s3/client.php b/classes/local/store/s3/client.php index b6c2fb2d..22a0acdc 100644 --- a/classes/local/store/s3/client.php +++ b/classes/local/store/s3/client.php @@ -185,11 +185,11 @@ public function set_client($config) { } if (!empty($config->s3_path_style_endpoint)) { - $options['use_path_style_endpoint'] = true; + $options['use_path_style_endpoint'] = (bool) $config->s3_path_style_endpoint; } $this->client = \Aws\S3\S3Client::factory($options); - } + } /** * Registers 's3://bucket' as a prefix for file actions.