Commit Graph

1515 Commits (ba94de2510b3858f10d60f0230a58b1252346372)

Author SHA1 Message Date
Daniel Kesselberg f1d4f7c7e4
fix: copy-and-delete fallback should use unlink
because rmdir does not work for files.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2023-07-31 21:41:25 +07:00
Daniel Kesselberg b4ff557b8c fix(storage): fallback to copy and unlink when rename fails
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2023-07-31 18:54:21 +07:00
Tobias Zimmerer 23f85b5ac2 fix(s3): add SSE-C parameters to headObject call
Signed-off-by: Tobias Zimmerer <3228193+ir0nhide@users.noreply.github.com>
2023-07-30 22:54:58 +07:00
Robin Appelman fda820a64d
expose MovableMount in public interface
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-07-28 14:42:09 +07:00
Joas Schilling 3962cd0aa8
fix!: Move getEventDispatcher usage to IEventDispatcher
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-28 14:11:22 +07:00
Joas Schilling 44a0a62107
fix: Move Node HookConnecter events to IEventDispatcher
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-27 09:57:53 +07:00
Robin Appelman 31f1ff87d0
Merge pull request #39367 from nextcloud/s3-fopen-exception
handle more exceptions in AmazonS3::fopen
2023-07-20 19:32:03 +07:00
Robin Appelman c912a3f0f6
Merge pull request #38860 from nextcloud/scanner-change-summary
add summary of detected changes to files:scan output
2023-07-20 18:37:07 +07:00
Julius Härtl 77f249726d
Merge pull request #38934 from nextcloud/bugfix/noid/ssec-multipart 2023-07-20 11:00:08 +07:00
Robin Appelman b0e663fa28
fix SeekableHttpStream::stream_stat errors on failed open
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-07-13 15:38:58 +07:00
Arthur Schiwon f2642fcceb
fix(node): non-existing folder is not searchable
the previosuly introduced searchBySystemTag was not overwritten in
NonExistingFolder and could run the inherited method.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-07-13 00:01:32 +07:00
Hamid Dehnavi d0b20534b9 Refactor "substr" calls to improve code readability
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
2023-07-07 04:54:20 +07:00
Christoph Wurst 14719110b9 chore: Replace \OC::$server->query with \OCP\Server::get in /lib
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-07-06 15:21:22 +07:00
Richard Steinmetz c4eccbb304
fix(sse): don't update uncached files
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2023-07-04 12:42:29 +07:00
Julius Härtl eddb64f8c3
Merge pull request #37969 from nextcloud/poc/noid/systemtags-perf-tag-endpoint 2023-06-28 07:53:35 +07:00
Robin Appelman 39a0554c09
Merge pull request #38858 from nextcloud/scanner-performance3
file scanner performance improvements
2023-06-26 17:01:18 +07:00
Arthur Schiwon 17515995fa
Merge pull request #38625 from nextcloud/fix/noid/querysearchehelper-narrow-type
fix: expect interface, not a specific implementation
2023-06-24 00:13:43 +07:00
Robin Appelman 493e151be0
dav: clean path before putting it in the statcache
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-06-23 14:39:17 +07:00
Robin Appelman 279822c217
implement optimized getDirectoryContent for DAV
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-06-22 16:34:32 +07:00
Arthur Schiwon a0f9556f7c
fix: cominbation of small fixes
- possible null return
- parameter name mismatch in implementation
- incomplete unit test

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-06-21 20:28:01 +07:00
Arthur Schiwon 49db546f78
fix: include invisible tags for admins
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-06-21 20:28:01 +07:00
Julius Härtl ea575e342f
fix(s3): Pass SSE-C parameters for multipart upload
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-06-21 18:32:24 +07:00
Arthur Schiwon 221562d45d
feat: add searchBySystemTag as PHP API
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-06-21 18:19:09 +07:00
Arthur Schiwon 783e32a64d
fix: favorites view and universal search against tags
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-06-21 18:19:08 +07:00
Arthur Schiwon b0d1cf5730
fix: change if with conditionless else to switch; and a parameter value
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-06-21 18:19:08 +07:00
Arthur Schiwon 58f7fd2370
use efficient tag retrieval on DAV report request
- uses DAV search approach against valid files joined by systemtag selector
- reduced table join for tag/systemtag search
- supports pagination
- no changes to the output formats or similar

