Commit graph

1204 commits

Author SHA1 Message Date
Julius Härtl
b339ef5131 fix: execute throws docrine exceptions not our wrapped ones
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-05-26 07:46:25 +00:00
Arthur Schiwon
cf2b8e9866
Merge pull request #38309 from nextcloud/backport/37961/stable25
[stable25] SystemTags endpoint to return tags used by a user with meta data
2023-05-17 18:58:59 +02:00
Arthur Schiwon
b4f562bc2f
Merge pull request #37702 from nextcloud/backport/37617/stable25
[stable25] handle not being able to write file for notify self-test
2023-05-17 13:10:22 +02:00
Arthur Schiwon
0612ad250e
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-16 12:59:10 +02:00
Arthur Schiwon
1e5de8aff4
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-16 12:59:04 +02:00
Arthur Schiwon
de008e1109
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-16 12:58:47 +02:00
Arthur Schiwon
8ec4760645
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-16 12:58:42 +02:00
Côme Chilliet
dee180409b
Merge pull request #38203 from nextcloud/backport/36893/stable25
[stable25] Make sure to never trigger files hooks on a null path
2023-05-15 11:26:33 +02:00
Julius Härtl
2788dfc4f2 fix: Check for wrapped retriable exceptions
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-05-13 22:23:05 +00:00
Côme Chilliet
8faf854a03 Make sure to never trigger files hooks on a null path
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-05-11 14:43:04 +00:00
Julius Härtl
46e924aa7b
fix: Use proper path when creating node instances
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-05-09 13:00:04 +02:00
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
a9c2373db7 handle not being able to write file for notify self-test
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-13 06:18:36 +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