Skip to content
Merged
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
4 changes: 2 additions & 2 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -1226,13 +1226,13 @@
'password' => 'swift',
'domain' => [
'name' => 'default',
]
],
],
'tenantName' => 'service',
'serviceName' => 'swift',
'region' => 'regionOne',
'url' => "http://yourswifthost:5000/v3",
'bucket' => 'nextcloud'
'bucket' => 'nextcloud',
],
];

Expand Down
4 changes: 4 additions & 0 deletions lib/private/Files/ObjectStore/Swift.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ private function getContainer() {
* @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'];
}

Expand Down
4 changes: 2 additions & 2 deletions lib/private/Files/ObjectStore/SwiftFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private function getClient() {
$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
Expand All @@ -90,7 +90,7 @@ private function getClient() {
$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) {
Expand Down