-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for s3 storage classes #36075
Conversation
Thanks for your pull request 👍
Please don't change the translation files. |
d3b1e55
to
5025b94
Compare
I removed the translations from the commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beside minor nitpick, looks good to me
@@ -81,6 +84,7 @@ protected function parseParams($params) { | |||
$this->bucket = $params['bucket']; | |||
$this->proxy = $params['proxy'] ?? false; | |||
$this->timeout = $params['timeout'] ?? 15; | |||
$this->storageClass = (isset($params['storageClass']) && !empty($params['storageClass'])) ? $params['storageClass'] : 'STANDARD'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the same logic as for other params ?
$this->storageClass = (isset($params['storageClass']) && !empty($params['storageClass'])) ? $params['storageClass'] : 'STANDARD'; | |
$this->storageClass = $params['storageClass'] ?? 'STANDARD'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I've done at start ;-)
But in the external storage application (files_external), if the storage class is not specified, you get an empty class (an empty string), which is not a valid a storage class for the providers and generates an error. Not sure you can specified a default value for OCA\Files_External\Lib\DefinitionParameter
?
It seemed to me more generic to ensure here that, if the storage class is not defined or is empty, we fallback to STANDARD.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$this->storageClass = (isset($params['storageClass']) && !empty($params['storageClass'])) ? $params['storageClass'] : 'STANDARD'; | |
$this->storageClass = !empty($params['storageClass']) ? $params['storageClass'] : 'STANDARD'; |
Then no need for isset
, empty
implies isset
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, the PR have been updated
5025b94
to
e76a7d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nitpick but otherwise looks fine.
@@ -123,7 +124,8 @@ protected function writeMultiPart(string $urn, StreamInterface $stream, string $ | |||
'key' => $urn, | |||
'part_size' => $this->uploadPartSize, | |||
'params' => [ | |||
'ContentType' => $mimetype | |||
'ContentType' => $mimetype, | |||
'StorageClass' => $this->storageClass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'StorageClass' => $this->storageClass | |
'StorageClass' => $this->storageClass, |
Signed-off-by: François Ménabé <[email protected]>
Signed-off-by: François Ménabé <[email protected]>
e76a7d5
to
710f3fd
Compare
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
Since this comes with no tests or documentation, I'll ask here - has anyone actually tested this? It isn't working for me, and I am trying to make it available on the Docker image. I can open an issue?
-> everything gets STANDARD Relevant config..
The log is empty I am not trying to raise an issue here. I just need to verify that the usage above is as intended. |
I've just retested on my dev environment (based on skjnldsv/docker-nextcloud-dev) and it "works for me". Switched the fork to v26.0.0 tag and it still works. That's the config I used (seems pretty identical to what you paste and yes only
I also manually build a Docker image from nextcloud/docker applying something similar to nextcloud/docker#1933 but directly in 26/apache/config/s3.config.php directory and it also worked as expected.
What I could suspect:
Last note: if |
Good grief man I didn't check the release version this made it into. I figured with CI/CDs, since this is a feature and not a breaking change, that it had already made it out after a couple months into Nextcloud 25 and the corresponding Docker image. Can confirm it works flawlessly in Nextcloud 26 using my setup described above + S3. Thanks for this sanity check, and for your work on this. |
Summary
This add support for s3 storage class in both primary objectstore and External Storage (files_external) application.
TODO
files_external
app manually done for english (not sure that should be done manually) but not for other languagesChecklist