Commit graph

427 commits

Author SHA1 Message Date
provokateurin
4eada2d804
refactor(Files): Modernize Wrapper
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-02-17 06:43:16 +01:00
provokateurin
5f4a5d8c67
refactor(Files): Remove deprecated streamCopy method
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-02-17 06:43:16 +01:00
provokateurin
c953ad9bcd
fix(Storage): Use correct return types for getMetaData and getDirectoryContent
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-02-17 06:43:16 +01:00
provokateurin
f12cecb684
feat(rector): Enable SafeDeclareStrictTypesRector
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-02-09 10:59:31 +01:00
Carl Schwan
3979c493f9
refactor: Apply second batch of comments
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2026-02-06 13:52:51 +01:00
Carl Schwan
7b6078875b
refactor: Run rector on lib/private
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2026-02-06 13:50:18 +01:00
Julius Knorr
b933156a3a
Merge pull request #57914 from nextcloud/feat/extendable-propfind
feat(dav): allow extending propfind properties via event
2026-02-05 10:49:59 +01:00
Benjamin Frueh
9d4b11587e feat(dav): allow extending propfind properties via event
Signed-off-by: Benjamin Frueh <benjamin.frueh@gmail.com>

Update lib/public/Files/Events/BeforePropfindEvent.php

Co-authored-by: Julius Knorr <jus@bitgrid.net>
Signed-off-by: Benjamin Früh <134610227+benjaminfrueh@users.noreply.github.com>

Update lib/public/Files/Events/BeforePropfindEvent.php

Co-authored-by: Julius Knorr <jus@bitgrid.net>
Signed-off-by: Benjamin Früh <134610227+benjaminfrueh@users.noreply.github.com>

refactor: rename BeforePropfindEvent to BeforeRemotePropfindEvent

Signed-off-by: Benjamin Frueh <benjamin.frueh@gmail.com>

chore: update composer autoloader for new event class

Signed-off-by: Benjamin Frueh <benjamin.frueh@gmail.com>

Update lib/public/Files/Events/BeforeRemotePropfindEvent.php

Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Benjamin Früh <134610227+benjaminfrueh@users.noreply.github.com>
2026-02-02 11:45:10 +01:00
Git'Fellow
080335009b refactor: use strict comparison operator
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2026-01-28 21:11:47 +01:00
Côme Chilliet
3c80b7f2b3
fix: Use strict array comparisons in lib/
To avoid surprises with corner cases.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2026-01-13 11:48:04 +01:00
Robin Appelman
5c625b7a07 feat: add an option to filter what paths get checked for updates
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-12-31 12:23:04 +01:00
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 +01:00
Louis Chmn
30d567fd0e fix(encryption): Increment lastChunkNr when size is off
When computing the unencrypted file size, we need the size of the last encrypted chunk as its size is usually not the regular 8192 bits.

To avoid reading the whole file, we seek directly to that last chunk based on the expected file size. When the expected file size is smaller than the actual one, we have a logic in place to continue reading until we reach the end of the file.

In that logic, we forgot to increment the `$lastChunkNr` which is important when we later check the signature of the chunk.

This commit adds that missing increment.

Signed-off-by: Louis Chmn <louis@chmn.me>
2025-11-21 17:34:19 +01:00
Robin Appelman
17104bf3a0
chore: better type hints for getAvailability
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-11-06 20:09:17 +01:00
Robin Appelman
2970232790
fix: make failed availability check apply in the same request
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-11-06 20:08:44 +01:00
Carl Schwan
475c84722f refactor(IPropagator): Cleanup implementation
- Add missing type hinting
- Use only public methods from IStorage instead of relying on internal
  \OC\Storage methods
