Commit Graph

517 Commits (stable15)

Author SHA1 Message Date
Roeland Jago Douma 290b4f2ece Fix detection of non extention types
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-12-12 22:06:09 +07:00
Joas Schilling d5d8bb0577 Try more methods
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-12-12 22:06:08 +07:00
Joas Schilling 663a42dfd5 Some more fixes in detecting the mimetype from the content
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-12-12 22:06:07 +07:00
Joas Schilling a52c84b5b8 Allow to check for the mimetype by content only
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-12-12 22:06:06 +07:00
Arthur Schiwon 0f0cabafd6
delay creation of the cert bundle
fixes #18148

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-12-02 14:33:57 +07:00
Roeland Jago Douma 57d84ce7aa Fix DAV mimetype search
Fixes #15048
Catches the case where a full mimetype is sumbitted in the where like
clause. Before we didn't catch this and it was just forwarded as is
causing invalid queries.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-10-29 07:35:42 +07:00
Joas Schilling 0174577164
Merge pull request #17013 from nextcloud/backport/16999/stable15
[stable15] Return the proper jailed path when requesting the root path
2019-10-10 08:58:09 +07:00
Arthur Schiwon be25caeffb set a storage availability delay on auth issues to avoid lock out
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-09-09 14:52:16 +07:00
Julius Härtl 0233384129 Return the proper jailed path when requesting the root path
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-09-05 07:24:46 +07:00
Joas Schilling 8544be0867 Undefined variable response when server is no nextcloud anymore
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-08-21 14:07:42 +07:00
Roeland Jago Douma 337aa1cd3c Properly return an int in the getId function of the cache
fixes #16684

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-08-08 06:15:53 +07:00
Marcel Klehr eb14a8fcba Fix File#putContents(string) on ObjectStorage
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2019-07-17 20:40:05 +07:00
Roeland Jago Douma 7bd081ff84 Do not keep searching for recent
If userA has a lot of recent files. But only shares 1 file with userB
(that has no files at all). We could keep searching until we run out of
recent files for userA.

Now assume the inactive userB has 20 incomming shares like that from
different users. getRecent then basically keeps consuming huge amounts
of resources and with each iteration the load on the DB increases
(because of the offset).

This makes sure we do not get more than 3 times the limit we search for
or more than 5 queries.