Example request body:

<?xml version="1.0"?>
<oc:filter-files xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns" xmlns:ocs="http://open-collaboration-services.org/ns">
  <d:prop>
    <d:getcontentlength/>
    <d:getcontenttype/>
    <d:getetag/>
    <d:getlastmodified/>
    <d:resourcetype/>
    <nc:face-detections/>
    <nc:file-metadata-size/>
    <nc:has-preview/>
    <nc:realpath/>
    <oc:favorite/>
    <oc:fileid/>
    <oc:permissions/>
    <nc:nbItems/>
  </d:prop>
  <oc:filter-rules>
    <oc:systemtag>32</oc:systemtag>
  </oc:filter-rules>
  <d:limit>
    <d:nresults>50</d:nresults>
    <nc:firstresult>0</nc:firstresult>
  </d:limit>
</oc:filter-files>

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-06-21 18:19:08 +07:00
Arthur Schiwon 088a0eea29
ci: pro forma check of existence of internal method
createNode() is protected and used by Folder, but being an internal-only
method it shall not be exposed in the Folder or IRootFolder interface.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-06-21 16:53:20 +07:00
Arthur Schiwon 71e41ffeeb
refactor: declare getMount() and getMountsIn() at IRootFolder
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-06-21 16:53:20 +07:00
Arthur Schiwon f6ac874dbf
chore: ugly type juggling
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-06-21 16:53:20 +07:00
Arthur Schiwon 167a5f394d
fix: add typehine for IRootFolder
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-06-21 16:53:19 +07:00
Arthur Schiwon eb50b6c6aa
fix: expect interface, not a specific implementation
- fixes a regression when deleting folders while music app was enabled,
  for a LazyRoot was passed to this method.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-06-21 16:53:13 +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 292c0e53f8
add summary of detected changes to files:scan output
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-06-16 17:56:34 +07:00
Robin Appelman 561536fc58
file scanner performance improvements
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-06-16 16:31:48 +07:00
Dominik Fuchß e3f6a13e14 Fix deprecated method call
Signed-off-by: Dominik Fuchß <develop@fuchss.org>
2023-06-13 10:31:33 +07:00
Dominik Fuchß a4a57409db Changes after code review.
Signed-off-by: Dominik Fuchß <develop@fuchss.org>
2023-06-13 10:31:33 +07:00
Dominik Fuchß c3ba871f36 Add config variable for curl timeout
Add the config variable for curl calls ("remote_curl_timeout"). E.g., needed for nextcloud federation.

Signed-off-by: Dominik Fuchß <develop@fuchss.org>
2023-06-13 10:31:33 +07:00
Robin Appelman ea88ec1350
add utility command for object store objects
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-06-09 18:08:18 +07:00
Christoph Wurst 872c181c74
chore: Drop dead private methods in /lib
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-06-06 11:01:58 +07:00
Simon L 702196dd86
Merge pull request #38478 from nextcloud/backport/38440/master
[master] fix: Catch Deadlock properly as execute throws Doctrine exceptions not our wrapped ones
2023-06-05 23:22:40 +07:00
Robin Appelman 9f1d497a0b
Merge pull request #38261 from fsamapoor/replace_strpos_calls_in_lib_private
Refactors "strpos" calls in  lib/private to improve code readability.
2023-06-01 23:10:00 +07:00
Julius Härtl 9453c2d40d fix: execute throws docrine exceptions not our wrapped ones
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-05-26 06:56:55 +07:00
Simon L f29aa2997e
Merge pull request #38429 from tanganellilore/fix_delete_user_syslink
Fix deletion of User when system link are used in him user folder
2023-05-26 01:12:34 +07:00
Lorenzo Tanganelli 6b55e92e33
invert elseif on rmdir for local storage
Signed-off-by: Lorenzo Tanganelli <lorenzo.tanganelli@hotmail.it>
2023-05-24 08:22:50 +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
Faraz Samapoor 9f6f4b105f
Update Detection.php
The latter implies the former.

