aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/ObjectStore/S3ConnectionTrait.php
Commit message (Collapse)AuthorAgeFilesLines
* fix(s3): Don't wait indefinitely for S3 to returnGit'Fellow2024-07-051-29/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: lint Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: use AwsException Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: Throw on connection failure Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: Wrap all in try catch block Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: use RequestTimeout error message Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> log: use OCP Server class Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: Handle connect timeout only Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: Handle errors more generically Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* fix(S3): Adjust usage of guzzle promiseFerdinand Thiessen2024-06-161-2/+2
| | | | | | `Promise\promise_for` was deprecated and is now removed and replaced with the static API (`Create::promiseFor`). Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* fix(ObjectStore): handle empty S3 hostnameJosh2024-06-121-1/+1
| | | | | | | | Fixes #45637 The support for s3-accelerate added in #44496 introduced a regression in AWS S3 environments when `hostname` is blank (which is a valid configuration w/ AWS since the hostname gets auto-generated). Signed-off-by: Josh <josh.t.richards@gmail.com>
* chore: Add SPDX headerAndy Scherzinger2024-05-241-29/+2
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* feat: add option to enable s3 accelerationRobin Appelman2024-04-261-1/+16
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* feat(ObjectStore): Make S3 MultipartUpload concurrency configurableFerdinand Thiessen2024-03-211-3/+5
| | | | Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* fix(ObjectStore): Use common S3 trait so config and connection trait members ↵Ferdinand Thiessen2024-03-211-30/+4
| | | | | | are in sync Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* fix(s3): Add config option to disable multipart copy for certain s3 providersJulius Härtl2023-12-281-0/+3
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* only do a multipart s3 copy when above the regular copy limitRobin Appelman2023-12-281-0/+4
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Convert isset ternary to null coalescing operatorHamid Dehnavi2023-09-281-1/+1
| | | | Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
* fix(s3): fix handling verify_bucket_exists parameterThomas Citharel2023-08-311-1/+1
| | | | | | | | If 'verify_bucket_exists' is set to false in the config.php s3 configuration, it's supposed to avoid verifying that the bucket exists. However empty(falsy) will always return true, so this condition would not work. Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* feat(s3): Add option to specify an SSE-C customer provided keyJulius Härtl2023-01-241-0/+30
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Manage s3 storage class in objectstoreFrançois Ménabé2023-01-121-0/+4
| | | | Signed-off-by: François Ménabé <francois.menabe@gmail.com>
* Merge branch 'master' into patch-2Jasper Weyne2022-08-111-12/+19
|\
| * only use nextcloud bundle when explicitly enabledRobin Appelman2022-07-051-9/+14
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * also use nextcloud certificate bundle when downloading from s3Robin Appelman2022-07-051-10/+12
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Disable ~/.aws/config access by S3ConnectionTraitJasper Weyne2022-06-071-0/+2
|/ | | | | This commit sets the 'use_aws_shared_config_files' option to false, in order to disable configuration loading from ~/.aws/config by the AWS SDK, specifically the S3Client. It is a continuation of #27040, as that PR only changed the behaviour of the CredentialsProvider; this change affects the ConfigurationProvider as well. Signed-off-by: Jasper Weyne <jasperweyne@gmail.com>
* Migrate more classes of lib/private to LoggerInterfaceCôme Chilliet2022-04-261-6/+5
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* don't try to get custom certs for s3 primary storageRobin Appelman2022-03-151-3/+9
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* use the nextcloud certificate bundle for s3Robin Appelman2022-03-141-1/+6
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Make max size for single put uploads configurableJulius Härtl2021-12-291-0/+4
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Fix php-cs for S3ConnectionTrait.phpJulius Härtl2021-12-211-1/+0
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Simplify S3ConnectionTrait to defaultProvider plus optionStephen Cuppett2021-11-221-6/+2
| | | | | | | | | | | | | | | When we initially added the EC2 and ECS IAM role support in #24700, we had to use a workaround by explicitly ordering the various providers due to an inconsistency in the AWS SDK for PHP. We submitted a PR there to get that squared away. Now, we've consumed that version upstream for the SDK and can update our code here to be the most concise version as well as position ourselves to pick up new methods as those become available and prevalent in AWS (for acquiring credentials). See also: https://github.com/nextcloud/server/pull/24700#issuecomment-747650892 See also: https://github.com/aws/aws-sdk-php/pull/2172 Signed-off-by: Stephen Cuppett <steve@cuppett.com>
* Refactor writeObject to only use MultipartUpload when requiredBernd Rederlechner2021-08-201-3/+3
| | | | | | Signed-off-by: Bernd Rederlechner <Bernd.Rederlechner@t-systems.com> Co-authored-by: Julius Härtl <jus@bitgrid.net>
* Merge pull request #26463 from Worteks/fix-s3proxyJulius Härtl2021-07-141-2/+10
|\
| * fix(proxy): use accessorMaxime Besson2021-06-301-2/+2
| | | | | | | | Signed-off-by: Maxime Besson <maxime.besson@worteks.com>
| * fix(proxy): reaching s3 storage behind some http proxySamuel2021-04-091-1/+9
| | | | | | | | Signed-off-by: Maxime Besson <maxime.besson@worteks.com>
* | Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-2/+2
| | | | | | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* | Avoid reading ~/.aws/config when using S3 providerFlorent2021-05-201-0/+1
|/ | | | | | | When using S3 storage, we sometimes have open_basedir errors due to aws-sdk-php trying to read ~/.aws/config which is out of open_basedir restrictions. Christoph Wurst already added csm=false config in #21406 but it wasn't enough, we also need to set use_arn_region=false, added in this commit. Signed-off-by: Florent <florent@coppint.com>
* Merge pull request #24700 from Imajie/s3-credsRoeland Jago Douma2021-02-021-1/+5
|\ | | | | Resolves #24699, Support ES2 and ECS instance providers for S3 buckets
| * Fix failing testsJames Letendre2020-12-151-1/+1
| | | | | | | | Signed-off-by: James Letendre <james.letendre@gmail.com>
| * Add web identity provider to S3 connection chainJames Letendre2020-12-151-13/+4
| | | | | | | | Signed-off-by: James Letendre <james.letendre@gmail.com>
| * Replace defaultProvider with explicit calls to exclude user home directory ↵James Letendre2020-12-141-1/+15
| | | | | | | | | | | | lookup Signed-off-by: James Letendre <james.letendre@gmail.com>
| * Resolves #24699, Support ES2 and ECS instance providers for S3 bucketsJames Letendre2020-12-141-2/+1
| | | | | | | | Signed-off-by: James Letendre <james.letendre@gmail.com>
* | Update all license headers for Nextcloud 21Christoph Wurst2020-12-161-0/+1
|/ | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Allow config to specify the bucket existsRoeland Jago Douma2020-11-061-1/+2
| | | | | | | | | | | | | | | In the 99% case the bucket is just always there. And if it is not the read/write will fail hard anyways. Esp on big instances the Objectstore is not always fast and this can save a few hundered ms of each request that acess the objectstore. In short it is adding 'verify_bucket_exists' => false To the S3 config part Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Update the license headers for Nextcloud 20Christoph Wurst2020-08-241-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Resolves #19790, Provides Support for IAM CredentialsStephen Cuppett2020-08-201-6/+38
| | | | | | | | | | | Includes support for either leveraging environment variables passed to the PHP runtime or IAM instance profile present on the host being used. The default and first choice is still the parameter file as documented. See also: https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_credentials_provider.html#chaining-providers Signed-off-by: Stephen Cuppett <steve@cuppett.com>
* Fix static method call for s3 bucket compat checkChristoph Wurst2020-07-031-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Disable Client-Side Monitoring on AWS storageChristoph Wurst2020-06-151-2/+3
| | | | | | | | | The S3 client enables this by default and then tries to read `.aws/config`. This causes `open_basedir` restriction related error for some setups. So this patch disables the CSM because it's most likely unused anyway. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Upload part size as S3 parameter instead of constant valueFlorent2020-06-091-0/+4
| | | | | | | | Some S3 providers need a custom upload part size (500 MB static value in Nextcloud). Here is a commit to change this value via S3 configuration, instead of using S3_UPLOAD_PART_SIZE constant. A new parameter is added for an S3 connection : uploadPartSize Signed-off-by: Florent <florent@coppint.com>
* Update the license headers for Nextcloud 19Christoph Wurst2020-03-311-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersChristoph Wurst2019-12-051-1/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* add method to get bucket name from s3 storageRobin Appelman2019-05-241-1/+4
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Bucket name - Alert in debug modeS. Cat2019-03-011-1/+1
| | | | | | Alert in debug mode only when trying to mount non compatible DNS bucket name (in order to not flood the logs) Signed-off-by: Sébastien Cat <sebastien.cat@inra.fr>
* Correct code indentS. Cat2019-03-011-5/+5
| | | | | | Just correct code indent. Signed-off-by: Sébastien Cat <sebastien.cat@inra.fr>
* Warning on S3 not compatible DNS bucket nameS. Cat2019-03-011-4/+11
| | | | | | The new created bucket should respect the DNS compatibility, nevertheless, Nextcloud should accept to mount "old created" buckets that does not respect DNS compatibility (Backward compatibility, or compatibility with CEPH). Signed-off-by: Sébastien Cat <sebastien.cat@inra.fr>
* Dont check Bucket Name in NextcloudSebastien Cat2019-03-011-4/+0
| | | | | Signed-off-by: Sebastien Cat <sparrow.jack63@gmail.com> Signed-off-by: Sébastien Cat <sebastien.cat@inra.fr>
* Fix listing s3 objects when using google cloud aws compatibilityRobin Appelman2018-06-111-0/+5
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>