Commit Graph

103 Commits (b6313f68d35c0da10ba598c6e25f20fb03d46d34)

Author SHA1 Message Date
Carl Schwan b6313f68d3
perf(s3): Expose pre-signed urls for S3
This is faster than going back to nextcloud to download the files.

This is an opt-in setting that can be enabled by setting
use_presigned_url in the object store config.

Additionally add support for the proxy config which is needed in a
docker setup. See https://github.com/juliusknorr/nextcloud-docker-dev/pull/431

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-12-09 11:21:35 +07:00
Robin Appelman a7d130c598
Revert "fix(ObjectStoreStorage): Encode original-path in writeStream by @frabe1579"
This reverts commit 4b4b39e7ec.

Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-11-18 19:53:17 +07:00
Stephan Orbaugh ef21c79368
Merge pull request #55717 from DaanSelen/fix-issue-55665
fix(ObjectStoreStorage): fix s3 path encoding (issue causing 55665)
2025-11-03 10:58:53 +07:00
Daan Selen 4b4b39e7ec fix(ObjectStoreStorage): Encode original-path in writeStream by @frabe1579
Signed-off-by: Daan Selen <dselen@systemec.nl>
2025-10-15 11:53:39 +07:00
Thomas Citharel 5c8bdad828
fix(objectstore): add named parameter for like query
to avoid 'object::%' to be considered as a column
(`la colonne \\u00ab object::% \\u00bb n'existe pas` on PG)

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2025-10-13 16:18:18 +07:00
yemkareems 200f9dc39f
fix: small typo fix
Signed-off-by: yemkareems <yemkareems@gmail.com>
2025-09-29 09:12:38 +07:00
provokateurin 98081dfd42
feat(ObjectStore): Add option to limit the total size
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-09-10 08:15:28 +07:00
Robin Appelman 97efc95efc fix: better object store write error propagation
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-08-05 19:17:58 +07:00
Robin Appelman 83b8a390cd fix: always do stream counting for object store upload
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-08-05 19:17:58 +07:00
Robin Appelman 398b106f0c fix: validate written size for s3 multipart uploads
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-08-05 19:17:58 +07:00
Ferdinand Thiessen 5981b7eb51
chore: apply new CSFixer rules
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>

# Conflicts:
#	apps/settings/lib/SetupChecks/PhpOpcacheSetup.php
2025-07-01 16:26:50 +07:00
Robin Appelman 2e1c316582 fix: remove double cache write in ObjectStoreStorage::touch
the file_put_contents already puts all of those values into the cache

Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-06-18 22:22:51 +07:00
Robin Appelman 5b3f4cd8fe perf: set the folder size in the same query as we create it
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-05-28 15:52:00 +07:00
Louis Chemineau 1f8b823992 fix(S3): Use original folder size during copy
This prevent having copied folders with a wrongly set size of 0KB.

- Fix https://github.com/nextcloud/server/issues/51916

Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-05-28 15:52:00 +07:00
Kate 9592390070
Merge pull request #51779 from nextcloud/object-store-filename 2025-05-06 15:21:01 +07:00
Louis Chemineau 8fdf2a7eae 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-01 13:53:56 +07:00
Robin Appelman 8aae332622
feat: store original storage id and path in object store metadata
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-03-31 15:10:58 +07:00
Robin Appelman 94114b99f7
feat: more generic way of passing metadata to object storage backends for new objects
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-03-31 14:55:18 +07:00
Robin Appelman 5896f8c37f
chore: cleanup leftover debug statement
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-12-09 15:40:01 +07:00
Robin Appelman 6cf66f95ce
fix: get object size from stream where possible
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-12-05 15:16:22 +07:00
provokateurin 0de4843b73 refactor(Storage): Align all Storage constructors
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-23 13:24:18 +07:00
provokateurin f28e74b7a8
refactor(Storage): Make all parameter types strong types
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-07 15:00:05 +07:00
Robin Appelman 3e12e1e789
fix: rework move into object store to better preserve fileids
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-09-27 14:46:08 +07:00
Robin Appelman 888d06dff9
fix: preserve fileid when moving from objectstore to non-objectstore
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-09-27 14:45:42 +07:00
Robin Appelman da21acfb3f
fix: ensure source folder is removed from cache when moving to objectstore
otherwise this causes confusion down the line as it's contents will be moved to the new cache

Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-09-27 14:45:42 +07:00
provokateurin 7cdccd058f
fix(Storage): Fix IStorage return types
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-26 18:13:03 +07:00
Robin Appelman 47d281865e perf: reuse cache info we already have when moving to object store
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-09-19 19:06:06 +07:00
provokateurin 9836e9b164
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +07:00
Robin Appelman 3c0c81bb94 fix: ensure parent folder exists when writing a file to object storage
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-09-18 14:11:27 +07:00
Robin Appelman 60f6347c97 fix: cleanup objectstore file_put_content
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-09-18 13:54:55 +07:00
Robin Appelman 3e94ee391f fix: create intermediate directories for objectstore moveFromStorage
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-09-18 13:54:55 +07:00
Robin Appelman 879fcc4253 fix: get source file before moving the cache item in objectstore moveFromStorage
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-09-18 13:54:55 +07:00
Stephan Orbaugh f25acfb799
Merge pull request #47986 from cfiehe/fix_move_on_same_bucket
perf(ObjectStoreStorage): Improve (slow) move on same object bucket
2024-09-17 16:35:19 +07:00
provokateurin d2d1e3284d
fix(Storage): Fix method docs inheritance
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-17 10:20:38 +07:00
Côme Chilliet 492e6997d8
chore: Fix psalm issues, put back private versions of getter in private Storage interface
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-09-16 18:11:38 +07:00
Christoph Fiehe 9597072ada 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-16 15:11:09 +07:00
Julius Härtl 6d2253e692
Merge pull request #46013 from nextcloud/obj-store-move-from-storage-preserve-fileid
fix: write object to the correct urn when moving from another storage to object store
2024-08-26 13:47:27 +07:00
Daniel Kesselberg af6de04e9e
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +07:00
Robin Appelman bd740ac0b0
fix: write object to the correct urn when moving from another storage to object store
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-08-23 15:22:16 +07:00
Andy Scherzinger dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +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
Joas Schilling 951c330d39
Revert "don't perform an explicit setup when using the file cache" 2024-03-07 14:38:02 +07:00
Robin Appelman 4fba4cd14c fix: fix user folder init
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-03-06 17:52:24 +07:00
Côme Chilliet c0ce272e9c chore: Migrate away from OC::$server->getLogger
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-02-13 17:32:30 +07:00
Thomas Citharel 30798eb6c2
refactor(objectstorage): cleanup types
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2024-02-02 14:59:21 +07:00
Thomas Citharel 3be3dbdb3b
refactor(objectstorage): move $user property from ObjectStoreStorage class to HomeObjectStoreStorage
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2024-02-02 14:59:21 +07:00
Ferdinand Thiessen 5172baaf8b
fix(ObjectStore): Make copying behavior consistent with local storage
Drop file permissions on copy like we do on local storage.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2023-11-17 12:54:37 +07:00
Julius Härtl 88a96e4db7 fix: Only store unencrypted_size if path should be encrypted
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-09-06 07:25:28 +07:00
Robin Appelman de85610385 use source cache when listing folder during recursive copy
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-06-19 16:40:15 +07:00
Robin Appelman cc0ad25c98
don't always check if we need to setup the object store root
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-05-23 17:44:40 +07:00