https://github.com/nextcloud/server/pull/38261#discussion_r1196708412

Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
2023-05-17 20:37:35 +07:00
Simon L ab848244fe
Merge pull request #38065 from nextcloud/fix-result-mimetype-loader
fix(mimetype): Fix returning value when finding existing mimetype in MimeType Loader
2023-05-16 11:30:13 +07:00
Côme Chilliet 8362eea14e
Merge pull request #38196 from nextcloud/fix/fix-32bits-freespace-and-sizes
Get rid of more int casts in file size manipulations
2023-05-15 17:05:46 +07:00
Faraz Samapoor e7cc7653b8 Refactors "strpos" calls in lib/private to improve code readability.
Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
2023-05-15 15:17:19 +07:00
Côme Chilliet ae525e1935
Fix return types in phpdoc
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-05-15 12:24:42 +07:00
Côme Chilliet 3bf19f76e6
Merge pull request #32961 from nextcloud/more-debug-lazyuserfolder
Make it easier to debug issue #32304
2023-05-15 11:42:06 +07:00
Julius Härtl e18f97fc95
Merge pull request #37709 from nextcloud/bugfix/deadlock 2023-05-13 13:13:04 +07:00
Julius Härtl 8cab1d73ac
Merge pull request #37621 from nextcloud/enh/lock-readable-path 2023-05-13 13:11:37 +07:00
Côme Chilliet a90581b405
Get rid of more int casts in file size manipulations
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-05-11 12:46:16 +07:00
Arthur Schiwon b6c034ac57
Merge pull request #37961 from nextcloud/poc/noid/systemtags-perf
SystemTags endpoint to return tags used by a user with meta data
2023-05-11 10:16:03 +07:00
John Molakvoæ db02684008
Merge pull request #37691 from nextcloud/object-store-background-scan 2023-05-11 08:15:41 +07:00
Robin Appelman 2ea41dab93
repair -1 folder sizes for object store background scan
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-05-10 19:33:26 +07:00
Arthur Schiwon df662f50bd
refactor: remove where specification from SELECT getter
- search constraints are now fully in control of
  SystemTagsInFilesDetector::detectAssignedSystemTagsIn(), avoids
  duplication of a WHERE statement

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-05-10 18:48:06 +07:00
Arthur Schiwon dbfd2f936a
refactor: remove SystemTag logic from Folder into QuerySearchHelper
- adds OC\SystemTag\SystemTagsInFilesDetector where the search logic is
  moved to

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-05-09 23:51:52 +07:00
Arthur Schiwon 2489a2d63a
feat: specify media type via url path: systemtags-current/$mediaType
- only the media part of the mime type can be search, but not the full
  mime type. It can be added, should it become necessary.
- thus fixes previously hardcoded selector for image/ types
- also fixes a return type hint
- adds a return type hint

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-05-09 23:51:51 +07:00
Arthur Schiwon 6bff6a5667
PoC: SystemTags endpoint to return tags used by a user with meta data
Target case is photos app: when visiting the tags category, all systemtags
of the whole cloud are retrieved. In subequent steps the next tag is
requested until the browser view is filled with tag tiles (i.e. previews
are requested just as well).

With this approach, we incorpoate the dav search and look for user related
tags that are used by them, and already returns the statistics (number of
files tagged with the respective tag) as well as a file id for the purpose
to load the preview. This defaults to the file with the highest id.

Call:
curl -s -u 'user:password' \
  'https://my.nc.srv/remote.php/dav/systemtags-current' \
  -X PROPFIND -H 'Accept: text/plain' \
  -H 'Accept-Language: en-US,en;q=0.5'  -H 'Depth: 1' \
  -H 'Content-Type: text/plain;charset=UTF-8' \
  --data @/home/doe/request-systemtag-props.xml

With request-systemtag-props.xml:
<?xml version="1.0" encoding="UTF-8"?>
<d:propfind xmlns:d="DAV:">
        <d:prop xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
                <oc:id/>
                <oc:display-name/>
                <oc:user-visible/>
                <oc:user-assignable/>
                <oc:can-assign/>
                <nc:files-assigned/>
                <nc:reference-fileid/>
        </d:prop>
</d:propfind>

