Robin Appelman
1d322d3b37
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-28 14:51:19 +01:00
Morris Jobke
90e985fe4f
Merge pull request #13739 from nextcloud/cache-cleanup-change
...
cleanup shared lock if changing to exclusive lock failed
2019-01-22 16:11:46 +01:00
Robin Appelman
f69c2d1e84
cleanup shared lock if changing to exclusive lock failed
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-01-22 15:32:48 +01:00
Morris Jobke
5a27e54f4b
Merge pull request #13032 from nextcloud/objectstore-write-exists
...
upload new files in objectstore to a .part path first
2019-01-14 11:26:29 +01:00
Robin Appelman
d6bf5d4384
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:24:40 +01:00
Robin Appelman
6c9f2644cf
Add objectExists to objectstore interface
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-12-12 14:17:19 +01:00
Robin Appelman
740ea0d30e
try to grab the appdata folder directly without going trough the whole tree
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-12-06 15:10:08 +01:00
Robin Appelman
9d9f6903c9
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 15:18:29 +01:00
Robin Appelman
aa6f7947ba
add test for non existing file by id
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-11-19 17:37:59 +01:00
Robin Appelman
9b3cc72f7c
fix writeStream for jail wrapper
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-10-31 21:10:57 +01:00
Robin Appelman
93de63777e
extend storage api to allow directly writing a stream to storage
...
this removes the need for temporary storages with some external storage backends.
The new method is added to a separate interface to maintain compatibility with
storage backends implementing the storage interface directly (without inheriting common)
Currently the interface is implemented for objectstorage based storages and local storage
and used by webdav uploads
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-10-31 21:10:44 +01:00
Roeland Jago Douma
d5bf2c4523
Move normalizePath to regexes instead of looping
...
This is IMO a bit more readable and it seems to make the code faster.
Tested it on the company instance where there are over 3k calls to this
function. It shaves off around 10ms.
The advantage here is that the pattern gets optimized by php itsel and
cached.
Also looking for all patterns at the same time and especially no longer
looping for /./ patterns should save time.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-10-10 13:23:59 +02:00
Christoph Wurst
3f2cd13beb
Remove HHVM check
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2018-10-09 10:12:15 +02:00
Michael Weimann
d855c38e07
Moves the logo files to logo
...
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
2018-10-02 08:37:54 +02:00
Bjoern Schiessle
a9e22c5f1c
make file cache updates more robust
...
only update the encrypted version after the write operation is finished and the stream is closed
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-31 12:24:38 +02:00
Julius Härtl
6da2b7c4f6
Separate fopen into read and write methods
...
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-07-11 12:08:37 +02:00
Julius Härtl
f1469e34aa
Add fopen method to ISimpleFile
...
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-07-11 10:29:03 +02:00
Robin Appelman
587d7cc7d2
Merge pull request #9526 from Blaok/files-scan-shallow
...
allow shallow (non-recursive) scan when scanning file storage
2018-06-25 13:01:22 +02:00
Robin Appelman
ac26175a17
add azure unit tests with azurite
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-06-04 16:18:03 +02:00
Roeland Jago Douma
9c23c7c821
Fix ViewTest
...
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-05-23 19:12:51 +02:00
Blaok
4a3471595a
test: add unit test for files:scan --shallow
...
Signed-off-by: Yuze Chi <i@blaok.me>
2018-05-18 14:51:08 -07:00
Roeland Jago Douma
0ff83f7230
Do not allow folder creation with quota of 0
...
Fixes #4577
Users with a quota of 0 are a special case. Since they can't (ever)
create files on their own storage. Therefor it makes no real that they
can create folders (and possible share those etc).
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-05-03 11:31:23 +02:00
Roeland Jago Douma
73e6eea57e
Fix tests
...
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-04-04 12:50:54 +02:00
Björn Schießle
c3900c9d0d
Merge pull request #9018 from nextcloud/fix-copy-encrypted-files
...
reset encryptionVersion to '1' if a file was stream copied
2018-04-03 18:24:27 +02:00
Bjoern Schiessle
a0923d9ffb
reset encryptionVersion to '1' if a file was stream copied, because this means that we basically write the file from scratch
...
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-04-03 18:01:23 +02:00
Roeland Jago Douma
af31fa82e8
Fix test
...
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-03-22 12:06:45 +01:00
Roeland Jago Douma
8b5997483c
Hardening of SimpleFile getContent
...
if file_get_contents fails remove the file. And traverse up the tree
checking if the other folders are there.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-02-27 13:35:09 +01:00
Robin Appelman
df6e23c98c
add ci for swift primary storage
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-02-08 15:18:25 +01:00
Morris Jobke
26e0c14c6d
Merge pull request #8033 from nextcloud/s3-uploader
...
Use S3Client::upload instead of splitting single/multipart upload ourselves
2018-02-08 14:30:02 +01:00
Joas Schilling
bf2be08c9f
Fix risky tests without assertions
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-01-25 11:33:25 +01:00
Joas Schilling
870023365c
Fix "Undefined method setExpectedException()"
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-01-24 18:10:16 +01:00
Robin Appelman
3499cbdb76
Use S3Client::upload instead of splitting single/multipart upload ourselves
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-01-24 17:22:05 +01:00
Roeland Jago Douma
09f8a755ec
Remove IAppConfig::getValue
...
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-01-17 21:41:56 +01:00
Robin Appelman
326d55db81
Support arbitrary number of arguments for d:or and d:and in search queries
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-01-16 13:22:28 +01:00
Arthur Schiwon
e9eccf34f9
removes invalid tests, adapts another one
...
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-01-03 21:44:30 +01:00
Lukas Reschke
989a8a3668
Merge pull request #6220 from nextcloud/cached-mount-info-filepath
...
Allow getting the filepath when getting cached mounts by fileid
2017-11-09 00:04:25 +01:00
Joas Schilling
3e0789aa94
Merge pull request #6958 from nextcloud/improved-mimetype-detection-for-object-storage
...
Improve mimetype detection for object storages
2017-11-01 11:04:15 +01:00
Robin Appelman
3f0cb13042
Allow getting the filepath when getting cached mounts by fileid
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-10-27 14:35:34 +02:00
Morris Jobke
405bbc1c61
Improve mimetype detection for object storages
...
Object storage instances always fall back to the content based mimetype detection, because the file name for object storage was always random due to the fact that it was temporarily storage in a generated temp file. This patch adds a check before that to make sure to use the original file name for this purpose and also remove possible other extensions like the versioning or part file extension.
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-10-26 16:31:59 +02:00
Morris Jobke
c733cdaa65
Use ::class in test mocks of encryption app
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-10-26 13:56:56 +02:00
Morris Jobke
ab36980d20
Use ::class in test mocks of dav app
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-10-26 10:16:12 +02:00
Morris Jobke
43e498844e
Use ::class in test mocks
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-10-24 17:45:32 +02:00
Robin Appelman
385d6f098c
Add tests for multipart upload
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-09-21 14:47:34 +02:00
Morris Jobke
a55e794bfd
Cleanup unused methods
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-08-15 14:29:26 +02:00
Morris Jobke
cf7c4a4439
Merge pull request #6123 from nextcloud/cleanup-shareItem
...
Cleanup usage of shareItem in internal code base
2017-08-15 13:57:00 +02:00
Morris Jobke
8366dfa50b
Cleanup usage of shareItem in internal code base
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-08-15 11:57:18 +02:00
Morris Jobke
895b9c2309
Use proper methods for registerBackend
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-08-15 11:29:15 +02:00
Roeland Jago Douma
db27bbf90d
Fix CacheTest
...
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-08-09 16:01:09 +02:00
Roeland Jago Douma
8b0051eb40
Fix encryption test
...
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-08-09 15:51:08 +02:00
Joas Schilling
20f8d1094a
Can not insert auto increment on oracle
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-08-02 09:48:16 +02:00
Joas Schilling
106df7bc33
Fix missing escape on column and table name
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-08-02 09:48:16 +02:00
Lukas Reschke
dfd8125aeb
Replace wrong PHPDocs
...
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-08-01 08:20:16 +02:00
Robin Appelman
89aaded07f
add tests for renaming paths with multibyte utf8 characters
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-07-22 11:05:05 +02:00
Robin Appelman
03f27b4c2c
Fix scan permissions with nested permissions masks
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-07-13 14:29:04 +02:00
Morris Jobke
b4a221f9be
Merge pull request #5424 from nextcloud/moveFromCache-from-shared
...
fix moving folders out of a cache jail
2017-07-06 18:31:18 +02:00
Bjoern Schiessle
b43f6d295e
update file system tests to take the master key into account
...
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-07-06 11:47:12 +02:00
Robin Appelman
2e8e6f95b9
show used space in user list
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-06-15 14:06:54 +02:00
Robin Appelman
fa81759917
fix moving folders out of a cache jail
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-06-15 13:59:06 +02:00
Robin Appelman
1f1e1b0d00
use unmasked permissions during scanning
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-05-18 16:38:54 +02:00
Joas Schilling
6300be160a
Add unit tests for mounts of delete users
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-04-24 16:43:25 +02:00
Joas Schilling
ec2f2b75be
Make sure we use a new encryption module all the time
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-04-20 13:48:14 +02:00
Joas Schilling
30817fa319
Simplify the test
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-04-12 13:23:55 +02:00
Piotr M
dc78f1251e
Optimize put - Dont try to fetch filecache for not existing filecache in encription
2017-04-12 12:54:20 +02:00
Robin Appelman
a7c611039d
Dont use the permissions mask while scanning
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-04-10 15:19:21 +02:00
Robin Appelman
8de4209c3e
round the mtime in touch
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-27 17:07:48 +02:00
Lukas Reschke
ab9e3525cc
Move error message to log entry
...
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-03-20 11:06:08 +01:00
Joas Schilling
70bd819dd2
Cleanup test
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-03-17 10:59:53 +01:00
Joas Schilling
2f16f3ba44
Fix unit test
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-03-17 10:39:08 +01:00
Vincent Petry
7256940524
Redirect unlink to rmdir ( #27101 )
...
Many API callers will call unlink even for directories and it can mess
up with some wrappers like the encryption wrapper
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-03-16 23:45:03 -06:00
Robin Appelman
e61606a767
Allow searching for favorites
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-08 16:30:55 +01:00
Robin Appelman
709f64d396
add tests for filesearchbackend
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-01 14:06:40 +01:00
Robin Appelman
e6a896f2f0
add tests for searchQuery
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-01 14:06:40 +01:00
Robin Appelman
df2063ee7b
Implement webdav SEARCH
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-01 14:06:39 +01:00
Robin Appelman
706131b394
add icewind/searchdav
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-02-28 14:24:18 +01:00
Morris Jobke
95ab46e3d2
Merge pull request #3030 from nextcloud/filesapi-renamefailcase
...
Fix files node API failed rename/copy
2017-01-24 21:23:59 -06:00
Magnus Walbeck
eadc1ac637
Mimetype detection for hidden files
...
Signed-off-by: Magnus Walbeck <mw@mwalbeck.org>
2017-01-23 13:28:35 +01:00
Vincent Petry
269b652754
Add tests for move/copy hooks in Node API
...
Signed-off-by: Vincent Petry <pvince81@owncloud.com>
2017-01-12 13:52:59 +01:00
Vincent Petry
e667b28298
Fix files node API failed rename/copy
...
Whenever a rename or copy operation failed on the view, we must throw
an exception instead of just ignoring.
Signed-off-by: Vincent Petry <pvince81@owncloud.com>
2017-01-12 13:52:59 +01:00
Vincent Petry
eb5ea0e260
Refactor files node API for more code reuse
...
Signed-off-by: Vincent Petry <pvince81@owncloud.com>
2017-01-11 14:53:42 +01:00
Roeland Jago Douma
00b17c3af5
Only check for local shared storages
...
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-01-10 16:14:21 +01:00
Vincent Petry
706655ef20
Skip local shares in bkg scan and occ files:scan ( #26590 )
...
Local shares should only be scanned when doing it for the owner to
avoid repeatedly rescanning the same shared storage over and over again
for every recipient.
2017-01-10 16:11:45 +01:00
Roeland Jago Douma
73fcb69cad
Merge pull request #2934 from nextcloud/quota-stream-non-global
...
remove the need to register the quota streamwrapper globally
2017-01-06 15:25:20 +01:00
Robin Appelman
bca91f2216
remove static:// stream wrapper
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-01-04 15:57:02 +01:00
Robin Appelman
968de70bc5
remove the need to register the quota streamwrapper globally
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-01-04 15:15:47 +01:00
Robin Appelman
3243a6032a
adjust test
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-01-02 14:17:20 +01:00
Robin Appelman
ac2542f0f0
add ci support for s3 object store
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-01-02 14:17:19 +01:00
Vincent Petry
7ca6561469
Remove legacy home tests
...
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-12-23 12:50:31 +01:00
Vincent Petry
4744dce4df
Nuke the legacy storage fallback from orbit
...
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-12-23 12:49:46 +01:00
Morris Jobke
1253d1008a
Merge pull request #2411 from nextcloud/fix-encryption-home-storage
...
check if the file should really be encrypted before we update the file cache
2016-12-05 15:38:12 +01:00
Robin Appelman
1a379b0fdc
update test
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-12-02 18:04:21 +01:00
Lukas Reschke
2ca29f709b
Add tests
...
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-12-01 18:52:32 +01:00
Bjoern Schiessle
0f8fe77b3a
check if the file should really be encrypted before we update the file cache
...
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2016-11-29 20:34:45 +01:00
Joas Schilling
558f169671
Move the validation into one place only
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2016-11-21 09:23:37 +01:00
Joas Schilling
4652d203e3
Make sure we don't scan files that can not be accessed
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2016-11-21 09:23:32 +01:00
Robin Appelman
4ac5fdcf11
add tests for FileInfo::isMounted
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-16 15:30:37 +01:00
Robin Appelman
eefd059716
add amazon s3 objectstore backend
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-16 15:30:36 +01:00
Robin Appelman
64e896cc0d
split testing of objectstoragestorage and objectstore implementations
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-16 15:30:36 +01:00
Robin Appelman
cbcdf69dc2
only query substorages to calculate the final mtime/size/etag lazily
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-10 13:59:22 +01:00
Lukas Reschke
6920e609c0
Adjust tests and DI for Share.php
...
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-11-02 23:26:49 +01:00
Lukas Reschke
68cebef64c
DI for root.php
...
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-11-02 23:16:51 +01:00