This means we might miss some recent entries but we should fix that
separatly. This is just to make sure the load on the DB stays sane.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-07-17 05:48:53 +07:00
Robin Appelman cdc97ec9c3 verify that paths are valid for recursive local move
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-06-27 14:39:32 +07:00
Morris Jobke 9ad616e221 Fix full text search for groupfolders
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2019-06-25 19:46:25 +07:00
Robin Appelman 2b845a7268 search files by id in shared storages last
this prevents unneeded recursion when the file is not in the share

Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-05-29 19:58:44 +07:00
Julius Härtl 91bc8ba2cd Check for free space on touch
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-05-28 13:03:53 +07:00
Arthur Schiwon ec9c1e2f52 take return of mkdir into account, throw exception on failure
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-04-30 07:27:32 +07:00
Roeland Jago Douma ad5dcc2cd6 Always use a temp file for swift writes
Apparently the if statement doesn't work in all cases (even if I could
not reproduce it). So for the time being we will just not directly
stream to swift.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-04-24 07:02:46 +07:00
Roeland Jago Douma dc99cc7eab Harden appdata putcontent
If for whatever reason appdata got into a strange state this will at
least propegate up and not make it do boom the next run.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-04-08 14:36:37 +07:00
Vlastimil Pecinka 7cab488c6f Store user object later in the code
Signed-off-by: Vlastimil Pecinka <pecinka@email.cz>
2019-03-21 21:37:41 +07:00
Robin Appelman 9b6ead8abf always allow moving mountpoints inside the same mountpoint
even if that mountpoint isn't normally a valid target for moving mounts into

Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-03-20 09:59:17 +07:00
Robin Appelman 54b14946b4 handle long etags from dav external storage
we can only store etags up to 40 characters long in the database, so when we get an etag that's longer we simply hash it to bring down the length

Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-03-14 16:19:09 +07:00
Ari Selseng 264b4ad3a9 Avoid calculating folder size for parent that needs scan.
Signed-off-by: Ari Selseng <ari@selseng.net>
2019-03-08 08:14:33 +07:00
Roeland Jago Douma 30e790606e Use a tmp file for swift writes
Else this leads to a seekable stream error with chunked uploads

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-03-06 14:34:15 +07:00
Roeland Jago Douma 58fd016b27
Fix empty file uploads to S3
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-02-19 10:16:11 +07:00
Roeland Jago Douma c021b5bfc6
Merge pull request #14195 from nextcloud/backport/14185/stable15
[stable15] Fix recent files
2019-02-14 21:18:20 +07:00
Roeland Jago Douma 8373adacd6 Filter out versions and trashbin
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-02-14 10:27:43 +07:00
Roeland Jago Douma e31c94ac64 Loop for the recent search
Else it might happen that less entries than requested are returned

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-02-14 10:27:43 +07:00
Roeland Jago Douma 092baa0e5a We need to initialize the storage else the jailed path is always null
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-02-14 10:27:42 +07:00
William Pain 602cea074f Fix: Check if `$this->params['user']` is an array
Signed-off-by: William Pain <pain.william@gmail.com>
2019-02-07 13:33:18 +07:00
Robin Appelman ff5f28a65e always use multipart uploader for s3 uploads
the multipart uploader handles non seekable streams while `upload` does not

Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-01-29 10:17:07 +07:00
Morris Jobke 09db2bc701
Merge pull request #13740 from nextcloud/backport/13140/stable15
[stable15] Cache tokens when using swift's v2 authentication
2019-01-23 15:29:56 +07:00
Robin Appelman f7a4f1f128 cleanup shared lock if changing to exclusive lock failed
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-01-22 15:12:46 +07:00
Robin Appelman 6855c1594c Cache tokens when using swift's v2 authentication
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-01-22 14:37:09 +07:00
Florian Schunk a3d9e6de39 don't close input stream when writing in encrypted file
Signed-off-by: Florian Schunk <florian.schunk@rwth-aachen.de>
2019-01-14 15:22:34 +07:00
Robin Appelman 2d2de36baf
upload new files in objectstore to a .part path first
This prevent the object store and cache from getting out of sync
when an objectstore silently fails or the php process get's killed
during the upload without giving us the chance to cleanup

Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-12-12 15:31:47 +07:00
Robin Appelman fe23285e44
Add objectExists to objectstore interface
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-12-12 15:31:44 +07:00
Morris Jobke 1e906fd15c
Merge pull request #12868 from nextcloud/backport/12857/stable15
[stable15] Emit write update only once on touch
2018-12-06 01:18:21 +07:00
Roeland Jago Douma 07eb6e5716 Emit write update only once on touch
When a touch is done (i.e. when creating a new file in the node API)
The hooks contain 'write' and 'touch' (and the operation is touch as
well). This would cause a double write update. Which doesn't make sense.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-12-05 21:55:24 +07:00
Roeland Jago Douma 1656a08323 Only execute query in propagateChange once
The second execute statement should be inside the if block. Else it gets
executed twice which makes no sense.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-12-05 20:44:35 +07:00
Robin Appelman 9ee94afe7e Fix folder path containing leading slash when getting mount root by id
This fixes collabora on public link shared groupfolders

Fixes https://github.com/nextcloud/groupfolders/issues/225

Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-11-28 19:07:11 +07:00
Morris Jobke cc6c30e769
Merge pull request #12494 from nextcloud/cache-notfound-id
return the correct value when trying to get a non existing item from cache by id
2018-11-20 09:51:18 +07:00
Morris Jobke cef8eadf2a
Add PHPDoc for thrown exception
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-11-19 15:34:07 +07:00
Robin Appelman 35251928d5
forward object not found error in switch as dav 404
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-11-19 11:34:38 +07:00
Robin Appelman 5d5cfefd35
return the correct value when trying to get a non existing item from cache by id
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-11-16 17:26:42 +07:00
Christoph Wurst 1b85ef4bf2
Fix string doc type casing
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2018-11-15 11:57:05 +07:00
Morris Jobke fd8eeccb15
Merge pull request #11942 from nextcloud/techdebt/noid/use-count-function
Use the defined func()->count() instead of manual counting
2018-11-12 17:43:56 +07:00
Morris Jobke 93c62d78db
Fix UniqueConstraintViolationException while insert into oc_filecache
* fixes #6160 by not being prone to the race condition in insertIfNotExists
* fixes #12228 by not using a query that can result in a deadlock
* replaces the insertIfNotExists call with an insert which is wrapped into a try-catch block

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-11-12 14:43:28 +07:00
Joas Schilling bb352fb667
Use the defined func()->count() instead of manual counting
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-11-08 15:44:45 +07:00