Example output:
  …
  <d:response>
    <d:href>/master/remote.php/dav/systemtags/84</d:href>
    <d:propstat>
      <d:prop>
        <oc:id>84</oc:id>
        <oc:display-name>Computer</oc:display-name>
        <oc:user-visible>true</oc:user-visible>
        <oc:user-assignable>true</oc:user-assignable>
        <oc:can-assign>true</oc:can-assign>
        <nc:files-assigned>42</nc:files-assigned>
        <nc:reference-fileid>924022</nc:reference-fileid>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/dav/systemtags/97</d:href>
    <d:propstat>
      <d:prop>
        <oc:id>97</oc:id>
        <oc:display-name>Bear</oc:display-name>
        <oc:user-visible>true</oc:user-visible>
        <oc:user-assignable>true</oc:user-assignable>
        <oc:can-assign>true</oc:can-assign>
        <nc:files-assigned>1</nc:files-assigned>
        <nc:reference-fileid>923422</nc:reference-fileid>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
  …

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-05-09 23:51:48 +07:00
Côme Chilliet 1cc1866ba3
Add back missing slash in LazyUserFolder path
Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
2023-05-09 10:59:31 +07:00
Côme Chilliet 6034cc6893 Make sure to never trigger files hooks on a null path
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-05-04 17:55:09 +07:00
Carl Schwan 85770f3b9f Make it easier to debug issue #32304
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2023-05-04 11:11:52 +07:00
Thomas Citharel 375466819e
fix(mimetype): Fix returning value when finding existing mimetype in MimeType Loader
Also, only return the ID from the transaction as the mimetype string is
already used from the function argument value

Fixes https://github.com/nextcloud/server/pull/35744/files#r1184644610

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-05-04 11:15:50 +07:00
Arthur Schiwon 997efe44ff
Merge pull request #37943 from nextcloud/fix/fix-getcontent-return-type
Fix file_get_content signatures to make it clear it can return false
2023-05-03 10:34:51 +07:00
Julius Härtl 3bdd770129
fix: Check for wrapped retriable exceptions
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-05-02 19:42:11 +07:00
Julius Härtl 11c5bc6a2a
fix: Wrap filesystem LockedExceptions for holding the readable path
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-05-02 19:40:27 +07:00
Simon L 4dfadcabb9
Merge pull request #38014 from nextcloud/norm-logic
Normalize logical operators
2023-05-02 16:27:58 +07:00
Git'Fellow 951c5b973e
Normalize logical operators
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2023-05-02 10:10:02 +07:00
Robin Appelman f5e2b0b22f
allow storing multiple mounts for the same rootid in the mount cache
currently `[$userId, $rootId]` is used as the unique key for storing mounts in the mount cache,
however there are cases where the same rootid is mounted in multiple places for a user which currently leads to not all of those mounts being added to the cache.

Previously this didn't matter as the mount cache was only used to list users with access to a specific file, so a user having access to the file multiple times didn' change anything.

With 24 the mount cache is used for more cases and multiple mounts for the same id becomes relevant.
While I think there isn't a real negative effect atm besides missing the optimized path we should ensure that the mounts are properly listed

Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-28 15:08:08 +07:00
Côme Chilliet 546d94c3ec
Fix file_get_content signatures to make it clear it can return false
In File::getContent, which must return a string, throw an Exception
 instead of returning false.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-27 09:56:05 +07:00
