2022-08-18 13:36:24 +02:00
|
|
|
<?php
|
|
|
|
|
if (getenv('OBJECTSTORE_S3_BUCKET')) {
|
|
|
|
|
$use_ssl = getenv('OBJECTSTORE_S3_SSL');
|
|
|
|
|
$use_path = getenv('OBJECTSTORE_S3_USEPATH_STYLE');
|
|
|
|
|
$use_legacyauth = getenv('OBJECTSTORE_S3_LEGACYAUTH');
|
|
|
|
|
$autocreate = getenv('OBJECTSTORE_S3_AUTOCREATE');
|
2025-09-26 11:38:14 +02:00
|
|
|
$multibucket = getenv('OBJECTSTORE_S3_MULTIBUCKET');
|
2022-08-18 13:36:24 +02:00
|
|
|
$CONFIG = array(
|
2025-09-26 11:38:14 +02:00
|
|
|
$multibucket === 'true' ? 'objectstore_multibucket' : 'objectstore' => array(
|
2022-08-18 13:36:24 +02:00
|
|
|
'class' => '\OC\Files\ObjectStore\S3',
|
|
|
|
|
'arguments' => array(
|
|
|
|
|
'bucket' => getenv('OBJECTSTORE_S3_BUCKET'),
|
|
|
|
|
'key' => getenv('OBJECTSTORE_S3_KEY') ?: '',
|
|
|
|
|
'secret' => getenv('OBJECTSTORE_S3_SECRET') ?: '',
|
|
|
|
|
'region' => getenv('OBJECTSTORE_S3_REGION') ?: '',
|
|
|
|
|
'hostname' => getenv('OBJECTSTORE_S3_HOST') ?: '',
|
|
|
|
|
'port' => getenv('OBJECTSTORE_S3_PORT') ?: '',
|
2024-06-21 15:00:06 +02:00
|
|
|
'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '',
|
2022-08-18 13:36:24 +02:00
|
|
|
'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:",
|
2025-09-26 15:53:28 -04:00
|
|
|
'autocreate' => strtolower($autocreate) !== 'false',
|
|
|
|
|
'use_ssl' => strtolower($use_ssl) !== 'false',
|
2022-08-18 13:36:24 +02:00
|
|
|
// required for some non Amazon S3 implementations
|
2025-09-29 11:15:53 +02:00
|
|
|
'use_path_style' => strtolower($use_path) === 'true',
|
2022-08-18 13:36:24 +02:00
|
|
|
// required for older protocol versions
|
2025-09-29 11:15:53 +02:00
|
|
|
'legacy_auth' => strtolower($use_legacyauth) === 'true'
|
2022-08-18 13:36:24 +02:00
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
);
|
2025-01-28 10:16:00 +01:00
|
|
|
|
|
|
|
|
$sse_c_key = getenv('OBJECTSTORE_S3_SSE_C_KEY');
|
|
|
|
|
if ($sse_c_key) {
|
|
|
|
|
$CONFIG['objectstore']['arguments']['sse_c_key'] = $sse_c_key;
|
|
|
|
|
}
|
2025-01-29 10:28:36 +01:00
|
|
|
}
|