Commit graph

988 commits

Author SHA1 Message Date
blizzz
0ba3d38c8c
Merge pull request #33750 from nextcloud/backport/33734/stable23
[stable23] remove leading slash for search results at mountpoint root
2022-09-28 10:37:11 +02:00
Carl Schwan
4d4a6727fc Filter out old files when trying to get recent files
Only do so when asking for less than 100 files and having an offset
equal to 0.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-09-08 14:44:00 +00:00
Robin Appelman
d7858bfcf3 optimize search post-processing for jail wrapper
don't both asking the wrapped cache if we know it's not in our jail anyway

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-30 15:51:29 +00:00
Robin Appelman
d414008b13 remove leading slash for search results at mountpoint root
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-30 10:28:02 +00:00
Robin Appelman
db86e92d05 don't set null as a bundle path
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-07-27 13:50:05 +00:00
Robin Appelman
87b7f2683f only use nextcloud bundle when explicitly enabled
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-07-18 07:57:48 +00:00
Robin Appelman
9d4b0e2265 also use nextcloud certificate bundle when downloading from s3
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-07-18 07:57:46 +00:00
Jonas
7ee01a07fd Check whether entry is of type ICacheEntry in Cache->remove()
In some scenarios (file not in cache, but partial data of it in the
object), Cache->get() might return an array, which leads to errors like
"Call to a member function getId() on array".

So check whether the returned entry is of type ICacheEntry before doing
operations on it in Cache->remove().

Fixes: #33023

Signed-off-by: Jonas <jonas@freesources.org>
2022-06-30 12:24:42 +00:00
Vincent Petry
f68ff54960
Merge pull request #32777 from nextcloud/backport/32767/stable23
[stable23] handle stream wrappers in SeekableHttpStream
2022-06-10 11:38:01 +02:00
Robin Appelman
a200afac68 handle stream wrappers in SeekableHttpStream
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-06-09 08:24:21 +00:00
Julius Härtl
9b914f02b1 Cleanup temporary files after finishing the write to object storage
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-06-02 16:31:26 +00:00
blizzz
adc0690960
Merge pull request #32124 from nextcloud/backport/32074/stable23
[stable23] tell mysql to ignore the sort index for search queries
2022-05-16 12:22:05 +02:00
blizzz
72882aca1e
Merge pull request #31818 from nextcloud/backport/31574/stable23
[stable23] use the nextcloud certificate bundle for s3
2022-05-05 20:21:00 +02:00
Robin Appelman
2831da14be tell mysql to ignore the sort index for search queries
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-25 11:56:44 +00:00
Robin Appelman
d334f21bd5
use the same cached propfind for free space for dav storage
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-14 13:47:02 +02:00
Robin Appelman
cc74bff50c
only request free space once for external shares
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-14 13:47:02 +02:00
Robin Appelman
d33ba15c38
don't overwrite the etag from storage backends that already provide "good" etags
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-14 13:47:02 +02:00
blizzz
bc52905ad0
Merge pull request #31878 from nextcloud/backport/31754/stable23
[stable23] Fix incorrect if conditions in View
2022-04-14 13:42:41 +02:00
blizzz
eee279de78
Merge pull request #31835 from nextcloud/backport/31816/stable23
[stable23] Deduplicate storage ids in list before reusing
2022-04-14 13:39:04 +02:00
Robin Appelman
9342faccad
don't try to get custom certs for s3 primary storage
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-14 13:36:09 +02:00
Robin Appelman
eb8989f40b
use the nextcloud certificate bundle for s3
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-14 13:36:08 +02:00
Côme Chilliet
aef9ba237f Fix incorrect if conditions in View
($something->getPermissions() && Constants::PERMISSION_READ) does not
  make sense as PERMISSION_READ contant is 1 this will always evaluate to
  true.
getPersmissions is returning an int which is a bitwise combination as
  documented in the interface, so it should be used with bit operators.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-04-14 11:03:34 +02:00
Joas Schilling
961bf74ae4 Deduplicate storage ids in list before reusing
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-04 17:18:04 +00:00
Robin Appelman
4167915b1a return dummy availability if storage is not found in cache
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-10 17:17:20 +00:00
Joas Schilling
b6e8aba4c8 Don't set up full filesystem to check for certificates
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-03-02 10:46:25 +00:00
Vincent Petry
64f376e4b9
Merge pull request #31098 from nextcloud/backport/30942/stable23
[stable23] only setup part of the filesystem for appdata requests
2022-03-01 16:00:45 +01:00
Louis Chemineau
5043a9dc6b Wrap S3 multipart upload exception
Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-02-21 14:25:54 +00:00
Louis Chemineau
7a2697a100 Wrap S3 multipart upload exception
Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-02-21 14:25:52 +00:00
Robin Appelman
417ead0a6b fix fs cache test user setup
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-02-16 10:46:48 +00:00
Robin Appelman
fa43e4ecf2 pass user object during fs init
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-02-16 10:46:48 +00:00
Robin Appelman
19d214294c only setup part of the filesystem for appdata requests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-02-16 10:46:48 +00:00
Carl Schwan
d69531ac8e
Fix psalm not running
The issue was that we were using psalm/phar instead of vimeo/psalm. This
caused issue with the custom psalm plugin in buildd/psalm.