Robin Appelman d60172567f
Merge pull request #37818 from nextcloud/dav-ext-storage-log
debug log requests made by dav external storage/shares
2023-04-25 14:12:57 +07:00
Carl Schwan b1ec7ff51f
Add missing taint analysis docblock comments, and improve escaping in some methods
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-24 17:17:53 +07:00
Robin Appelman 05dc96f60d
debug log requests made by dav external storage/shares
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-24 17:13:20 +07:00
Robin Appelman 4953296b9e
Merge pull request #36857 from nextcloud/scan-repair-unencrypted-size
fix unencrypted_size for folders when scanning the filesystem with encryption enabled
2023-04-24 15:24:50 +07:00
Robin Appelman 0ac7230b7f
Merge pull request #37820 from nextcloud/parent-storage-mtime-ignore-error
ignore errors while trying to update parent storage_mtime
2023-04-21 19:11:27 +07:00
Robin Appelman 4cc5885615
Merge pull request #37062 from nextcloud/free-space
Check free space only if source exists and is dir
2023-04-21 13:55:42 +07:00
Robin Appelman 4b52dafbf9
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-20 17:16:03 +07:00
Côme Chilliet b294edad80
Merge branch 'master' into enh/type-iconfig-getter-calls
Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
2023-04-20 16:52:38 +07:00
Simon L 855e7a2efb
Merge pull request #36774 from nextcloud/bugfix/noid/sabre-nodes
fix: always use proper path on node api when calling the view
2023-04-18 04:11:44 +07:00
Simon L 45a0fe490c
Merge pull request #37534 from Rsplwe/master
Adjust the value of the "max-parts" parameter of the object storage 'ListPart' interface to 1000
2023-04-18 00:16:38 +07:00
Julius Härtl 160bd75d0a fix: Use proper path when creating node instances
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-04-17 23:46:52 +07:00
Simon L 85c9e75f33
Merge pull request #32314 from nextcloud/object-mkdir-logging
additional logging when mkdir fails for object storage
2023-04-17 23:42:08 +07:00
Thomas Citharel 036cd47bf4 Put Mimeloader insertion and read in the same transaction
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-04-17 13:32:02 +07:00
Julius Härtl eecd4601ac
Merge pull request #37429 from nextcloud/object-store-rmdir
improve objectstore rmdir handling
2023-04-13 18:45:12 +07:00
Arthur Schiwon ec1acb92c7
Merge pull request #37617 from nextcloud/notify-self-test-error
handle not being able to write file for notify self-test
2023-04-11 19:43:41 +07:00
Vincent Petry 9f05eff3ef
Merge pull request #34607 from nextcloud/encryption-size-not-found
fix encryption wrapper filesize for non existing files
2023-04-06 18:04:44 +07:00
Robin Appelman 570b64aafc
handle not being able to write file for notify self-test
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-06 11:52:22 +07:00
Robin Appelman 03e965a513
Merge pull request #22943 from nextcloud/scanner-no-access-handling
improve handling of files we can't access in the scanner
2023-04-05 21:36:21 +07:00
Robin Appelman c6be96d04f
additional logging when mkdir fails for object storage
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-05 14:52:19 +07:00
Robin Appelman b1f352c614
improve handling of files we can't access in the scanner
instead of erroring, remove the items from the cache.

this situation can be triggered if a user has access to a file but looses it afterwards

Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-05 14:44:55 +07:00
Robin Appelman 54f61352f0
better error messages if the users home is not writable during scanning
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-05 13:21:30 +07:00
Côme Chilliet 426c0341ff
Use typed version of IConfig::getSystemValue as much as possible
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-05 12:50:08 +07:00
Côme Chilliet 8f550398c4
Merge pull request #36836 from nextcloud/fix/view-type-cleanup
Tidy up typing in OC\Files\View
2023-04-05 10:14:55 +07:00
Côme Chilliet 6633b4ced6
Remove unecessary fully qualified namespaces from phpdoc
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-05 09:13:39 +07:00
Robin Appelman 5267a74027
fix type hints
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-04 17:05:45 +07:00
Robin Appelman 8c9197d65e
fix unencrypted folder size when no children with unencrypted size set are left
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-04 16:48:11 +07:00
Robin Appelman 649bed5154
fix unencrypted_size for files when scanning
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-04 16:48:11 +07:00
Robin Appelman 63fb33538c
fix unencrypted_size for folders when scanning the filesystem with encryption enabled
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-04 16:48:10 +07:00
Robin Appelman 15a6920b07
fix encryption wrapper filesize for non existing files
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-04 16:21:17 +07:00
Robin Appelman d63fa2d991
improve objectstore rmdir handling
remove folder entries as they are cleared instead of in one go afterwards

otherwise they stick around if some of the child entries can't be removed

Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-03 18:28:29 +07:00
Robin Appelman 5024f295dc
Merge pull request #36097 from nextcloud/path-prefix-optimize
extend path-prefix optimizer to remove all cases of path_hash= when encountering a path prefix filter
2023-04-03 16:39:49 +07:00
Rsplwe 5c6f35832c
Update lib/private/Files/ObjectStore/S3.php
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Rsplwe <i@rsplwe.com>
2023-04-03 21:59:59 +07:00
Côme Chilliet 5ad045619c
View needs to return an instance of OC\Files\FileInfo explicitely
Applications are calling methods from the class which are not from the
 public interface, and which cannot be added easily to public interface
 because Node interface extends FileInfo.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-03 10:52:35 +07:00
