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 @@ -62,6 +62,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 @@ -77,7 +77,7 @@ private function getClient() {
$this->params['container'] = $this->params['bucket'];
}
if (!isset($this->params['container'])) {
$this->params['container'] = 'owncloud';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a small chance that changing this will break an existing installation

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well fair enough. But I guess we don't want new users to create an owncloud container. We could just put it in the release notes that we require them to set the container/bucket variable properly.

$this->params['container'] = 'nextcloud';
}
if (!isset($this->params['autocreate'])) {
// should only be true for tests
Expand All @@ -95,7 +95,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