This is using the opportunity to also update the psalm version from 3.8
to 3.17 and the php-cs-fixer too.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-27 17:20:00 +01:00
John Molakvoæ
2645b6cd69
Merge pull request #29798 from nextcloud/stable23-disk 2022-01-20 10:36:40 +01:00
Carl Schwan
253d502471
Merge pull request #30684 from nextcloud/backport/30531/stable23
[stable23] Optimize FileSystemTags workflow for groupfolder
2022-01-17 10:15:26 +01:00
Jonas Meurer
9da4620ff8 updateEncryptedVersion: cleanup on target if cache already got renamed
When moving a file to trash with encryption enabled, the cache gets
moved before the actual file. According to @icewind1991 this is in order
to not break object storage.

When moving a file from an unencrypted storage (e.g. a collectives
storage) to the encrypted trashbin storage, this causes errors, see

This commit fixes it by doing `updateEncryptedVersion()` on the target
cache entry *if* the source cache entry doesn't exist anymore, but the
corresponding target cache entry does exist already.

Fixes: #26544

Signed-off-by: Jonas Meurer <jonas@freesources.org>
2022-01-14 21:41:10 +00:00
Carl Schwan
61624c2213 Fix psalm issues
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-14 14:17:11 +00:00
Carl Schwan
c3fcb2c199 Add helper method in Wrapper
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-14 14:17:06 +00:00
John Molakvoæ
05a13d3dc6
Implement multibucket shift for ObjectStore
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2022-01-14 08:31:38 +01:00
Vincent Petry
9eeaed0051 Fix fail when keys/files folder already exists
Fixes an issue with transfer ownership in move mode where the folder
"files_encryption/keys/files" already exists.

Instead of failing, its existence is checked before calling mkdir.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2022-01-11 08:20:41 +00:00
Vincent Petry
1291abc130 Check resource before closing in encryption wrapper
In case of error there is no guarantee that $source or $target is set or
is a resource when handling an error.

Without this fix, there's a risk that fclose will fail and the actual
exception will not be thrown, making it impossible to find out about the
root cause.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-12-10 00:03:08 +00:00
Robin Appelman
c9db02a921 background scan the source storage when a background scan on a storage jail is triggered
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-12-02 17:47:05 +00:00
Joas Schilling
4736bba7f6 Check for invalid characters before trimming
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-25 11:49:54 +00:00
acsfer
913e64c81a
[stable23] Check for disk_free_space
Backport of https://github.com/nextcloud/server/pull/29758
2021-11-19 20:03:34 +01:00
Vincent Petry
f0661de4e5 Normalize directory entries in Encoding wrapper
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>
2021-11-19 14:51:38 +00:00
Vincent Petry
516b10de33 Move storage encoding compatibility warning logic
The encoding check for file names is now happening the Scanner, and an
event will be emitted only if the storage doesn't contain the encoding
compatibility wrapper.

The event is listened to by the occ scan command to be able to display a
warning in case of file name mismatches when they have NFD encoding.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-11-19 14:51:38 +00:00
Vincent Petry
106950d493 Normalize file name before existence check in scanner
The scanner would not find a NFD-encoded file name in an
existing file list that is normalized.

This normalizes the file name before scanning.

Fixes issues where scanning repeatedly would make NFD files flicker in
and out of existence in the file cache.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-11-19 14:51:38 +00:00
Vincent Petry
93fb33d863
Update lib/private/Files/Storage/Wrapper/Availability.php add void
Signed-off-by: Vincent Petry <vincent@nextcloud.com>

Co-authored-by: Carl Schwan <carl@carlschwan.eu>
2021-11-05 10:28:41 +01:00
Vincent Petry
db29fd29ee
Return false in hasUpdated when storage is not available
Technically, saying that a storage has no updates when it's not
available is correct.

This makes it possible to retrieve the cache entry for the mount point
and also to list and remove unavailable federated shares.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-11-05 09:48:52 +01:00
John Molakvoæ
d6152bf98d
Fix psalm
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2021-11-04 10:24:13 +01:00
John Molakvoæ
44c06a9641
Merge pull request #29502 from nextcloud/revert-27378-dav-recalc-checksum 2021-11-01 13:50:52 +01:00