Côme Chilliet 0b3dad895f
More type cleanup in View and FileInfo
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-03 10:52:35 +07:00
Côme Chilliet ea05544213
Fix return type of methods returning false on error
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-03 10:52:34 +07:00
Côme Chilliet f974281ac9
Improve typing for fopen/toTmpFile
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-03 10:52:34 +07:00
Côme Chilliet 4393b96542
Remove unused method getLocalFolder
It’s not used and not in any OCP interface/class.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-03 10:52:34 +07:00
Côme Chilliet 966a3e6963
Tidy up typing in OC\Files\View
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-03 10:52:33 +07:00
jld3103 dcf6ebebab
Fix inherited parameter names
Signed-off-by: jld3103 <jld3103yt@gmail.com>
2023-04-03 08:29:33 +07:00
Robin Appelman c9e4e30523 clear encrypted flag when moving away from encrypted storage
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-01 15:36:37 +07:00
Rsplwe d85e623916
s3: get remaining truncation part
Signed-off-by: Rsplwe <i@rsplwe.com>
2023-04-01 22:56:15 +07:00
Rsplwe ccac296821
Adjust the value of 'maxparts' to 1000
Signed-off-by: Rsplwe <i@rsplwe.com>
2023-04-01 21:20:52 +07:00
Côme Chilliet 8104d9f5d8
Remove useless coalescing operator on non-null return value
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-01 14:20:26 +07:00
Côme Chilliet da618c457a
Fix quota typing for 32bits after forward port from 25
Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
2023-04-01 14:20:25 +07:00
Côme Chilliet 3f84d41226
Silence a warning from psalm with explanation
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-01 14:20:25 +07:00
Côme Chilliet 1740311283
Adapt types of subclasses
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-01 14:20:24 +07:00
Côme Chilliet ed863fb47c
Make it clear that file sizes may be float on 32bits
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-01 14:20:24 +07:00
Vincent Petry c6b683342e
Remove quota value type for 32-bit systems
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2023-04-01 14:20:20 +07:00
Robin Appelman 36835b7fec
Merge pull request #36810 from nextcloud/setup-user-onetime-before-mounts
do onetime user setup before getting any mount from providers
2023-03-24 16:45:08 +07:00
Côme Chilliet c60182065f
Merge pull request #34773 from nextcloud/artonge/feat/dispatch_entry_removed_event_for_all_entries
Dispatch event for all removed entries
2023-03-21 11:42:18 +07:00
Côme Chilliet 9c3e06c046
Merge pull request #33061 from ibpl/master-IB#1121253
Paths added to messages and message cleanup
2023-03-14 17:28:22 +07:00
Arthur Schiwon 315510df84
Merge pull request #27034 from nextcloud/enh/s3-multipart-upload-api
Use MultipartUpload for uploading chunks to s3
2023-03-09 13:55:57 +07:00
Arthur Schiwon 61aa0978ae
Merge pull request #36609 from nextcloud/lazyuserfolder-mountpoint
optimize LazyUserFolder::getMountPoint
2023-03-09 09:46:34 +07:00
Julius Härtl e23aa8883e
feat(s3): Use multipart upload for chunked uploading
This allows to stream file chunks directly to S3 during upload.

Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-03-08 14:00:04 +07:00
Joas Schilling 6b0cef6b9a Add transaction around mass mounts operations
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-03-07 19:58:55 +07:00
Git'Fellow 28231ae515
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-03-07 17:09:24 +07:00
Git'Fellow 9ac065fb92
Fix free space problems
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2023-03-07 00:13:57 +07:00
Julius Härtl d515da502f fix: Use proper path for quota fetching
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-03-06 22:46:07 +07:00
Robin Appelman fb1095f0f6
do onetime user setup before getting any mount from providers
this fixes a race condition where wrappers weren't properly applied if when a mount provider creates the storage instance one mountpoint creation instead of lazily

Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-02-22 18:03:38 +07:00
Robin Appelman d6818ba894
optimize LazyUserFolder::getMountPoint
no need to do a full setup

Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-02-13 15:13:50 +07:00
Robin Appelman 936f634069
Merge pull request #36643 from nextcloud/fs-setup-instrimuntion
more filesystem setup performance instrumentation
2023-02-13 14:37:57 +07:00
Robin Appelman 91d5f6a826 more filesystem setup performance instrumentation
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-02-10 11:11:13 +07:00
Julius Härtl d9cd8b1d37
Merge pull request #36610 from nextcloud/folder-lazy-submounts 2023-02-10 09:09:08 +07:00
Robin Appelman 5bcf37b7ff only fetch the data for mounts inside a folder when needed
for most operations we don't actually care about any mounts inside a folder, only for metadata that needs to propagate across storage boundaries (size, etag, mtime) do we need all the submount info.

