Commit Graph

408 Commits (ea02e34bfc3425e223281c84ce2cd23e7910ddcf)

Author SHA1 Message Date
Louis Chemineau 79a0cdade4
test: add test that object store folder copy preserves folder size
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-06-02 12:00:59 +07:00
provokateurin a8b96fd4f8
feat(UserMountCache): Emit events for added, removed and updated mounts
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-05-26 08:34:45 +07:00
Robin Appelman e5aabded60 test: add test for nested cache jail unjailedroot
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-05-14 20:06:56 +07:00
Ferdinand Thiessen 832f79ac93
chore: apply code style
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-04-30 19:04:59 +07:00
Louis Chemineau 9bed21a8d7 fix: Transfer ownership with S3 as primary
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(...)`: 687a4d9ac7/apps/files/lib/Service/OwnershipTransferService.php (L112)
- `oneTimeUserSetup(...)`: 687a4d9ac7/lib/private/Files/SetupManager.php (L261-L262)
- `mkdir(...)`: 687a4d9ac7/lib/private/Files/ObjectStore/ObjectStoreStorage.php (L91-L135)
- `moveFromStorage(...)`: 687a4d9ac7/lib/private/Files/ObjectStore/ObjectStoreStorage.php (L635-L636)

Delete pre-existing folder in `moveFromStorage(...)`

Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-04-16 16:18:42 +07:00
Ferdinand Thiessen d0402dee06 fix(IFilenameValidator): correctly handle case insensitivity
- forbidden names and forbidden base names are case **insensitive**
  so we need to check all lowercase here.
- add test that config value is also read case insensitive.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-03-24 11:46:43 +07:00
Louis Chemineau b1cbeff17c test(View): Copy preserves content
Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-02-13 23:35:59 +07:00
Louis Chemineau a663b3e0cd fix(files): Correctly copy the cache information on copy operations
Needed to copy the `encrypted` flag of encrypted files when those files are two level down in a moved folder.

Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-02-13 23:35:59 +07:00
skjnldsv 80a4cb586f fix: make sure we process mime extensions as string
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
2025-02-06 15:15:41 +07:00
Robin Appelman 68829ad47c
fix: improve checks for moving shares/storages into other mounts
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-02-05 09:08:58 +07:00
Ferdinand Thiessen 67e0ef5b72
fix(files): Do not array access null value
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-01-28 20:51:42 +07:00
Louis Chemineau 474d93625b fix: Metadata field search
Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-01-27 18:57:00 +07:00
Robin Appelman c3a2d789f1 fix: fix mimetype not being updated when changing file extention on object store
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-12-11 09:00:44 +07:00
Josh Richards 1fc1543a8b
fix: Clean-up some remaining readdir calls with undesirable false evaluation potential
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
2024-11-13 09:11:17 +07:00
Robin Appelman 8842fcb003 test: add test for nested jail cross-storage move
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-10-29 15:02:49 +07:00
Louis Chemineau 9a34a6c4c4
fix(users): Don't crash if disabled user is missing in the database
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-09-23 18:06:38 +07:00
Kate ae7241f6c8
Merge pull request #48221 from nextcloud/backport/30/fix_move_on_same_bucket 2024-09-20 10:06:14 +07:00
Côme Chilliet 656e32c6c1 fix(tests): Fix most obvious errors in ObjectStore tests
Some are still failing

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-09-19 18:54:26 +07:00
Christoph Fiehe 82be489f53 perf(ObjectStoreStorage): Improve (slow) move on same object bucket
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>
2024-09-19 18:53:36 +07:00
Côme Chilliet 61da345203 fix(tests): Fix Folder tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-09-19 14:24:22 +07:00
Robin Appelman 8b8508c8b1 test: put parent items into cache in tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-09-19 13:59:08 +07:00
Robin Appelman e82ab7816f test: fix incorrect ltrim usage in test
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-09-19 13:59:08 +07:00
Git'Fellow 2bb8c023c2 fix(files): Check if the target path is a descendant of the shared folder path
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

fix: tests

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

fix: fix tests

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

fix: add tests

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

fix: tests
2024-09-06 02:00:43 +07:00
provokateurin b9aaa9f2e0 fix(files): Create non-existent parents of mountpoints
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-04 18:04:13 +07:00
Ferdinand Thiessen 6ea52ed218 fix: Adjust filename validation messages
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-08-30 14:48:23 +07:00
Ferdinand Thiessen 183fcef39b
fix: Renaming does not need update but delete permissions
Renaming is basically copy + delete (a move), so no need to update permissions.
Especially if the node is in a invalid directory the node should be moveable but not editable.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-08-28 20:23:50 +07:00
Louis Chemineau e5a8f996bd chore: Apply php:cs recommendations
Signed-off-by: Louis Chemineau <louis@chmn.me>

[skip ci]
2024-08-28 14:54:14 +07:00
Robin Appelman 82d7eaf80a feat: implement distributing partitioned queries over multiple shards
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-08-28 14:54:14 +07:00
Ferdinand Thiessen 1e49c83556 fix: `FilenameValidator::isForbidden` should only check forbidden files
And not forbidden basenames as this is used for different purposes.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-08-22 08:51:58 +07:00
Joas Schilling eea5378344 ci: Skip flaky test on PHP 8.3
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-08-21 13:55:13 +07:00
Ferdinand Thiessen 21f558b12b
Merge pull request #46379 from nextcloud/fix/folder-search-owner
fix: `OCP\Files\Node\Folder::search` was not setting the owner
2024-07-30 13:04:15 +07:00
Joas Schilling 829f2b9bc7
fix(db): Promote the use of `getDatabaseProvider` to reduce the impage of removed upstream platforms
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-19 11:21:14 +07:00
Robin Appelman c5b687271b
fix: make batch propagator work with sharding restrictions
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-07-17 19:16:07 +07:00
Robin Appelman 0931492ff0
fix: make usermountcache compatible with sharding
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-07-17 19:16:05 +07:00
Ferdinand Thiessen 322b3946d9
fix(dav): Verify target path in `setName` instead of source path
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-07-16 12:57:11 +07:00
Ferdinand Thiessen 69341e4306
refactor: Migrate filename validation logic from `Storage` to `FilenameValidator`
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-07-16 12:49:09 +07:00
Ferdinand Thiessen bdbeabafa7
feat: Add `forbidden_filename_basenames` config option
This allows to configure forbidden filenames (the full filename like `.htaccess`)
and also forbidden basenames like `com0` where `com0`, `com0.txt` and `com0.tar.gz` will match.
We need this as only using basenames was too restrictive and will cause problems on some systems when updating.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-07-15 19:39:18 +07:00
Ferdinand Thiessen cf935e33ae
fix: `OCP\Files\Node\Folder::search` was not setting the owner
The owner was not set on the file info causing e.g. webdav searches to never return the known owner.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-07-11 15:46:44 +07:00
Ferdinand Thiessen 46f1efac41
feat: Add `IFilenameValidator` to have one consistent place for filename validation
Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-07-09 15:04:34 +07:00
Andy Scherzinger 1f7e2ba599
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-13 17:41:36 +07:00
Robin Appelman 88ccea6d06
test: add test for jail watcher
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-04-08 18:42:44 +07:00
Côme Chilliet ec5133b739 fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-02 14:16:21 +07:00
John Molakvoæ 5a1ed2d9ea
Merge pull request #40131 from summersab/refactor/OC-Server-getShareManager 2024-03-15 16:05:59 +07:00
Andrew Summers 45eb4a839d Refactor `OC\Server::getLockingProvider`
Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
2024-03-15 13:11:33 +07:00
John Molakvoæ 9338ef36de
Merge branch 'master' into refactor/OC-Server-getShareManager
Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
2024-03-15 13:03:34 +07:00
Thomas Citharel ffeb797ecc
refactor(mimeloader): modernize MimeTypeLoader
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2024-03-14 17:24:36 +07:00
Maxence Lange 467c84ec53 feat(files): copy live photos
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2024-03-08 13:09:22 +07:00
Robin Appelman 51019fda7a fix: clearify logic around getMountsForFileId filtering
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-03-06 10:54:00 +07:00
Robin Appelman fd4ca13867
Merge pull request #43471 from nextcloud/cache-path-by-id
Cache path by id
2024-03-05 17:26:25 +07:00
Dariusz Olszewski 277a6fc7ea test: Additional tests for issue #35776
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
2024-03-04 14:25:52 +07:00