Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-03-12 21:59:33 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2018-03-14 15:57:14 +0300
commitd3e7996e808fa50071cd0b5397bd5b21fb9f2d2f (patch)
tree34459dcfe1ee0b040495c7a1bb9bb8488ba30ff9
parent23a02eaf141647c12f964651ba86299966a2d108 (diff)
Fix bucket and container usage
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r--config/config.sample.php4
-rw-r--r--lib/private/Files/ObjectStore/Swift.php4
-rw-r--r--lib/private/Files/ObjectStore/SwiftFactory.php4
3 files changed, 8 insertions, 4 deletions
diff --git a/config/config.sample.php b/config/config.sample.php
index 8f5b1a2cee3..8595c024e4c 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -1226,13 +1226,13 @@ $CONFIG = array(
'password' => 'swift',
'domain' => [
'name' => 'default',
- ]
+ ],
],
'tenantName' => 'service',
'serviceName' => 'swift',
'region' => 'regionOne',
'url' => "http://yourswifthost:5000/v3",
- 'bucket' => 'nextcloud'
+ 'bucket' => 'nextcloud',
],
],
diff --git a/lib/private/Files/ObjectStore/Swift.php b/lib/private/Files/ObjectStore/Swift.php
index 4451fbcc750..f22e147445b 100644
--- a/lib/private/Files/ObjectStore/Swift.php
+++ b/lib/private/Files/ObjectStore/Swift.php
@@ -62,6 +62,10 @@ class Swift implements IObjectStore {
* @return string the container name where objects are stored
*/
public function getStorageId() {
+ if (isset($this->params['bucket'])) {
+ return $this->params['bucket'];
+ }
+
return $this->params['container'];
}
diff --git a/lib/private/Files/ObjectStore/SwiftFactory.php b/lib/private/Files/ObjectStore/SwiftFactory.php
index eab3441ff2c..7bb76782a82 100644
--- a/lib/private/Files/ObjectStore/SwiftFactory.php
+++ b/lib/private/Files/ObjectStore/SwiftFactory.php
@@ -77,7 +77,7 @@ class SwiftFactory {
$this->params['container'] = $this->params['bucket'];
}
if (!isset($this->params['container'])) {
- $this->params['container'] = 'owncloud';
+ $this->params['container'] = 'nextcloud';
}
if (!isset($this->params['autocreate'])) {
// should only be true for tests
@@ -95,7 +95,7 @@ class SwiftFactory {
$this->params['tenantName'] = $this->params['tenant'];
}
- $cacheKey = $userName . '@' . $this->params['url'] . '/' . $this->params['bucket'];
+ $cacheKey = $userName . '@' . $this->params['url'] . '/' . $this->params['container'];
$token = $this->getCachedToken($cacheKey);
$hasToken = is_array($token) && (new \DateTimeImmutable($token['expires_at'])) > (new \DateTimeImmutable('now'));
if ($hasToken) {