Commit graph

1192 commits

Author SHA1 Message Date
Robin Appelman
d0538bca49
Merge pull request #37876 from nextcloud/backport/37820/stable25
[stable25] ignore errors while trying to update parent storage_mtime
2023-04-24 17:11:30 +02:00
Robin Appelman
5c8a8df114 ignore errors while trying to update parent storage_mtime
in the worst case this should only cause an extra rescan later

Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-21 17:41:47 +00:00
Git'Fellow
99a8cabbcd Add function_exists() check
Co-authored-by: Simon L. <szaimen@e.mail.de>
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2023-04-21 17:04:38 +00:00
Git'Fellow
54667bc819 Fix free space problems
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2023-04-21 17:04:38 +00:00
Robin Appelman
30d01b6fce
Merge pull request #37560 from nextcloud/backport/36097/stable25
[stable25] extend path-prefix optimizer to remove all cases of path_hash= when encountering a path prefix filter
2023-04-06 13:07:33 +02:00
Robin Appelman
5e0c98b8bc extend path-prefix optimizer to remove all cases of path_hash= when encountering a path prefix filter
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-03 16:35:54 +00:00
Robin Appelman
034f5a17ee clear encrypted flag when moving away from encrypted storage
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-01 16:22:42 +00:00
blizzz
e57d799616
Merge pull request #36442 from nextcloud/backport/36433/stable25
[stable25] fix(encryption): don't throw on missing file
2023-02-07 18:33:55 +01:00
Richard Steinmetz
05aa57f98d fix(encryption): don't throw on missing file
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2023-01-30 15:49:53 +00:00
Robin Appelman
af823ec7f9 fix moving files of encrypted local storage to unencrypted local storage
for example when moving encrypted files to a groupfolder

Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-01-26 08:56:32 +00:00
Robin Appelman
5c743ac135 escape path prefix when doing cache jail search
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-01-11 16:58:54 +00:00
Côme Chilliet
77f2f9776f
Silence a warning from psalm with explanation
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-19 14:47:52 +01:00
Côme Chilliet
ad999e5521
Adapt types of subclasses
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-19 14:47:51 +01:00
Côme Chilliet
79922e2f86
Make it clear that file sizes may be float on 32bits
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-19 14:47:51 +01:00
Vincent Petry
e0f6f7e6ac
Remove quota value type for 32-bit systems
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-12-19 14:47:51 +01:00
Vincent Petry
eb18c9c43c
Merge pull request #35516 from nextcloud/backport/35502/stable25
[stable25] Fix SQL comparison with int array during external storage deletion
2022-12-16 16:52:12 +01:00
Julius Härtl
7107a3affe Also update the unencrypted size of files when creating them with empty content
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-12-08 09:18:00 +00:00
Julius Härtl
0387439422 Update the unencrypted file size when closing streams
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-12-08 09:18:00 +00:00
Andy Xheli
5200b0e5f2 Fix Executing a query: SQLSTATE[42000]
Signed-off-by: Andy Xheli <axheli@axtsolutions.com>

Fix https://github.com/nextcloud/server/issues/32007#issuecomment-1329405245

