mirror of
https://github.com/nextcloud/docker.git
synced 2025-04-19 18:36:09 +02:00
#2340 Introduce env var OBJECTSTORE_S3_LIKE_SERVICE_ENDPOINT_URL
This commit is contained in:
parent
61fb34da5f
commit
4a869e0d5e
1 changed files with 13 additions and 2 deletions
|
@ -4,14 +4,25 @@ if (getenv('OBJECTSTORE_S3_BUCKET')) {
|
||||||
$use_path = getenv('OBJECTSTORE_S3_USEPATH_STYLE');
|
$use_path = getenv('OBJECTSTORE_S3_USEPATH_STYLE');
|
||||||
$use_legacyauth = getenv('OBJECTSTORE_S3_LEGACYAUTH');
|
$use_legacyauth = getenv('OBJECTSTORE_S3_LEGACYAUTH');
|
||||||
$autocreate = getenv('OBJECTSTORE_S3_AUTOCREATE');
|
$autocreate = getenv('OBJECTSTORE_S3_AUTOCREATE');
|
||||||
|
$endpointUrl = getenv('OBJECTSTORE_S3_LIKE_SERVICE_ENDPOINT_URL');
|
||||||
|
$hostname = '';
|
||||||
|
$port = '';
|
||||||
|
if ($endpointUrl) {
|
||||||
|
$parsedUrl = parse_url($endpointUrl);
|
||||||
|
$hostname = isset($parsedUrl['host']) ? $parsedUrl['host'] : '';
|
||||||
|
$port = isset($parsedUrl['port']) ? $parsedUrl['port'] : '';
|
||||||
|
} else {
|
||||||
|
$hostname = getenv('OBJECTSTORE_S3_HOST') ?: '';
|
||||||
|
$port = getenv('OBJECTSTORE_S3_PORT') ?: '';
|
||||||
|
}
|
||||||
$CONFIG = array(
|
$CONFIG = array(
|
||||||
'objectstore' => array(
|
'objectstore' => array(
|
||||||
'class' => '\OC\Files\ObjectStore\S3',
|
'class' => '\OC\Files\ObjectStore\S3',
|
||||||
'arguments' => array(
|
'arguments' => array(
|
||||||
'bucket' => getenv('OBJECTSTORE_S3_BUCKET'),
|
'bucket' => getenv('OBJECTSTORE_S3_BUCKET'),
|
||||||
'region' => getenv('OBJECTSTORE_S3_REGION') ?: '',
|
'region' => getenv('OBJECTSTORE_S3_REGION') ?: '',
|
||||||
'hostname' => getenv('OBJECTSTORE_S3_HOST') ?: '',
|
'hostname' => $hostname,
|
||||||
'port' => getenv('OBJECTSTORE_S3_PORT') ?: '',
|
'port' => $port,
|
||||||
'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '',
|
'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '',
|
||||||
'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:",
|
'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:",
|
||||||
'autocreate' => strtolower($autocreate) !== 'false',
|
'autocreate' => strtolower($autocreate) !== 'false',
|
||||||
|
|
Loading…
Add table
Reference in a new issue