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

Adding more settings #652

Open
wants to merge 2 commits into
base: MOODLE_402_STABLE
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
7 changes: 7 additions & 0 deletions classes/local/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ public static function get_objectfs_config() {

// S3 file system.
$config->s3_usesdkcreds = 0;

//New
$config->s3_bucket_endpoint = 0;
$config->s3_use_path_style_endpoint = 0;
$config->s3_disable_multiregion_access_points = 0;
//New

$config->s3_key = '';
$config->s3_secret = '';
$config->s3_bucket = '';
Expand Down
20 changes: 19 additions & 1 deletion classes/local/store/s3/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,29 @@ public function define_client_section($settings, $config) {
new \lang_string('settings:aws:secret_help', 'tool_objectfs'), ''));
}



//New
$settings->add(new \admin_setting_configcheckbox('tool_objectfs/s3_bucket_endpoint',
new \lang_string('settings:aws:bucket_endpoint', 'tool_objectfs'),
new \lang_string('settings:aws:bucket_endpoint_help', 'tool_objectfs'), '0'));

$settings->add(new \admin_setting_configcheckbox('tool_objectfs/s3_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'), '0'));

$settings->add(new \admin_setting_configcheckbox('tool_objectfs/s3_disable_multiregion_access_points',
new \lang_string('settings:aws:disable_multiregion_access_points', 'tool_objectfs'),
new \lang_string('settings:aws:disable_multiregion_access_points_help', 'tool_objectfs'), '0'));
//New



$settings->add(new \admin_setting_configtext('tool_objectfs/s3_bucket',
new \lang_string('settings:aws:bucket', 'tool_objectfs'),
new \lang_string('settings:aws:bucket_help', 'tool_objectfs'), ''));

$settings->add(new admin_settings_aws_region('tool_objectfs/s3_region',
$settings->add(new \admin_settings_aws_region('tool_objectfs/s3_region',
new \lang_string('settings:aws:region', 'tool_objectfs'),
new \lang_string('settings:aws:region_help', 'tool_objectfs'), ''));

Expand Down
12 changes: 12 additions & 0 deletions lang/en/tool_objectfs.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,18 @@
$string['settings:aws:key_help'] = 'Amazon S3 key credential.';
$string['settings:aws:secret'] = 'Secret';
$string['settings:aws:secret_help'] = 'Amazon S3 secret credential.';

//New
$string['settings:aws:bucket_endpoint'] = 'Set to true to send requests to a hardcoded bucket endpoint rather than create an endpoint as a result of injecting the bucket into the URL.';
$string['settings:aws:bucket_endpoint_help'] = 'Default Off';

$string['settings:aws:use_path_style_endpoint'] = 'Set to true to send requests to an S3 path style endpoint by default. Must be On if bucket_endpoint is On.';
$string['settings:aws:use_path_style_endpoint_help'] = 'Default Off';

$string['settings:aws:disable_multiregion_access_points'] = 'Set to true to disable the usage of multi region access points. These are enabled by default.';
$string['settings:aws:disable_multiregion_access_points_help'] = 'Default Off';
//New

$string['settings:aws:bucket'] = 'Bucket';
$string['settings:aws:bucket_help'] = 'Amazon S3 bucket to store files in.';
$string['settings:aws:region'] = 'region';
Expand Down
Loading