aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Files/Storage
Commit message (Collapse)AuthorAgeFilesLines
* fix: Transfer ownership with S3 as primaryartonge/fix/transfer_ownershipLouis Chemineau2025-04-011-0/+18
| | | | | | | | | | | | | | | | | | | | | | When using S3 as primary storage, transferring ownership with the `--move` option fail with the following error: `SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '8-45b963397aa40d4a0063e0d85e4fe7a1' for key 'fs_storage_path_hash'` The `--move` option moves the entire home folder from one account to another. The error means that the move failed because the destination folder already exist in `oc_filecache`. - With S3 as primary storage, folders only exists as entries in `oc_filecache`. - With S3 as primary storage, `moveFromStorage(...)` only moves the cache entry, as nothing needs to be moved on disk. This cache move does not delete potentially pre-existing destination folder. - With Local storage, `moveFromStorage(...)` calls `rename(...)` which delete pre-existing folder. - `transfer(...)`: https://github.com/nextcloud/server/blob/687a4d9ac7fcdbd935f81a0def567a1092306f7a/apps/files/lib/Service/OwnershipTransferService.php#L112 - `oneTimeUserSetup(...)`: https://github.com/nextcloud/server/blob/687a4d9ac7fcdbd935f81a0def567a1092306f7a/lib/private/Files/SetupManager.php#L261-L262 - `mkdir(...)`: https://github.com/nextcloud/server/blob/687a4d9ac7fcdbd935f81a0def567a1092306f7a/lib/private/Files/ObjectStore/ObjectStoreStorage.php#L91-L135 - `moveFromStorage(...)`: https://github.com/nextcloud/server/blob/687a4d9ac7fcdbd935f81a0def567a1092306f7a/lib/private/Files/ObjectStore/ObjectStoreStorage.php#L635-L636 Delete pre-existing folder in `moveFromStorage(...)` Signed-off-by: Louis Chemineau <louis@chmn.me>
* fix: Harden files scanner for invalid null accessFerdinand Thiessen2025-01-281-0/+8
| | | | | | Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de> Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com> Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* Merge pull request #47847 from ↵John Molakvoæ2024-10-291-0/+23
|\ | | | | | | nextcloud/fix-copying-or-moving-from-shared-groupfolders
| * test: add test for nested jail cross-storage movefix-copying-or-moving-from-shared-groupfoldersRobin Appelman2024-10-101-0/+23
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | refactor(Storage): Align all Storage constructorsrefactor/storage/constructorsprovokateurin2024-10-232-5/+5
|/ | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* refactor(Storage): Make all parameter types strong typesprovokateurin2024-10-071-3/+3
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* refactor(Wrapper\Encryption): Migrate to strong typesrefactor/stream-encryption/typingsprovokateurin2024-10-071-109/+119
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* test: Fix IStorage return typesprovokateurin2024-09-261-1/+1
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* fix(users): Don't crash if disabled user is missing in the databaseartonge/fix/prevent_missing_users_from_crashing_disabled_users_searchLouis Chemineau2024-09-231-3/+6
| | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* chore(deps): Update nextcloud/coding-standard to v1.3.1provokateurin2024-09-193-6/+6
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* fix(tests): Fix most obvious errors in ObjectStore testsCôme Chilliet2024-09-171-56/+56
| | | | | | Some are still failing Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Merge pull request #47986 from cfiehe/fix_move_on_same_bucketStephan Orbaugh2024-09-171-0/+108
|\ | | | | perf(ObjectStoreStorage): Improve (slow) move on same object bucket
| * perf(ObjectStoreStorage): Improve (slow) move on same object bucketChristoph Fiehe2024-09-161-0/+108
| | | | | | | | | | | | | | | | | | This commit fixes the issue #47856. When you upload a file into a group folder and when you use a single S3 bucket as primary storage, the final move operation hangs for a long time. In the background, Nextcloud initiates a copy-delete sequence from the bucket into the bucket, with causes a lot unnecessary overhead. Nextcloud thinks that the file must be imported to another storage and does not recognize that everything is done on the same object bucket. In that case, the import step can be completely skipped, which saves time, network bandwidth and reduces the load on the object storage. The behavior improves a lot with https://github.com/nextcloud/server/pull/46013. However, there are still some put messages that are being sent to the object storage when you use an object storage as primary storage and upload files into a group folder. Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com> Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
* | fix: Fix other uses of removed Storage interfaceCôme Chilliet2024-09-162-2/+3
|/ | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* refactor: Add void return type to PHPUnit test methodsChristoph Wurst2024-09-1513-134/+134
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* style: update codestyle for coding-standard 1.2.3Daniel Kesselberg2024-08-252-3/+3
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Merge branch 'master' into jr-readdir-false-falseJohn Molakvoæ2024-08-1614-198/+174
|\ | | | | Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
| * refactor: Migrate filename validation logic from `Storage` to ↵Ferdinand Thiessen2024-07-161-43/+24
| | | | | | | | | | | | `FilenameValidator` Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
| * chore: Add SPDX headerAndy Scherzinger2024-05-1314-135/+43
| | | | | | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
| * fix: Enforce forbidden filename characters on backendFerdinand Thiessen2024-02-281-3/+48
| | | | | | | | Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
| * make storage directory test be a bit less strict about mtimesRobin Appelman2024-02-071-2/+3
| | | | | | | | | | | | sometimes the clock ticks over during the test Signed-off-by: Robin Appelman <robin@icewind.nl>
| * chore: apply changes from Nextcloud coding standards 1.1.1Joas Schilling2023-11-231-7/+7
| | | | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
| * apply known mtime wrapper for external storagesRobin Appelman2023-09-191-1/+0
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * add wrapper to ensure we don't get an mtime that is lower than we know it isRobin Appelman2023-09-191-0/+71
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * Merge pull request #39707 from ↵Simon L2023-09-041-0/+11
| |\ | | | | | | | | | nextcloud/bugfix/39706/local-ext-storage-unavailable-mode
| | * Allow ext storage Local to go unavailableVincent Petry2023-08-291-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whenever an external storage of type Local points at a non-existing directory, process this as a StorageNotAvailable instead of returning 404. This makes desktop clients ignore the folder instead of deleting it when it becomes unavailable. The code change was limited to external storages to avoid issues during setup and with the default home storage. Signed-off-by: Vincent Petry <pvince81@yahoo.fr>
| * | update testsRobin Appelman2023-08-311-46/+10
| |/ | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * fix!: Remove symfony EventDispatcherInterface from UserJoas Schilling2023-07-271-4/+0
| | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | Clean-up some remaining readdir calls with undesirable false evaluation ↵Josh Richards2023-06-243-4/+4
|/ | | | | | potential Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
* composer run cs:fixCôme Chilliet2023-01-204-19/+15
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix using FSEEK_END with SeekableHttpStream to get file sizeRobin Appelman2022-09-151-0/+14
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* get quota for user only when neededRobin Appelman2022-09-011-84/+0
| | | | | | always apply the wrapper but have the wrapper get the quota lazily only when an operation where quota is applied is performed Signed-off-by: Robin Appelman <robin@icewind.nl>
* store unencrypted size in the unencrypted_size columnRobin Appelman2022-06-021-3/+4
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fix codestyleCôme Chilliet2022-03-241-1/+0
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Migrate from ILogger to LoggerInterface where needed in the testsCôme Chilliet2022-03-241-7/+6
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Normalize directory entries in Encoding wrapperVincent Petry2021-11-171-1/+43
| | | | | | | | | | | | Directory entry file names are now normalized in getMetaData(), getDirectoryContents() and opendir(). This makes the scanner work properly as it assumes pre-normalized names. In case the names were not normalized, the scanner will now skip the entries and display a warning when applicable. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Merge pull request #27440 from nextcloud/is-file-handleJohn Molakvoæ2021-10-231-2/+2
|\
| * Update Testsacsfer2021-10-221-1/+1
| |
| * Tests updateacsfer2021-08-151-1/+1
| |
* | ciRobin Appelman2021-10-151-0/+3
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | explicitly close source stream on local storageDaniel Kesselberg2021-09-211-1/+2
|/ | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Merge pull request #24966 from nextcloud/jknockaert-patch-1Lukas Reschke2021-04-061-4/+14
|\ | | | | avoid fread on directories and unencrypted files
| * Update EncryptionTest.phpJasper Knockaert2021-01-051-3/+3
| |
| * 2nd attempt to fix testsJasper Knockaert2021-01-051-7/+11
| |
| * attemtp to fix testJasper Knockaert2021-01-051-1/+7
| |
* | Set umask before operations that create local filesRobin Appelman2021-03-231-3/+34
| | | | | | | | | | | | this solves issues where "other php stuff" is messing with the umask Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Bump nextcloud/coding-standard from 0.3.0 to 0.5.0dependabot-preview[bot]2021-02-181-2/+2
| | | | | | | | | | | | | | | | | | | | Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 0.3.0 to 0.5.0. - [Release notes](https://github.com/nextcloud/coding-standard/releases) - [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md) - [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Cache the user backend info for 300sJoas Schilling2021-02-151-3/+19
|/ | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix code styleMorris Jobke2020-09-091-1/+0
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Make sure tests cover the new mkdir behaviour on 0 quotaJulius Härtl2020-09-081-1/+11
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>