- Refactor HomePropagator to use ignore argument from Propagator instead
  of reimplementing the same logic.

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-08 17:15:18 +02:00
Carl Schwan
34cd91cc86 refactor: Fix some easy psalm issues in Files
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-02 13:34:47 +02:00
provokateurin
ef279f6049
fix(files): Stop overwriting scan_permissions
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-09-28 14:11:47 +02:00
Ferdinand Thiessen
660f3f6fd1
refactor: use logical && || instead of weak and or operators
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-09-27 23:02:18 +02:00
Côme Chilliet
14d6945054
fix(encryption): Take encryption enabled status into account
shouldEncrypt now returns false for all paths if encryption is disabled.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-09-09 11:46:18 +02:00
Côme Chilliet
12532bb535
fix(encryption): Correctly set encrypted to 0 when copying
If encryption got disabled, copying should set encrypted to 0 for the
 new unencrypted copy. For instance when using encryption:decrypt-all

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-09-09 11:46:18 +02:00
Côme Chilliet
8c21f2b19c fix(encryption): Fix TypeError when trying to decrypt unencrypted file
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-08-25 13:18:50 +02:00
John Molakvoæ
4eee160c15
Merge pull request #53729 from nextcloud/dav-external-url-encoded-root 2025-08-01 09:31:14 +02:00
Côme Chilliet
4427050f84 fix(encryption): Correctly handle file opening and copying failures
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-07-03 15:19:34 +02: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 +02:00
Robin Appelman
6d0119bf8d
fix: handle dav external storage roots with spaces
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-06-30 18:01:01 +02:00
Daniel Kesselberg
de54bdb06b
fix: handle ambiguous IResponse.getBody return types
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2025-06-30 11:50:11 +02:00
Ferdinand Thiessen
01db539d0a
chore: move streamCopy implementation from OC_Helper to OCP\Files
The function was already there but called the legacy version.
So moved the implementation and migrated all usages of it.
Sadly the interface was slightly different so adjusted it to be
compatible with both legacy and the OCP one.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-05-16 13:03:05 +02:00
John Molakvoæ
b3b63020c9
Merge pull request #52812 from nextcloud/chore/oc-helper-rmdirr 2025-05-14 21:53:47 +02:00
Ferdinand Thiessen
072d4e8cba
chore: move implementation from OC legacy to OCP\Files
- move implementation to the OCP variant that called the legacy before
- add the missing deprecation notice
- add missing parameter to align both signatures
- use OCP\Files where this method is still used

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-05-14 14:55:45 +02:00
Côme Chilliet
a86d917907 fix(encryption): Only prevent cache deletion if target is not object store in moveFromStorage
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-05-13 23:37:52 +02:00
Côme Chilliet
a79b5dea7c fix(encryption): Improve Update class and event listenening
to avoid back&forth between path and Node object

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-05-13 23:37:52 +02:00
Côme Chilliet
e6275f8759 fix: Preserve file id when moving from object store even if encryption wrapper is present
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-05-13 23:37:52 +02:00
Côme Chilliet
9bb0721d66 fix: Fix mtime preservation when moving a directory across storages with encryption registered
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-05-13 23:37:52 +02:00
Côme Chilliet
8779ae38a4 fix(encryption): Fix filesize for part files in Encryption wrapper
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-05-13 23:37:52 +02:00
Robin Appelman
768b101a9d
Merge pull request #52706 from nextcloud/info-file-more-encryption-checks
feat: add more encryption checks to info:file
2025-05-12 13:17:26 +02:00
Robin Appelman
e6bdfcd8ed
Merge pull request #52665 from nextcloud/mountpoint-mkdir-quota
fix: create mountpoint folder even if the user has a quota of 0
2025-05-12 13:17:02 +02:00
Robin Appelman
b0b8159d6a
fix: throw a better error if we can't get the encrypted header size
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-05-09 22:33:45 +02:00
Robin Appelman
d9c53ef748
feat: add more encryption checks to info:file
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-05-09 16:35:31 +02:00
Robin Appelman
cd75876c1e fix: create mountpoint folder even if the user has a quota of 0
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-05-08 15:15:36 +02:00
Robin Appelman
012a402cec fix: restore updated encrypted version when copying versions
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-01-03 15:21:01 +01:00
Robin Appelman
41c53648ad
Merge pull request #49262 from nextcloud/move-from-encryption-no-opt
fix: don't do same-storage move optimization with encryption wrappers
2024-12-05 17:42:47 +01:00
Louis
27331d48e3
Merge pull request #48651 from nextcloud/artonge/fix/copy_cache_during_copy_operations
fix(files): Correctly copy the cache information during copy operations
2024-12-04 16:58:01 +01:00
Robin Appelman
ae30269eac
fix: don't set 'name' on null metadata
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-12-03 19:12:45 +01:00
Louis Chemineau
199b0bd4d9
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>
2024-12-03 17:04:44 +01:00
Git'Fellow
60d956f39f refactor(storage): Code adjustements and simplifications
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2024-11-21 10:02:00 +01:00
Git'Fellow
8755bf1815 fix(storage): Try to delete existing target
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

Add same logic to common storage
2024-11-20 09:42:33 +01:00
Robin Appelman
0bc478de2c
fix: don't do same-storage move optimization with encryption wrappers
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-11-13 18:47:13 +01:00
skjnldsv
954b6c68a0 chore: use $this->logger and prevent Server::get
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
2024-11-08 10:56:30 +01:00
Victor Dubiniuk
0f96a2ccb9 Fix Undefined variable: response notice in case of non-404 error
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
2024-11-08 10:56:25 +01:00