Signed-off-by: Andy Xheli <axheli@axtsolutions.com>
2022-11-30 11:48:43 +00:00
Louis Chemineau
cb99a5795d Update cache when file size === 0
The conditions were false when $result === 0.
$results here contains the number of written bits.
The correct way of checking for operation success is to check if $result === false

Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-11-23 14:57:32 +00:00
Robin Appelman
326eba8c2c delay updating setup providers untill we register the mounts
otherwise the fallback to a full setup for a missing cached mount provider will lead to a race condition

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-11-18 14:32:02 +00:00
Côme Chilliet
bc908b044a Make sure that path is normalized and then checked,
and not the other way around

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-11-10 17:55:12 +00:00
Robin Appelman
5733fccdd1 fix null error in getUnencryptedSize
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-10-21 14:59:40 +00:00
John Molakvoæ
f4a14cfe69
Scope the appdata theming storage for global and users
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2022-10-14 16:19:32 +02:00
Julius Härtl
775e4e023d Avoid allocating too much memory for the buffer
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-10-12 08:30:58 +00:00
blizzz
0612e008d4
Merge pull request #34405 from nextcloud/backport/34302/stable25
[stable25] Fix: Prevent deadlocks during mtime/size/etag propagation
2022-10-05 12:52:29 +02:00
Robin Appelman
0a2744a998 trigger a rescan when trying to fopen a file that exists in cache but not on disk
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-10-03 15:28:30 +00:00
raul
7ed5679f2c Fix unencrypted size calculation for files created before the Encryption storage is enabled
Signed-off-by: raul <raul@nextcloud.com>
2022-10-03 14:29:01 +00:00
raul
380aaef96e Fix: Prevent deadlocks during mtime/size/etag propagation
Signed-off-by: raul <raul@nextcloud.com>
2022-10-03 14:29:01 +00:00
Carl Schwan
3950deb42f
Merge pull request #32740 from jasperweyne/patch-2
Fix open_basedir issues by AWS SDK
2022-09-19 10:19:15 +02:00
Vincent Petry
1025d049c7
Merge pull request #24596 from kofemann/dcache-worm
make NextCloud WORM file system friendly
2022-09-16 14:39:13 +02:00
Vincent Petry
b3ca186d2d
Merge pull request #34020 from nextcloud/logical-op
Switch logical operators (and|or)
2022-09-16 13:35:19 +02:00
Tigran Mkrtchyan
f41209a061 config: add a switch to control truncate before update
To avoid extra truncate on non WORM file systems, add a new config
option `localstorage.unlink_on_truncate`, which defaults to false.

The OC\Files\Storage\Local is update to respect that option.

Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
2022-09-16 11:10:32 +02:00
Tigran Mkrtchyan
8fc4cf67f1 files: remove destination file before copying new content (WORM)
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
2022-09-16 10:57:17 +02:00
Robin Appelman
d8961ed10f
fix using FSEEK_END with SeekableHttpStream to get file size
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-09-15 17:23:16 +02:00
Git'Fellow
5300f0d693
Switch logical operators (and|or)
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2022-09-12 09:35:12 +02:00
Carl Schwan
eac54c4660
Merge pull request #33788 from nextcloud/improve-recent
Improve getting recent files performance
2022-09-08 16:19:41 +02:00
blizzz
417f46e467
Merge pull request #33600 from nextcloud/lazy-quota
get quota for user only when needed
2022-09-07 18:10:33 +02:00
Carl Schwan
67551f379f
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-05 12:53:32 +02:00
Robin Appelman
9f5f970957
handle errors from hash_final
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-09-02 12:27:13 +02:00
Robin Appelman
bd91c56539
get quota for user only when needed
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>
2022-09-01 19:32:24 +02:00
Robin Appelman
a9575a7029
handle cases where the hash context gets cleaned up before the hash wrapper
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-31 15:05:10 +02:00
Robin Appelman
e9ba58ca61
remove leading slash for search results at mountpoint root
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-29 17:33:43 +02:00
Tigran Mkrtchyan
b6065a236f files: make OC\Files\Storage\Local WORM friendly
Some filesystems run as a Write-Once-Read-Many storages. This
makes them impossible to use with NexeCloud, as the file system
layers uses `truncate` syscall (through file_put_contents function).

As Nextcloud is never updates existing files, removing the old entry
and creatint a new one on update will allow NextCoud to update on such
file systems.

Update Local#fopen and Local#file_put_contents to remote existing
file before truncating.

Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
2022-08-25 11:11:49 +02:00
Julius Härtl
83b1415906
Only pass parent if paths match
As the user folder might be initialized by the root from two levels
down the hierarchy, passing this as a parent only works if the path matches

Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-08-24 22:20:32 +02:00
Julius Härtl
b2d6435737
Avoid extra query for the parent node if we can pass it along
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-08-24 22:20:32 +02:00
Robin Appelman
b6f8b8da60 directly build the search filter for shared storage instead of setting up the source cache
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-17 11:58:57 +02:00
Vincent Petry
312b719acf
Merge pull request #32943 from nextcloud/unencrypted-size-revert-interface-changes
Revert interface changes from "store unencrypted size in the unencrypted_size column"
2022-08-17 11:36:16 +02:00
Vincent Petry
11d5a1d3df
Merge pull request #33550 from nextcloud/jail-search-post
optimize search post-processing for jail wrapper
2022-08-17 10:55:41 +02:00
Vincent Petry
2360d880fa
Merge pull request #33540 from nextcloud/mount-provider-migration
fix updating cached mounts that didn't have their mount provider set previously
2022-08-17 10:41:31 +02:00