John Molakvoæ
e4ff84d468
Scope the appdata theming storage for global and users
...
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2022-10-14 16:18:37 +02:00
Robin Appelman
63316fc572
fix null error in getUnencryptedSize
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-10-13 15:34:48 +02:00
Julius Härtl
214a50d071
Avoid allocating too much memory for the buffer
...
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-10-11 15:34:27 +02:00
raul
95bc770a37
Fix unencrypted size calculation for files created before the Encryption storage is enabled
...
Signed-off-by: raul <raul@nextcloud.com>
2022-10-03 13:44:14 +02:00
raul
45a1ebcc4c
Fix: Prevent deadlocks during mtime/size/etag propagation
...
Signed-off-by: raul <raul@nextcloud.com>
2022-10-03 13:44:14 +02:00
blizzz
ca958de7e9
Merge pull request #33566 from nextcloud/fopen-not-found-rescan
...
trigger a rescan when trying to fopen a file that exists in cache but not on disk
2022-10-01 21:47:26 +02:00
blizzz
f323c5b854
Merge pull request #34269 from nextcloud/td/noid/remove-unused-listener
...
remove listeners to OC_Filesystem::(write|rename) old style hooks
2022-10-01 16:15:39 +02:00
Carl Schwan
92a5a8f075
Cleanup tags and Share component
...
- Port to LoggerInterface
- Use IDBConnection and IQueryBuilder instead of raw SQL and OC_DB
- Use IEventListener instead of hooks
- Remove the now unused OC_DB and OC_DB_StatementWrapper legacy utils
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-09-29 15:15:28 +00:00
Robin Appelman
cb51564356
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-09-29 11:17:16 +02:00
Arthur Schiwon
9b7ef2962e
remove listeners to OC_Filesystem::(write|rename) old style hooks
...
- the events are not emitted anymore
- OC_Filesystem::isBlacklisted() is not called from anywhere else
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-09-26 21:07:08 +02: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
Vincent Petry
082432e01c
Merge pull request #33551 from nextcloud/scanner-dont-update-same-size
...
don't update the folder size if we know it hasn't changed
2022-08-17 09:21:30 +02:00
Julius Härtl
999dced07c
Merge pull request #33559 from yeyulantu/bugfix-search-cache
2022-08-16 23:54:59 +02:00
Robin Appelman
457822c144
don't update the folder size if we know it hasn't changed
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-16 13:56:51 +02:00
Robin Appelman
de63f6363f
fix updating size when folder is empty
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-16 13:54:26 +02:00
Robin Appelman
1374cbee3e
store unencrypted size in the unencrypted_size column
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-16 13:54:26 +02:00
Robin Appelman
10767d7779
fix updating cached mounts that didn't have their mount provider set previously
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-16 13:47:41 +02:00
Robin Appelman
9d6c2ce301
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-16 13:36:52 +02:00
Robin Appelman
5e375d9092
Revert "store unencrypted size in the unencrypted_size column"
...
This reverts commit 8238582e59
.
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-16 12:07:14 +02:00
David
fe3f4afd77
fixed the cache searchBuilder negative map
...
Signed-off-by: David <37280718+yeyulantu@users.noreply.github.com>
2022-08-16 17:59:02 +08:00
Carl Schwan
51b9847fad
Merge branch 'master' into display-name-cache-public
...
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-08-15 15:28:30 +02:00
Jasper Weyne
44f6c931e7
Merge branch 'master' into patch-2
2022-08-11 08:54:08 +02:00
Côme Chilliet
7ae6791737
Document all getIncomplete implementations as returning string|false
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-08-02 14:23:14 +02:00
Côme Chilliet
cb271b759e
Fix dynamic property creations in test files
...
This fixes warnings in PHP 8.2
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-08-01 15:07:53 +02:00
Côme Chilliet
472f4cad47
Merge pull request #33380 from luzpaz/fix/lib-private-typos
...
Fix typos in lib/private subdirectory
2022-07-28 09:17:48 +02:00
luz paz
368f83095d
Fix typos in lib/private subdirectory
...
Found via `codespell -q 3 -S l10n -L jus ./lib/private`
Signed-off-by: luz paz <luzpaz@github.com>
2022-07-27 08:52:17 -04:00
Robin Appelman
61fdd91dcf
don't set null
as a bundle path
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-07-27 12:58:07 +02:00
Robin Appelman
13eef55a92
always triger setup of builtin storage wrappers
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-07-21 16:36:32 +02:00
Carl Schwan
6c3c7a5e4d
Merge pull request #32981 from nextcloud/typing/carl/simplefs
...
Add typing to SimpleFS
2022-07-18 12:34:11 +02:00
Carl Schwan
f6b37e6912
Merge pull request #33064 from nextcloud/feat/capped-memorycache-ocp
...
Move CappedMemoryCache to OCP
2022-07-18 10:32:11 +02:00
Daniel
52dc51cde3
Merge pull request #32963 from nextcloud/s3-crt-bundle-download
...
also use nextcloud certificate bundle when downloading from s3
2022-07-18 09:51:19 +02:00
Carl Schwan
19a36b58a6
Add typing to SimpleFS
...
- Fix putContent sometimes return a bool and sometimes nothing
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-07-14 17:20:51 +02:00
Carl Schwan
d5c23dbb9f
Move CappedMemoryCache to OCP
...
This is an helpful helper that should be used in more place than just
server and this is already the case with groupfodlers, deck, user_oidc
and more using it, so let's make it public
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-07-14 15:54:31 +02:00
Jonas
74e9ef0fb1
Fix listening for circle events in SetupManager
...
So far, SetupManager listened for deprecated events that are no longer
triggered. Instead, use the circle events that actually get triggered
when adding or removing a circle or circle member. Also, these events
get triggered on each instance of a globalscale setup.
Fixes : #33210
Signed-off-by: Jonas <jonas@freesources.org>
2022-07-12 13:28:21 +01:00
Robin Appelman
f1486890d7
only use nextcloud bundle when explicitly enabled
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-07-05 16:06:55 +02:00
Robin Appelman
bffa67c48b
also use nextcloud certificate bundle when downloading from s3
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-07-05 15:57:54 +02:00
Jonas
7d07e06bfe
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-29 10:47:07 +00:00
Carl Schwan
46a49dee8a
Merge pull request #32994 from nextcloud/fix/extended-query-search
...
Search without join on filecache_extended
2022-06-29 11:58:20 +02:00
Carl Schwan
a1bc770043
Merge pull request #32982 from nextcloud/fix/metadata-extraction
...
Fix metadata extraction
2022-06-28 15:34:38 +02:00
Côme Chilliet
64bff27c99
Merge pull request #32960 from nextcloud/fix/avoid-using-undeclared-properties
...
Fix PHP 8.2 warnings about undeclared properties
2022-06-28 12:05:16 +02:00
Carl Schwan
f326b54e53
Search without join on filecache_extended
...
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-06-23 16:23:52 +02:00
Carl Schwan
940b5e8f0a
Fix metadata extraction
...
The metadata extraction only happens when the size is not equal to 0,
but due to a regression in FileInfo the size is always zero.
This fix the regression.
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-06-22 17:27:09 +02:00
blizzz
2e10378052
Merge pull request #31475 from nextcloud/kofemann-patch-1
...
files: close open directory file descriptor on error path
2022-06-21 18:44:05 +02:00
Côme Chilliet
1bd5222224
Fix PHP 8.2 warnings about undeclared properties
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-06-21 16:17:52 +02:00
Vincent Petry
8809de1eef
Merge pull request #31966 from nextcloud/unencrypted-size
...
store unencrypted size in the unencrypted_size column
2022-06-13 11:55:37 +02:00
Vincent Petry
bea755f153
Merge pull request #32723 from MartinBrugnara/master
...
Expose umask override value as config parameter: localstorage.umask
2022-06-10 11:23:31 +02:00
Vincent Petry
56b1453945
Merge pull request #32768 from nextcloud/fs-setup-onetime-earlier
...
perform onetime setup earlier to ensure wrappers are registered on time
2022-06-10 11:21:54 +02:00
Robin Appelman
5c768f980e
fix mounts mounted at the users home
...
this fixes external storages with '/' as mountpoint
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-06-09 19:21:56 +02:00
Robin Appelman
a937ab03dd
perform onetime setup earlier to ensure wrappers are registered on time
...
this fixes an issue with wrappers like encryption not always being applied to mountpoint that create the storage object directly (such as external storage)
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-06-08 18:49:54 +02:00
Robin Appelman
499995b37a
handle stream wrappers in SeekableHttpStream
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-06-08 17:52:27 +02:00
Jasper Weyne
0633a1d9f5
Disable ~/.aws/config access by S3ConnectionTrait
...
This commit sets the 'use_aws_shared_config_files' option to false, in order to disable configuration loading from ~/.aws/config by the AWS SDK, specifically the S3Client. It is a continuation of #27040 , as that PR only changed the behaviour of the CredentialsProvider; this change affects the ConfigurationProvider as well.
Signed-off-by: Jasper Weyne <jasperweyne@gmail.com>
2022-06-07 13:39:14 +02:00
Martin Brugnara
7409569994
Expose umask override value as config parameter: localstorage.umask
...
Commit 451c06d introduced override for umask value.
This is needed to avoid broken env configuration or dirty workers
to mess with the permissions when creating new files.
Most Nextcloud, that does not integrate with external software
would work fine with an hard-coded value (451c06d set it at 022).
Advanced install may require more flexibility, as such this commit
exposes the "umask override value" as configuration parameter:
`localstorage.umask`
It defaults to 0022 both in code and in config/config.sample.php .
Signed-off-by: Martin Brugnara <martin@0x6d62.eu>
2022-06-05 19:19:31 +02:00
Robin Appelman
8238582e59
store unencrypted size in the unencrypted_size column
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-06-02 16:07:00 +02:00
Julius Härtl
0f0e74a78c
Cleanup temporary files after finishing the write to object storage
...
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-06-02 12:57:18 +00:00
Daniel Kesselberg
f399fd41ec
Fix docblock for return type
...
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2022-05-27 20:05:46 +02:00
Simon L
18dd460720
Merge pull request #26813 from nextcloud/feature/files-search-tags
...
Files: Extend search to also cover tags
2022-05-18 10:58:02 +02:00
Robin Appelman
6d6662ec68
expose displayname cache trough a public interface
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-05-18 03:47:34 +02:00
Marcel Klehr
f755ee0868
Files: Extend search to also cover tags
...
fixes #326
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2022-05-17 21:05:09 +02:00
John Molakvoæ
fe33e9c08c
Merge pull request #32250 from nextcloud/cleanup/cappedmemorycache
2022-05-13 08:27:28 +02:00
Carl Schwan
ec6b83cc18
Add stricter psalm type for CappedMemoryCache
...
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-05-12 15:06:18 +02:00
Carl Schwan
a392cd70fb
Make it possible to get the appdata folder using the public API
...
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-05-11 23:28:37 +02:00
Vincent Petry
fe24091ffb
Merge pull request #32110 from plumbeo/binary-encoding-4
...
Save encrypted files in binary format
2022-05-05 18:04:06 +02:00
Vincent Petry
4147e1233a
Merge pull request #32152 from nextcloud/bugfix/32151/allow-compatibility-wrapper-local-ext-storage
...
Allow compatibility wrapper on local external storage
2022-05-05 08:18:52 +02:00
plumbeo
1258caeab7
Save encrypted files in binary format
...
Default to the more space-efficient binary encoding for newly encrypted files
instead of the traditional base64 encoding, eliminating the 33% overhead.
The new option 'encryption.use_legacy_encoding' allows to force the legacy
encoding format if needed. Files encoded in the old format remain readable.
Based on https://github.com/owncloud/encryption/pull/224 and
https://github.com/owncloud/core/pull/38249 by karakayasemi.
Signed-off-by: plumbeo <plumbeo@users.noreply.github.com>
2022-05-04 17:38:25 +02:00
Côme Chilliet
459202d54c
Merge pull request #31752 from nextcloud/fix/remove-still-more-ilogger
...
Move away from deprecated ILogger
2022-05-02 10:15:10 +02:00
Carl Schwan
dbdb9f6f11
Merge pull request #32034 from nextcloud/bugfix/noid/satisfy-binary-operation-order
...
Make the binary operation order explicit
2022-04-27 11:53:18 +02:00
Côme Chilliet
2b07031d3e
composer run cs:fix
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-04-26 16:52:53 +02:00
Côme Chilliet
23f7a37c03
Remove ILogger usages in lib/private/Files/Storage
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-04-26 16:52:53 +02:00
Côme Chilliet
069477e608
Migrate more classes of lib/private to LoggerInterface
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-04-26 16:52:52 +02:00
Vincent Petry
23403ef693
Allow compatibility wrapper on local external storage
...
The check was likely in place to prevent adding the wrapper on the root
and home storage, which is not possible anyway since the encoding option cannot
be set on that mount.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-04-26 09:27:29 +02:00
Vincent Petry
6935baa568
Merge pull request #32084 from nextcloud/root-setup-groupfolders
...
only need to setup root for groupfolders
2022-04-25 19:35:59 +02:00
Robin Appelman
f7413b9afc
Merge pull request #32074 from nextcloud/mysql-search-ignore-index-2
...
tell mysql to ignore the sort index for search queries
2022-04-25 11:23:51 +00:00
Vincent Petry
ff385dc679
Merge pull request #32082 from nextcloud/directory-content-lazy-owner
...
use a lazy user for the file owner when listing a directory
2022-04-25 11:44:44 +02:00
Vincent Petry
e693781c21
Merge pull request #32079 from nextcloud/directory-listing-optimize-add-submount
...
optimize adding submount info to directory content
2022-04-25 11:44:26 +02:00
Robin Appelman
b36dfd8f11
Only need to setup root for groupfolders
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-22 17:47:08 +02:00
Julius Härtl
fb59875071
Merge pull request #32040 from nextcloud/full-setup-only-new
...
only register mounts that are new from providers that are new during a full setup
2022-04-22 17:03:09 +02:00
Robin Appelman
7a6c724a81
Use a lazy user for the file owner when listing a directory
...
Only getUID and getDisplayName are called on the file owner objects anyway
and we can get this information often without DB request
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-22 17:02:37 +02:00
Robin Appelman
9f0ba3adc2
optimize adding submount info to directory content
...
no need to loop when we can do a hashtable lookup
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-22 15:50:14 +02:00
Robin Appelman
a4e120c203
tell mysql to ignore the sort index for search queries
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-22 13:42:33 +02:00
Robin Appelman
bbf283f818
cache fullSetupRequired locally
...
no need to hit redis every time
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-21 16:00:28 +02:00
Robin Appelman
561a2071e4
only register mounts that are new from providers that are new during a full setup
...
this fixes cases where during the (partial) setup of a shared mount a full setup is triggered
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-21 12:53:50 +02:00
Joas Schilling
49e62149d8
Make the binary operation order explicit
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-21 10:47:26 +02:00
Robin Appelman
caebdc2a55
Merge pull request #32024 from nextcloud/local-metadata-forbidden
...
ignore forbidden files while scanning local storage
2022-04-20 12:34:23 +00:00
Robin Appelman
468d6a9cf1
ignore forbidden files while scanning local storage
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-20 13:01:16 +02:00
Arthur Schiwon
1ec4563c2e
log stacktrace for 'Backends provided no user object'
...
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-04-20 12:15:39 +02:00
Carl Schwan
7817845538
Add a metadata service to store file metadata
...
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-04-13 14:06:29 +02:00
Robin Appelman
b65d214f15
perform a setup if we can't find any mounts containing a file
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-11 19:15:58 +02:00
Vincent Petry
1b819b8649
Merge pull request #31901 from nextcloud/fs-setup-tweaks
...
Filesystem setup tweaks
2022-04-08 17:47:36 +02:00
Vincent Petry
0d7d28e530
Merge pull request #31676 from nextcloud/enh/ocp-owner-lock
...
Add public API for owner based file locking
2022-04-08 17:43:26 +02:00
Robin Appelman
499749dbc1
more preset metadata for LazyUserFolder
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-08 15:09:40 +02:00
Robin Appelman
54e52e9b5e
always do full setup for home folder with submounts
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-08 15:05:43 +02:00
Robin Appelman
bdc86e9486
add missing return
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-08 15:04:35 +02:00
Robin Appelman
9834350ac3
Merge pull request #31713 from nextcloud/fed-performance
...
Federated share performance improvements
2022-04-07 18:53:36 +00:00
Julius Härtl
9b408d556d
Adapt LockScope to LockContext rename
...
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-04-07 11:52:16 +02:00
Robin Appelman
5e69f98c16
sh
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-06 18:08:13 +02:00
Robin Appelman
151c800397
allow reusing known folder info when getting directory contents
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-06 14:40:34 +02:00
Robin Appelman
9b1abd6fac
save filesystem node in dav node
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-06 14:40:31 +02:00
Robin Appelman
791dc509d3
only setup home mount when getting home folder
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-06 13:13:32 +02:00
Côme Chilliet
fff26ad006
Merge pull request #31754 from nextcloud/fix/view-inconsistent-if-conditions
...
Fix incorrect if conditions in View
2022-04-05 18:06:42 +02:00
Vincent Petry
0cdf03b733
Merge pull request #31773 from nextcloud/share-limited-owner-setup
...
Perform a limited filesystem setup when getting share source
2022-04-05 17:05:57 +02:00
Côme Chilliet
140624d551
composer run cs:fix
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-04-05 16:47:13 +02:00
Côme Chilliet
d36a1a7bf6
Exit early if $storage is falsy in View::getDirectoryContent
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-04-05 13:58:49 +00:00
Côme Chilliet
916fbe81c6
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-05 13:58:49 +00:00
John Molakvoæ
47cc5a9405
Merge pull request #29510 from nextcloud/backport/27378/master
2022-04-04 22:15:01 +02:00
Joas Schilling
a44671d396
Merge pull request #31816 from nextcloud/bugfix/noid/deduplicate-storage-id-before-reusing
...
Deduplicate storage ids in list before reusing
2022-04-04 19:00:22 +02:00
Robin Appelman
cc5e26bb14
Merge pull request #31776 from nextcloud/storage-id-cache-bi-directional
...
cache storage id mapping both ways
2022-04-04 14:50:23 +00:00
Robin Appelman
f9a5fb99fd
use the same cached propfind for free space for dav storage
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 16:48:31 +02:00
Robin Appelman
5e2dd29aaf
only request free space once for external shares
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 16:48:27 +02:00
Robin Appelman
89d3cd1447
don't overwrite the etag from storage backends that already provide "good" etags
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 16:48:18 +02:00
Robin Appelman
d84f9fa9bb
rename cached fileinfo on rename
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 15:40:28 +02:00
Robin Appelman
754603a04e
dont needlessly resolve path when getting internalPath/storage from Node
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 15:40:24 +02:00
Robin Appelman
8b12c75ca2
don't do a full setup for findByStorageId
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 15:40:20 +02:00
Robin Appelman
44a8ebdc1f
optimize getById on LazyUserFolder to not require a full fs setup
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 15:40:16 +02:00
Robin Appelman
700444e218
split out some path manipulation logic
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 15:40:12 +02:00
Robin Appelman
99ac46d8f5
allow getting mounts by providers
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 14:57:56 +02:00
Julius Härtl
40f1ad60c2
Add public API for owner based locking
...
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-04-04 09:02:56 +02:00
Joas Schilling
d3b9d49c22
Deduplicate storage ids in list before reusing
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-04 07:07:48 +02:00
Robin Appelman
ac657b0f06
cache storage id mapping both ways
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-31 14:35:42 +02:00
Robin Appelman
ff666e648a
Add dav plugin to trigger recalculating of checksums
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-31 07:44:13 +00:00
Louis
7d2cb35988
Merge pull request #31632 from Maaxxs/fix-undefined-index-dav
...
Fixes the undefined index error with the DAV property getlastmodified
2022-03-29 13:53:15 +02:00
Côme Chilliet
765999f454
Merge pull request #31609 from nextcloud/fix/migrate-away-from-ilogger
...
Migrate from ILogger to LoggerInterface in lib/private
2022-03-29 09:39:38 +02:00
Max Kunzelmann
2952c7d01f
Use the null coalescing operator to set the value of size
.
...
Signed-off-by: Max Kunzelmann <maxdev@posteo.de>
2022-03-28 22:26:45 +02:00
Vincent Petry
1bc86a95c4
Make phpcs happy in MountProviderCollection
...
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-03-24 20:26:42 +01:00
Robin Appelman
881e107543
Apply suggestions from code review
...
Co-authored-by: Louis <6653109+artonge@users.noreply.github.com>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:41:37 +01:00
Robin Appelman
1179873f33
add comment for getMountForPath loop
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:36:59 +01:00
Robin Appelman
b7a7425fbd
make mount cache duration configurable
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:36:53 +01:00
Robin Appelman
63ad99ba4a
fix method name
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:04:01 +01:00
Robin Appelman
f7c942a943
caching of userfolder
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:03:58 +01:00
Robin Appelman
70c37c2717
fmt
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:03:55 +01:00
Robin Appelman
89919b0e24
invalidate mount cache on circles change
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:03:52 +01:00
Robin Appelman
15c9a3114a
perform full setup if a cached mount doesn't have a provider set
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:03:16 +01:00
Robin Appelman
d342c764f2
don't double setup provider when calling setupForUser
after setupForPath
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:03:13 +01:00
Robin Appelman
6b085b6fd1
add logic to perform a full filesystem setup when needed
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:03:10 +01:00
Robin Appelman
506d29c095
update cached mounts when only specific providers have been setup
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:01:55 +01:00
Robin Appelman
79f6742410
improve lazy UserFolder
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:01:49 +01:00
Robin Appelman
19c64cf8b6
setup only relevant mounts when possible
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:01:46 +01:00
Robin Appelman
55d943fd4b
fixed when accessing static filesystem calls before setup
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:01:42 +01:00
Robin Appelman
469a684d45
allow getting mounts by provider
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:01:38 +01:00
Robin Appelman
04052a9594
allow getting cached mounts by path from the mount cache
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:01:12 +01:00
Robin Appelman
3fc5c97282
return a lazy folder from Root::getUserFolder
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:01:08 +01:00
Robin Appelman
46d0eef8da
allow setting some metadata in the lazyfolder without having to get the real folder
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:01:01 +01:00
Côme Chilliet
e8c1f75064
Fixing psalm errors
...
Encryption constructor is problematic and should still be fixed later.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:26 +01:00
Côme Chilliet
ea23523c70
Adapt more code to migration to LoggerInterface
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:25 +01:00
Côme Chilliet
6be7aa112f
Migrate from ILogger to LoggerInterface in lib/private
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:25 +01:00
Max Kunzelmann
3a135f0c5f
Set mtime
to null instead of false if getlastmodified
does not exist.
...
Signed-off-by: Max Kunzelmann <maxdev@posteo.de>
2022-03-23 15:02:01 +01:00
Max Kunzelmann
e0a5fe649a
Fix typo.
...
Signed-off-by: Max Kunzelmann <maxdev@posteo.de>
2022-03-20 11:07:36 +01:00
Max Kunzelmann
ee888875bb
Fixes the undefined index error with the DAV property getlastmodified
...
Signed-off-by: Max Kunzelmann <maxdev@posteo.de>
2022-03-20 00:38:07 +01:00
Robin Appelman
6fae598390
Merge pull request #31608 from nextcloud/scanner-performance2
...
some file scanner performance improvements
2022-03-17 22:06:45 +00:00
Robin Appelman
84f464550a
some file scanner performance improvements
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-17 22:21:16 +01:00
Robin Appelman
577b1fa856
setup for current user when finding mounts in the root
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-17 14:56:49 +01:00
Robin Appelman
1156214a26
don't try to get custom certs for s3 primary storage
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-15 15:50:08 +01:00
Robin Appelman
194a21f374
use the nextcloud certificate bundle for s3
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-14 18:09:48 +01:00
Robin Appelman
e8872f01ae
Merge pull request #31431 from nextcloud/fs-setup-manager
...
Unify/cleanup filesystem setup
2022-03-08 14:50:25 +00:00
Pytal
232af474a8
Merge pull request #31418 from nextcloud/enh/simple-file-extension
2022-03-07 11:38:23 -08:00
Tiramisu Mokka
8190441335
files: close open directory file descriptor on error path
2022-03-07 10:19:58 +01:00
Robin Appelman
917c74e214
type fixes
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:30:16 +01:00
Robin Appelman
07a7dcb824
move user mountpoint setup to setupmanager
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:30:12 +01:00
Robin Appelman
d81713e5c1
simplify setup of circular SetupManager<->Manager
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:30:09 +01:00
Robin Appelman
6c1d051ecd
add template annotations to CappedMemoryCache
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:30:06 +01:00
Robin Appelman
22875bf367
move logic to decide what to setup to setupmanager
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:30:03 +01:00
Robin Appelman
1c468129af
adjust tests to new fs setup
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:29:59 +01:00
Robin Appelman
5c0fe93498
move teardown logic to SetupManager
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:29:50 +01:00
Robin Appelman
15ff65c12f
start moving filesystem setup logic to it's own place
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:29:47 +01:00
Robin Appelman
7630d7a934
more type hints for ICachedMountInfo and IMountManager
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:28:11 +01:00
Robin Appelman
8b22a463e9
Merge pull request #31266 from nextcloud/root-setup-mountprovider
...
move root mount setup to mountproviders
2022-03-04 13:44:05 +00:00
Christopher Ng
0571391b10
Extend simple file with extension getter
...
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2022-03-04 06:11:53 +00:00
Joas Schilling
88f4e972c5
Don't set up full filesystem to check for certificates
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-02-26 00:40:12 +01:00
Robin Appelman
b0ce876f41
return dummy availability if storage is not found in cache
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-02-25 15:25:13 +01:00
Robin Appelman
8b7c8447a0
move root mount setup to mountproviders
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-02-24 17:21:42 +01:00
Robin Appelman
cfb7923e08
store mountprovider for each mount in the mounts table
...
this enabled more fine grained filesystem setup
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-02-23 18:02:33 +01:00
Louis Chemineau
bc2c02f451
Wrap S3 multipart upload exception
...
Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-02-16 14:56:14 +01:00
Louis Chemineau
0b768c17d2
Wrap S3 multipart upload exception
...
Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-02-15 17:35:12 +01:00
Vincent Petry
787716613f
Merge pull request #31035 from paierlep/fix/occ_scan_no_files_error
...
Removes misleading error message in occ files:scan for new users.
2022-02-10 18:07:21 +01:00
Robin Appelman
2673775f6e
fix fs cache test user setup
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-02-09 16:01:28 +01:00
Robin Appelman
1ab58eff0f
pass user object during fs init
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-02-09 16:01:24 +01:00
Robin Appelman
0217949715
only setup part of the filesystem for appdata requests
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-02-09 16:01:21 +01:00
Christian Paier
9476ce70ed
Removes misleading error message in occ files:scan for new users.
...
Previously the occ files:scan command printed an error message for any
new users without any files/folders in the data directory.
With this change only users with any file/folder is scanned.
This fixes #25433 .
Signed-off-by: Christian Paier <hallo+git@cpaier.com>
2022-02-05 23:54:56 +01:00
MichaIng
ba1338e680
Return 404 when AJAX tries to list dir content but file given
...
Due to a code mistake, the expected 404 return when AJAX tries to list a directory content with a non-directory file path given, does not happen. It instead fails with another exception.
This commit restores the original intention to return 404 in the first place when passing a non-directory path with the "dir" parameter.
Signed-off-by: MichaIng <micha@dietpi.com>
2022-01-26 16:11:50 +01:00
Côme Chilliet
5cca86ce19
Remove redundant if clause
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-01-25 16:53:35 +01:00
Côme Chilliet
35dcda36a3
Fix OC\Files\Storage\DAV::hasUpdated when cache is not set
...
Fixes the test OCA\Files_External\Tests\Storage\WebdavTest::testStat on
PHP>=7.4
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-01-25 16:53:19 +01:00