By only loading this data when needed we can save a bunch of storage setup in a number of cases

Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-02-09 11:39:00 +07:00
Julius Härtl 08802ad13f
Merge pull request #36566 from nextcloud/mount-find-by-numeric-id 2023-02-08 20:04:57 +07:00
Robin Appelman 9f3dbb699a fix tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-02-07 15:50:10 +07:00
Côme Chilliet 308fcf4526
Respect OCP interface in private classes
Because the parameter type was moved to phpdoc it needs to be removed
 from implementations

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-07 11:23:35 +07:00
Côme Chilliet 028c225d96
Fix psalm errors
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-07 11:23:32 +07:00
Côme Chilliet cd885b5705
Type sizes as int|float throughout the code base
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-07 11:23:31 +07:00
Côme Chilliet 5c1a0e0307
Allow float sizes in FileInfo for 32bits
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-07 11:23:31 +07:00
Côme Chilliet d9dbed9105
Fix psalm errors related to filesizes
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-07 11:23:29 +07:00
Côme Chilliet ff776a90b1
Strong type filesize related methods to ease 32bits problem findings
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-07 11:23:28 +07:00
Côme Chilliet e156f8339c
Revert "remove 32-bit workarounds"
This reverts commit dd8774389e.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-07 11:23:28 +07:00
Robin Appelman e3bafcc7a8 cache numeric id in mountpoint
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-02-06 18:20:08 +07:00
Robin Appelman 9281359fa4 deduplicate getStorage() logic in Mount\Manager
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-02-06 18:17:40 +07:00
Robin Appelman 43589312cc dont delegate Mount\Manager::getByNumericId to getByStorageId
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-02-06 18:16:23 +07:00
Joas Schilling 4bdc5834fa
Make sure name and path are strings
Otherwise Oracle returns NULL for empty strings and PHP 8.2
throws on null in string functions like trim() and md5()

Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-02-02 12:05:22 +07:00
Joas Schilling c27c9fac98
Try fixing Oracle
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-02-02 12:05:21 +07:00
Louis Chemineau 2830eeac7e Dispatch event for all remove entry
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-01-31 13:30:10 +07:00
Richard Steinmetz f0a3b77d0f fix(encryption): don't throw on missing file
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2023-01-30 10:07:01 +07:00
Vincent Petry 9ecec2fd75
Merge pull request #35894 from nextcloud/move-from-encryption
fix moving files of encrypted local storage to unencrypted local storage
2023-01-26 09:45:12 +07:00
Julius Härtl 919a840f34
Merge pull request #32798 from nextcloud/enh/sse-c
[S3] Add option to specify an SSE-C customer provided key
2023-01-25 15:59:26 +07:00
Robin Appelman 33b90d28f8 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-24 16:40:41 +07:00
Thomas Citharel 00d9d49303 Add app config for default template path
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-01-24 09:39:31 +07:00
Julius Härtl 159a0c8411
feat(s3): Add option to specify an SSE-C customer provided key
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-01-24 10:36:03 +07:00
Côme Chilliet f5c361cf44
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-20 11:45:08 +07:00
Côme Chilliet 5e090d044d
Merge pull request #36075 from fmenabe/s3-storage-class
Add support for s3 storage classes
2023-01-16 09:43:53 +07:00
François Ménabé cf9bdc0274 Manage s3 storage class in objectstore
Signed-off-by: François Ménabé <francois.menabe@gmail.com>
2023-01-12 14:58:27 +07:00
Git'Fellow e855298b3c Switch logical operators
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2023-01-11 16:27:33 +07:00
Robin Appelman ac5cfd10e2
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-01-11 16:38:41 +07:00
Côme Chilliet a7740c0ae6
Suppress last psalm error until upstream fix is released and included
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-02 15:17:38 +07:00
Côme Chilliet a372564850
Fix psalm spotted errors with new requirements
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-02 15:02:28 +07:00
Vincent Petry 3bcbc4701a
Merge pull request #34724 from nextcloud/encryption-read-before-cache
fix reading newly written encrypted files before their cache entry is written
2022-12-20 17:16:12 +07:00
Vincent Petry 3b7cc31f64
Merge pull request #34924 from nextcloud/cache-jail-path-prefix
escape path prefix when doing cache jail search
2022-12-16 17:27:15 +07:00
Julius Härtl 59ae6e9dd6
Also update the unencrypted size of files when creating them with empty content
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-12-07 19:12:06 +07:00
Julius Härtl 77edd36583
Update the unencrypted file size when closing streams
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-12-07 16:26:31 +07:00
Simon L 2e0d262864
Merge pull request #35576 from nextcloud/handle-possible-null-value-in-new-simple-file
Handle possible null value for file in OC\Files\SimpleFS\NewSimpleFile
2022-12-06 19:52:55 +07:00
Thomas Citharel a5b6119ec4
Handle possible null value for file in OC\Files\SimpleFS\NewSimpleFile
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2022-12-03 17:25:32 +07:00
Maxence Lange cc639a8877 compare cached filesize on download
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2022-12-01 15:42:15 +07:00
Robin Appelman e3a0e64698
clear is-encrypted cache when trying to fix encrypted version
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-12-01 14:36:27 +07:00
Robin Appelman e9b87c73fa
fix reading newly written encrypted files before their cache entry is written
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-11-30 14:54:56 +07:00
Andy Xheli e69c7c4d26
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-29 11:24:56 +07:00
Louis Chemineau 66ba90ceff 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 12:43:57 +07:00
Robin Appelman 841a6a084e
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-17 15:21:57 +07:00
Simon L 9d45845d2a
Merge pull request #34994 from Glandos/fileinfo_perf
[Performance] Test valid path only if file info has to be retrieved
2022-11-11 17:11:21 +07:00
Côme Chilliet a78595a45f
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 15:03:15 +07:00
Glandos 48ca33761f Test valid path only if file info has to be retrieved
Signed-off-by: Glandos <bugs-github@antipoul.fr>
2022-11-06 19:23:53 +07:00
Pawel Boguslawski 4a46c747e9 Merge master 2022-11-04 13:34:21 +07:00
Robin Appelman f76b4473ee
escape path prefix when doing cache jail search
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-11-02 12:44:51 +07:00
szaimen 3f7c620f26 fix psalm
Signed-off-by: szaimen <szaimen@e.mail.de>
2022-11-02 11:13:34 +07:00
szaimen dd8774389e remove 32-bit workarounds
Signed-off-by: szaimen <szaimen@e.mail.de>
2022-11-02 11:13:34 +07:00
Robin Appelman a5036a973c allow disabling object store write check
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-10-26 18:45:59 +07:00
Vincent Petry 4aa8e80511
Merge pull request #34579 from nextcloud/unencrypted-size-null
fix null error in getUnencryptedSize
2022-10-21 16:53:43 +07:00
Carl Schwan 0f0f132959
Merge pull request #34624 from nextcloud/fix/files_external_psalm
Multiple fix for files external
2022-10-20 16:53:43 +07:00
Carl Schwan a5ea677370 Rename file1 and file2 to source and target in Storage abstraction
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-10-18 17:21:47 +07:00
Carl Schwan 54031e370a Fix various other small psalm issues
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-10-17 12:40:35 +07:00
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 +07:00
Robin Appelman 63316fc572
fix null error in getUnencryptedSize
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-10-13 15:34:48 +07: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 +07: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 +07:00
raul 45a1ebcc4c Fix: Prevent deadlocks during mtime/size/etag propagation
Signed-off-by: raul <raul@nextcloud.com>
2022-10-03 13:44:14 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07:00
Vincent Petry 1025d049c7
Merge pull request #24596 from kofemann/dcache-worm
make NextCloud WORM file system friendly
2022-09-16 14:39:13 +07:00