Commit graph

1342 commits

Author SHA1 Message Date
Git'Fellow
61cd250935 Include PR #38965
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2023-07-10 18:31:45 +02:00
Robin Appelman
98ec2f023f implement optimized getDirectoryContent for DAV
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-07-10 18:31:45 +02:00
Arthur Schiwon
a7b4f502aa
refactor: adjust to unexposed searchBySystemTag
- in this backport we have to drop the breaking addition in
  \OCP\Files\Folder
- this requires adjustments in check for the existance of the method but
  also in testing
- another change in \OCP\SystemTag\ISystemTagManager can be applied as
  this interface is not implemented elsewhere

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-07-07 12:25:04 +02:00
Arthur Schiwon
b55be6fd8f
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-07-06 21:52:52 +02:00
Arthur Schiwon
66a7064db3
fix: include invisible tags for admins
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-07-06 21:52:51 +02:00
Arthur Schiwon
99442b60d5 fix: favorites view and universal search against tags
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-07-06 17:29:12 +00:00
Arthur Schiwon
7d8d586983 fix: change if with conditionless else to switch; and a parameter value
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-07-06 17:29:12 +00:00
Arthur Schiwon
7bfe6f2cc0 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-07-06 17:29:11 +00:00
Richard Steinmetz
aaa7b41a33 fix(sse): don't update uncached files
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2023-07-04 20:18:17 +00:00
Arthur Schiwon
dd2dfc89fd
Merge pull request #38976 from nextcloud/backport/38625/stable27
[stable27] fix: expect interface, not a specific implementation
2023-07-04 22:07:29 +02:00
Robin Appelman
0ff32cadf3 add utility command for object store objects
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-07-04 17:59:21 +02:00
Robin Appelman
b219a17cc6 file scanner performance improvements
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-06-26 15:44:16 +00:00
Arthur Schiwon
29e11a4273 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-23 23:04:45 +00:00
Arthur Schiwon
09c4ba257c refactor: declare getMount() and getMountsIn() at IRootFolder
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-06-23 23:04:44 +00:00
Arthur Schiwon
f724760f67 chore: ugly type juggling
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-06-23 23:04:44 +00:00
Arthur Schiwon
faea2440ed fix: add typehine for IRootFolder
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-06-23 23:04:44 +00:00
Arthur Schiwon
c04b1ed857 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-23 23:04:44 +00:00
Robin Appelman
782736ab54
use source cache when listing folder during recursive copy
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-06-19 12:32:04 +02:00
Dominik Fuchß
681d2c0402 Fix deprecated method call
Signed-off-by: Dominik Fuchß <develop@fuchss.org>
2023-06-14 20:27:39 +00:00
Dominik Fuchß
a6ca1546cc Changes after code review.
Signed-off-by: Dominik Fuchß <develop@fuchss.org>
2023-06-14 20:27:39 +00:00
Dominik Fuchß
c64e9f6e93 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-14 20:27:38 +00:00
Arthur Schiwon
a845fc7395
Merge pull request #38449 from nextcloud/backport/38415/stable27
[stable27] don't always check if we need to setup the object store root
2023-06-01 17:33:50 +02:00
Robin Appelman
780a744e07 don't always check if we need to setup the object store root
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-05-24 21:55:56 +00:00
Julius Härtl
ce8e21d2c5
fix: execute throws docrine exceptions not our wrapped ones
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-05-24 20:45:51 +02: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 +02: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 +02: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 +02: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 +02:00
Julius Härtl
e18f97fc95
Merge pull request #37709 from nextcloud/bugfix/deadlock 2023-05-13 13:13:04 +02:00
Julius Härtl
8cab1d73ac
Merge pull request #37621 from nextcloud/enh/lock-readable-path 2023-05-13 13:11:37 +02: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 +02: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 +02:00
John Molakvoæ
db02684008
Merge pull request #37691 from nextcloud/object-store-background-scan 2023-05-11 08:15:41 +02: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 +02: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 +02: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 +02: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 +02: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 +02: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 +02: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 +00: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 +00: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 +02: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 +02: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 +02: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 +02:00
Simon L
4dfadcabb9
Merge pull request #38014 from nextcloud/norm-logic
Normalize logical operators
2023-05-02 16:27:58 +02:00
Git'Fellow
951c5b973e
Normalize logical operators
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2023-05-02 10:10:02 +02: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 +02: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 +02: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 +02:00