1
0
Fork 0
Commit Graph

2384 Commits

Author SHA1 Message Date
allexzander ef89256d39 VFS. Allow dehydartion of readonly files. Preserve 'readonly' flag when creating a placeholder.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-05-06 06:17:36 +00:00
allexzander 19522210ac VFS. Display local file name clash error when syncing in VFS mode.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-05-05 17:34:59 +00:00
Matthieu Gallien 23ba193102 add missing call to tr to get a translated string
Fix #3250

Signed-off-by: Matthieu Gallien <matthieu_gallien@yahoo.fr>
2021-05-04 12:16:10 +02:00
Felix Weilbach 7112d2aa78 Push Notifications: Reconnect forever if capabilities allow it
Fixes #3115

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-05-04 10:05:19 +02:00
Felix Weilbach d21df33a50 Add missing copyright headers for push notifications
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-05-04 07:27:06 +00:00
allexzander 2d88fc6c99 Obey enforced password for share by email.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-04-29 07:43:20 +00:00
Valdnet 8aedc74838 l10n: Delete space and change capital letter
Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com>
2021-04-28 11:41:06 +00:00
Matthieu Gallien 419bd93dea when files get hydrated indirectly through pinning, sets correct state
files that get downloaded not through an hydration request need to be
converted to placeholder

sets the expected state when converting them to placeholder files

 #3082

Signed-off-by: Matthieu Gallien <matthieu_gallien@yahoo.fr>
2021-04-26 13:54:32 +02:00
Matthieu Gallien 929ae965ce prevent progress bar to appear after a download is finished with CfApi
when using Cloud Filter API with enabled VFS on Windows, a progress bar
stays visible for some time after hydration is completed. Not updating a
last time the progress bar prevents that.

Signed-off-by: Matthieu Gallien <matthieu_gallien@yahoo.fr>
2021-04-26 13:54:32 +02:00
Matthieu Gallien 97d785f1bb fix errors when calling CfRegisterSyncRoot by setting more fields
sets a reasonable size of the StructSize members in the struct passed to
CfRegisterSyncRoot function

Signed-off-by: Matthieu Gallien <matthieu_gallien@yahoo.fr>
2021-04-26 08:02:40 +00:00
Matthieu Gallien 782a2fdf06 avoid an assert by delaying access to response timestamp when in error
when canceling the sync of a big directory, I can get some network
request that are aborted before a Date reply header has been read

in this case we would always access
AbstractNetworkJob::responseTimestamp() and fire the assert even if we
know that the network reply has an error

delay the access to after the possible errors have been dealt with

Signed-off-by: Matthieu Gallien <matthieu_gallien@yahoo.fr>
2021-04-20 17:42:17 +02:00
Matthieu Gallien 20357ca7fa Revert "Add CMake option to enable address sanitizers"
This reverts commit 3000e26640.

This was not intended for a direct push

Signed-off-by: Matthieu Gallien <matthieu_gallien@yahoo.fr>
2021-04-19 17:54:09 +02:00
Felix Weilbach 3000e26640 Add CMake option to enable address sanitizers
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-04-19 15:38:59 +02:00
allexzander bc919bcc8c Temporary solution for file restoration issue due to failing the dataFingerprint on client.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-04-14 06:42:48 +00:00
Felix Weilbach 696979cb0e Display invalid filenames as warning
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-04-13 14:58:51 +00:00
Felix Weilbach b256c6e694 Ping websocket server
This helps the client to recognize if the websocket server is still alive.

Fixes #2983

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-04-13 12:19:40 +00:00
Valdnet e628a51735 l10n: Unify spelling
Spelling unification in Nextcloud applications.

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-04-13 12:24:57 +02:00
Nicolas Fella 3bc66bea66 Improve Inotify cmake code
Use the FindInotify from ECM. It handles the case of Linux vs BSD
correctly automatically.

Also only find Inotify on Linux and BSD

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2021-04-13 06:36:14 +00:00
Camila 98cfc362f7 Remove const and reference of base types.
Signed-off-by: Camila <hello@camila.codes>
2021-04-08 07:10:58 +00:00
allexzander 4b58c2b7b7 Fix review comments.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-04-07 09:08:02 +00:00
allexzander 82953d0601 Fix review comments.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-04-07 09:08:02 +00:00
allexzander de85b79bb8 Address review comments.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-04-07 09:08:02 +00:00
allexzander cb8b6ccd9b Ignore *.lnk files on Windows.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-04-07 09:08:02 +00:00
allexzander 13f4bb541d Treat .lnk files as normal files without hydrating them or creating a placeholder.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-04-07 09:08:02 +00:00
allexzander 3906ae0922 Another way to fix this.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-04-07 09:08:02 +00:00
allexzander 7235c708dc Added .lnk file placeholder creation fix.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-04-07 09:08:02 +00:00
allexzander d5b6d93978 Fix VFS freeze when syncing '.lnk' files on Windows.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-04-07 09:08:02 +00:00
allexzander 0a33e99053 Create std::wstrings out of const wchar_t* so a copy is created every time.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-04-06 10:03:22 +03:00
allexzander 28771b25e3 Fix VFS CfAPI Syncroot Register Error.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-03-27 02:41:24 +02:00
allexzander ab128cc4aa Revert "Merge pull request #3042 from nextcloud/temp-fix-vfs-failure-wow6432"
This reverts commit cafa475398, reversing
changes made to 003e56f4e6.
2021-03-26 22:25:31 +02:00
allexzander 9d15334813 Temp fix for vfs failure.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-03-26 21:41:44 +02:00
Camila 9219926a74
Add checks in case userStatus is not available/fails on the server side.
Signed-off-by: Camila <hello@camila.codes>
2021-03-24 15:42:26 +01:00
Camila d9a0778e52
Add UserStatus enum with the pre defined status.
- User QHash to map status strings and Status enum.

Signed-off-by: Camila <hello@camila.codes>
2021-03-24 15:41:31 +01:00
Camila 974e2fb718
Do not display notifications when user status is do not disturb.
- This information is retrieved from the notifications endpoint.
- Add icons for the different pre defined status.
- Make functions available to QML to decide which status icon to display.
- Display the user status icon on the avatar and
move the online/offline connection status to the folder icon.

Signed-off-by: Camila <hello@camila.codes>
2021-03-24 15:40:05 +01:00
allexzander 193e50311b Refresh Windows download dialog progress when hydrating a placeholder
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-03-24 14:09:06 +02:00
Felix Weilbach d78774f29e Check reading from journal was successful before remove placeholder
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-03-24 10:51:50 +00:00
Felix Weilbach b1983d7d19 Increase logging around file removal events
To better see what is going on when and if files are removed by the
client.

See also: #260, #1433, #2913

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-03-22 07:48:39 +00:00
Felix Weilbach 9bf5b5c7ba CFAPI: Handle cancelation of hydration requests
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-03-18 10:43:48 +00:00
allexzander 5f0344abb2 Fix warnings in CfApiWrapper.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-03-18 12:07:07 +02:00
allexzander 3fde838bee Fix for Windows long path issue.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-03-18 12:07:07 +02:00
Felix Weilbach c0f09ae12c Don't check against product name if checking server version
We should not rely on the product name because it is something the
user can change in the theming options on the server.

Fixes #3001

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-03-16 14:30:56 +00:00
Kevin Ottens a6bcd3af46 Force basic auth on get authentication required error
If the get job got an authentication required error on the account url
(not davUrl! at that stage we always get auth error there), then it is
safe to assume basic auth is used on the server. It is then kind of
pointless to use any other auth mode they will necessarily fail. Only
basic auth will do the job so force it.

Signed-off-by: Kevin Ottens <kevin.ottens@enioka.com>
2021-03-15 09:38:15 +00:00
Kevin Ottens 0d3459e85e Introduce an empty auth type
This is necessary to be able to distinguish between "I decided on basic
by default" and "I didn't write any auth type". To make sure all the
jobs end up writing something we then implement the "I decided on basic
by default" in the slots connected to the job and we assert it in
checkAllDone()

Signed-off-by: Kevin Ottens <kevin.ottens@enioka.com>
2021-03-15 09:38:15 +00:00
Kevin Ottens 7ad0208800 Finish cleaning up shibboleth
There were a couple of shibboleth related enums left, since that auth
method isn't supported anymore remove the code tied to those enums. It
was dead code anyway.

Signed-off-by: Kevin Ottens <kevin.ottens@enioka.com>
2021-03-15 09:38:15 +00:00
allexzander c89d351d97 Fix incorrect type when reading the 'logExpire' property from config.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-03-12 10:23:31 +02:00
Felix Weilbach 88426de4dd Add missing error handling for downloads of client side encryption
The missing error handlers can cause the sync to hang forever

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-03-11 10:59:08 +00:00
Felix Weilbach e0b7ef15b2 Restyle wizard pages
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-03-10 09:55:40 +01:00
Felix Weilbach 9185956069 Split out wizard welcome page
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-03-10 09:55:40 +01:00
Felix Weilbach ef5abac567 Fix crashes with conflict dialog
When the client runs and a conflict gets detected, the sync engine runs
two times.

On the first run, the sync engine detects the conflict, marks the
file as a conflict and propagates that to the GUI. This leads to an
error notification with the original filename in the main dialog.

The sync engine runs then a second time. On this second run, the file
that originally caused the conflict is not anymore a conflict
file. Instead, the sync engine detects the conflicted copy and
propagates that file as a conflict to the GUI.

When opening the conflict dialog with the original file name (not the
conflicted copy) a crash happens. Usually, the two sync runs are really
fast, so the user does not notice the first notification. However, a
problem can occur if a conflict gets created while the client is not
running. Since then, the client does not do two sync runs. It does only
run once.

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-03-05 11:32:44 +00:00
Felix Weilbach 523f1bcadd VFS Windows: Fix download of large files
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-03-04 09:05:17 +01:00
Felix Weilbach 4d05979be5 Log error message from CFAPI
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-02-27 17:44:26 +00:00
allexzander 4d66d209bc Fix incorrect logger output for non-latin strings.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-02-16 09:30:08 +02:00
Marco Hald 43ed8423e5 Configuration Options for Windows Registry
Added the configuration  options
        confirmExternalStorage
        crashReporter
        newBigFolderSizeLimit
        useNewBigFolderSizeLimit
    to the Windows registry

Signed-off-by: Marco Hald <marcohald@users.noreply.github.com>
2021-02-12 12:23:51 +01:00
Kevin Ottens 856f0567a7 Make sure we pass a full remote path to LSCOL jobs
Indeed the path we have is supposedly not fully qualified in case of a
sync folder which doesn't point to / on the remote end. But LSCOL works
with absolute paths on the server so make sure this is what we give it
out.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-02-04 11:16:48 +00:00
Kevin Ottens dd83efb543 The e2eMangledName was relative to the remote folder, repair it
This got broken during the huge discovery refactoring. I wrongly passed
the mangled name as is out of discovery, but coming from listing jobs it
was fully qualified while the jobs at propagation time and the db expect
those paths to be relative to the remote folder.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-02-04 11:16:48 +00:00
Felix Weilbach 73a41d8e34 Compile nextcoud gui as separate library
Compiling nextcoud gui as a separate library. This is needed to more
easily write tests. The whole nextcloud application can now be linked
against the tests.

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-02-02 13:35:04 +00:00
Kevin Ottens 1456d6e433
Revert "Specify PUBLIC for the link targets to make them visible to windeployqt"
This reverts commit 002abdc38b.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-27 19:06:23 +01:00
allexzander 8c4d5333c1 Use push notifications for Tray activities/notifications fetch trigger.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-01-27 19:53:28 +02:00
Kevin Ottens 002abdc38b
Specify PUBLIC for the link targets to make them visible to windeployqt
I went full steam on making it all public which is not really required,
it's only really QtWebSockets we're after. Could always be fine tuned
later on if this works as expected.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-27 18:00:26 +01:00
Kevin Ottens ebfe51b7e7 Don't treat new folders in unpinned folders as files to dehydrate
This would only happen if the parent of the newly created folder would
be explicitly set to online only, hence why it went under the radar
previously.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-26 17:09:24 +00:00
Kevin Ottens d20fc1a6ce Remove unused method
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-26 11:20:13 +00:00
Kevin Ottens 4168c0d082 Avoid keeping Account alive via a shared ptr in ClientSideEncryption
This account object was really only used during the initialization phase
or for forgetting the sensitive data. So let's receive it as parameter
there and pass it on from job to job as needed.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-26 11:20:13 +00:00
Kevin Ottens 21035d48a6 Don't crash when the same request is filled twice
The OS might request the same file again if we take too much time to
fulfill a request. So in case it's queueing the same one again instead
of bailing out just fail the second one and let the first one finish
properly.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-26 10:58:14 +00:00
Kevin Ottens d3c7218ee8 Be a bit more resilient with errors
In case we'd been to slow to fullfill or we're still processing a
cancelled request better not just crash. We still log the issue though.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-26 10:58:14 +00:00
Felix Weilbach 78f00acaa2 Add push notifications for file changes
Resolves #2802

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-01-25 17:01:09 +00:00
allexzander eb80f54dcf E2EE Fix incorrect name of a nested encrypted item in the Settings dialog when the root folder is non-encrypted and it is renamed.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-01-25 10:35:54 +02:00
allexzander 483a874cb6 Fix folder upload issue due to wrong Lock/Unlock order
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-01-25 10:35:30 +02:00
allexzander 79fe231acc Fix E2EE root folder rename issue.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-01-25 10:35:30 +02:00
rakekniven c3403b83ef Removed blank before colon
Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2021-01-25 08:08:13 +00:00
Kevin Ottens 48f0c54a90 Fix the branding detection for monochrome icons on Mac
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-21 06:39:11 +00:00
Kevin Ottens 96b2b2a509 Revert "Make monochrome icons the default on Linux and Mac OS."
This reverts commit 016410dbaa.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-21 06:39:11 +00:00
Kevin Ottens 471bb25e62
Use APPLICATION_ICON_SET for themed icons
We now favor APPLICATION_ICON_SET to isBranded() regarding the decision
to use PNG or SVG for icons.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-20 15:11:57 +01:00
Kevin Ottens 88986749a4
Use the SVG wizard logo when APPLICATION_ICON_SET says so
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-20 15:09:58 +01:00
allexzander 96472320e4 Fix e2ee folder move issue
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-01-14 15:54:30 +02:00
Kevin Ottens 1aeb77c967
Add the XAttr backend prototype with its test suite
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-14 12:57:03 +01:00
Kevin Ottens 7c8b7db725
Don't detect file changes during hydration for virtual files
Indeed, that file size will almost always change between the 1 byte
placeholder and the hydrated file. Only when using the CfAPI on Windows
this won't be the case since because it will expose the original size
even for placeholders.

Also worth noting: the suffix backend didn't hit that case since the
filename changes (with suffix for placeholders, without for hydrated
files).

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-14 12:57:03 +01:00
allexzander bf5b214e0e E2EE fix upload parallelism issue.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-01-14 06:59:05 +00:00
Kevin Ottens 5325e058d8
Repair chunked uploads
There's been a confusion between the chunk number and the chunk
offset leading to corruptions... Let's pass the proper offset to
the UploadDevice again.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-13 18:00:19 +01:00
allexzander 4ed7feab2b Implement nested items removal when removing root encrypted folder.
Signed-off-by: allexzander <blackslayer4@gmail.com>
2021-01-11 21:12:58 +02:00
Kevin Ottens 2d8eb19ee5
Second attempt at fixing CfAPI wrapper build in Win32 mode
MSVC having so useless error messages it didn't quite point to the root
cause of the issue... it turns out that through the maze of macros
defined in the windows API, there's one which impacted the function
pointer definition of CfCloseHandle which would then not convert to
FileHandle::Deleter as expected. So I end up wrapping it in a lambda to
help... luckily this kind of lambdas decay into a simple function
pointer so there's likely no overhead it's just to coerce the compiler
into doing the right thing.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-07 13:49:10 +01:00
Kevin Ottens 79a54d68ed
Revert "Fix CfAPI wrapper build in Win32 mode"
This reverts commit 3b3864296a.
2021-01-07 13:40:01 +01:00
Kevin Ottens 3b3864296a
Fix CfAPI wrapper build in Win32 mode
For some reason MSVC manages to deduce the right constructor in Win64
mode but not in Win32 mode. So let's be more explicit about what we
return.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2021-01-06 17:07:50 +01:00
Felix Weilbach db0f1e245d Remove NO_SHIBBOLETH flag and dead code
Signed-off-by: Felix Weilbach <felix.weilbach@t-online.de>
2021-01-05 12:58:58 +01:00
Hannah von Reth 09cc988026
Fix a possible crash with the remove all files dialog 2020-12-30 16:20:43 +01:00
Hannah von Reth aadda32633
Handle errors in convertToPlaceholder 2020-12-30 16:17:47 +01:00
Hannah von Reth 51d73e27ea
Clarify comment 2020-12-30 16:17:46 +01:00
Hannah von Reth 3f873ed2ee
Simplify file comparison 2020-12-30 16:17:46 +01:00
Hannah von Reth 157d526129
Include auth type in http log 2020-12-30 16:17:46 +01:00
Hannah von Reth f6f7789afa
Log the final http request 2020-12-30 16:17:41 +01:00
Kevin Ottens 46a5bd6b25
Ensure we properly cancel hydration on server errors
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 09:44:59 +01:00
Kevin Ottens 90fbb7d322
Implement callback between wrapper and vfs object for hydration requests
This comes with a test simulating an open request coming from another
process (although in our case it's really just a thread). The actual
hydration works as expected by cfapi, handling of encrypted files is for
now missing.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 09:44:58 +01:00
Kevin Ottens 7668c521c1
Split the CfAPI lower level code in a wrapper
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 09:44:58 +01:00
Kevin Ottens 423780bf79
Add initial version of the CfApi backend
For now this implements only the logic necessary to get a test suite
equivalent to the TestSyncVirtualFiles one to pass. It doesn't (yet)
honor request to fetch files from the system.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 09:44:58 +01:00
Kevin Ottens 216b251b40
One byte placeholders assumption only holds for the suffix backend
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 09:44:57 +01:00
Kevin Ottens 4d4b87c9c3
Don't consider CfApi backend as experimental
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-30 09:44:53 +01:00
rakekniven e1979fdb33 Removed translation for "etag" and changed spelling
Shouldn't be translated.

Just checked https://en.wikipedia.org/wiki/HTTP_ETag and all available localized pages.

Signed-off-by: rakekniven <mark.ziegler@rakekniven.de>
2020-12-28 08:51:56 +00:00
Camila 016410dbaa
Make monochrome icons the default on Linux and Mac OS.
Unless it is branded with other icons.

Signed-off-by: Camila <hello@camila.codes>
2020-12-16 14:42:24 +01:00
Kevin Ottens af57a702ef
Workaround bug in older GCC used for the AppImage toolchain
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 11:01:53 +01:00
Kevin Ottens c57eff6fd8
Please the clang-tidy overlord
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 11:01:53 +01:00
Hannah von Reth c03a5da670
Don't warn if everything is fine 2020-12-15 11:01:53 +01:00
Hannah von Reth ebd8047cb6
Replace custome date parser QDateTime::fromString(value, Qt::RFC2822Date) 2020-12-15 11:01:52 +01:00
Hannah von Reth 9d9eadba8e
Use time the request was send,..
not when it was processed by the client, to determine the quality of the connection.
2020-12-15 11:01:08 +01:00
Hannah von Reth 1b4ccea083
Owncloud - virtual files smaller <1KB - problems with syncing
The issue was caused by gziped responses not providing a
content lenght header.

Fixes: #8248
2020-12-15 10:59:27 +01:00
Hannah von Reth 440b31986a
Ensure the callback is triggered 2020-12-15 10:59:25 +01:00
Hannah von Reth f6faba48e2
Don`t block main thread when displaying all files removed dialog
Fixes: #8170
2020-12-15 10:59:25 +01:00
Kevin Ottens 201dbd54db
Remove the plugin loader mechanism for VFS backends
We will have all the code in public anyway so it can just be compiled
in. Thus no need to go through the plugin loading dance. Replaced the
loading with factory functions. Kept mostly the same structure
otherwise.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:24 +01:00
Kevin Ottens 1acb2679dd
Get rid of now unused GetFolderEncryptStatusJob
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:23 +01:00
Kevin Ottens 36b8e7c2a4
Remove the encryption flag check from encrypted propagation code
If we use those encrypted propagation code paths, we already know from
the discovery phase (and thus the journal db) that the folders are
encrypted so no need to check again.

This will remove another expensive round trip with the server.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:23 +01:00
Kevin Ottens b2533e6451
Remove encrypt status job fetching from ClientSideEncryption
This is now unused.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:23 +01:00
Kevin Ottens d22046d679
No need to fetch encryption data separately before discovery
This step isn't necessary anymore, no one looks at ClientSideEncryption
for that information anyway.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:23 +01:00
Kevin Ottens 580b36fe20
Remove unused methods on ClientSideEncryption
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:23 +01:00
Kevin Ottens 7a4a359704
Stop using e2e()->isFolderEncrypted() in the jobs
Thanks to the new discovery algorithm, we got all the freshest E2EE
information straight from the database so reuse it instead of going
through an in memory copy.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:22 +01:00
Kevin Ottens 37a51872e1
Set the encrypted flag in the database when EncryptFolderJob succeeds
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:22 +01:00
Kevin Ottens b667bdda14
Change EncryptFolderJob path convention
It had a different path convention than all the other jobs, most likely
for legacy reasons because of the tight coupling it had to the settings
dialog.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:22 +01:00
Kevin Ottens ee8e0fa332
Have the folder token inside the EncryptFolderJob
No need to look for a token on the outside we can just work properly by
keeping all the state encapsulated in the job.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:22 +01:00
Kevin Ottens af00ef1cca
Don't use getFileRecordByE2eMangledName in jobs anymore
Thanks to the new discovery algorithm we got both mangled and original
file names in the item so no need to go through the database for
nothing.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:21 +01:00
Kevin Ottens 66f24241d8
Repair E2EE deletions
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:21 +01:00
Kevin Ottens 567f678fd5
Make sure the encrypted flag gets all the way to the journal db
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:21 +01:00
Kevin Ottens 961794669e
Repair E2EE uploads
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:21 +01:00
Kevin Ottens 1d07af07a5
Start hooking up E2EE to the new discovery algorithm
Now we pull the encrypted metadata during the discovery which is a
better approach than before. This shall remove the need for some of the
deep propfinds we have been using so far. It already simplifies the code
a bit for the download scenario.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-12-15 10:59:21 +01:00
Hannah von Reth 44175aca94
Fix: Log chunked messages 2020-12-15 10:59:20 +01:00
Hannah von Reth 93152761a1
Use verbose function names instead of direct member access 2020-12-15 10:59:20 +01:00
Hannah von Reth 4f596dae8c
Log http status
Fixes: #8073
2020-12-15 10:59:19 +01:00
Hannah von Reth 0eabc75039
Improve log message 2020-12-15 10:59:18 +01:00
Hannah von Reth fd6146d09e
Clazy: Fix some warnings 2020-12-15 10:59:18 +01:00
Hannah von Reth c1a91e91e7
Use the servers checksum type by default 2020-12-15 10:59:16 +01:00
Hannah von Reth 8c3749cbe2
Log state before specific assertion 2020-12-15 10:59:16 +01:00
Hannah von Reth 4589772393
Remove more legacy C code 2020-12-15 10:59:15 +01:00
Hannah von Reth 47dc7e6c49
Remove custome string functions 2020-12-15 10:59:15 +01:00
Hannah von Reth c9ee0a0343
Log: Improve log message [ info gui.folder ]: Folder sync result: 4...
by including the name of the folder and print the name of the result
2020-12-15 10:59:15 +01:00
Hannah von Reth 6c2c544713
Log HTTP requests and responses
Issue: #7873
2020-12-15 10:59:13 +01:00
Hannah von Reth aaca3e7ce5
Use separate loggin category for upload v1 and ng 2020-12-15 10:59:12 +01:00
Hannah von Reth 4d615c31da
Rename csync_instructions_e -> SyncInsturctions 2020-12-15 10:59:10 +01:00
Hannah von Reth 8cbdb4451b
Remove now unneede csync_instruction_str 2020-12-15 10:59:10 +01:00
Hannah von Reth 38c4d5a406
Cookies: Do set cookies in DetermineAuthTypeJob too
As we don't support cookie based authentication anymore we can provide cookies here.
This fixes issues with loadbalancers access policy managers.
2020-12-15 10:59:10 +01:00
Hannah von Reth f073997aee
Cookies: Don't override cookies with outdated values
This code was actually not breaking most cookie handling by accident.
As the raw cookies where not split properly we added cookies with values like
"key: val; key2 = val2; key3 = val3"
When the code was corrected we overwrote the newer values in the jar with
the old ones from a request.
2020-12-15 10:59:09 +01:00
Olivier Goffart 317d3735d7
SocketAPI: fix status after a failure to move
Issue #7759
2020-12-15 10:59:09 +01:00
Hannah von Reth 85aefa4232
Sync: Fix handling of virtual files in error state
Issue: #7799
2020-12-15 10:59:09 +01:00
Hannah von Reth 5927beb08d
Fix potential null pointer access
https://sentry.io/organizations/owncloud/issues/1529161263/events/02509984b5ca42ffb3960d9c9e161414/?project=79001&statsPeriod=14d
2020-12-15 10:59:07 +01:00
Olivier Goffart a6a0e361c1
fixup test 2020-12-15 10:59:07 +01:00
Hannah von Reth 106a35d242
[SSL] Print warning only if something changed 2020-12-15 10:59:06 +01:00
Hannah von Reth ba87fc9e78
[SSL] Properly restore user accepted certificats 2020-12-15 10:59:06 +01:00
Hannah von Reth 9564e5e92e
Fix saving of cookies
Fixes: #7700
2020-12-15 10:59:06 +01:00
Olivier Goffart 1c10fceacc
SyncEngine: no need to use QAtomicInt
This was done because the propagator jobs where running in a thread a long
time ago, but this is no longer the case.

(Also QAtomicInt::load is marked as deprecated now)
2020-12-15 10:59:05 +01:00
Hannah von Reth b6e8d47644
Use Q_ENUM on AuthType to get the name printed in the log 2020-12-15 10:59:04 +01:00
Hannah von Reth 6c19b02888
Disable http2 support for now
Issue: #7610
2020-12-15 10:59:04 +01:00
Olivier Goffart 0e7c56e81c
Don't show the "All files deleted" popup when unselecting everything with selective sync
Issue #7337
2020-12-15 10:59:04 +01:00
Olivier Goffart 392d3c257c
Discovery: Allow more HTTP error code to be treated as ignored dir
The original code from csync was stopping at any error.
But we have been whitelisting soeme http error code one by one
to ignore the directory instead of aborting the sync.
However, as there are more requests to continue the sync in case
of error, just ignore most HTTP errors

Issue #7586
2020-12-15 10:59:03 +01:00
Hannah von Reth 43c7e32ee1
[libsync] Export verifyFileUnchanged
This fixes Windows builds that are broken since #7562 was merged
2020-12-15 10:59:03 +01:00
Olivier Goffart 66f7b27121
VFS: Do not overwrite existing files by placeholder
For issue #7557 and #7556

Note: this change the API of the VFS plugin, so the VFS plugin needs small
adaptations
2020-12-15 10:59:03 +01:00
Olivier Goffart fc0aeb53b1
Discovery: fix TestSyncVirtualFiles::testExtraFilesLocalDehydrated on windows
On windows we do a test to know if we should change the case of the files,
but that conflict with the test that checks if the file was still there
when the filename is actually the same. Which can happen with virtual files
as they have two representation (the one with and without suffix).
2020-12-15 10:59:02 +01:00
Christian Kamm 4c4cbf0d97
Vfs: Lots of tests and corrections for suffix edge cases
Avoid or deal with problems that happen when suffixed files exist on the
server or suffix and non-suffixed files exist locally.

See #7350, #7261.
2020-12-15 10:59:02 +01:00
Olivier Goffart 88f86a56b1
Discovery: Attempt to fix issue with windows VFS and new files
(or moved files)
As seen in the log of #7558, a conflict may be issued by mistake.

See investigation in https://github.com/owncloud/client/issues/7558#issuecomment-547385362

This hopefully fix #7558
2020-12-15 10:59:02 +01:00
Olivier Goffart 115a53134c
SyncEngine: Save a bit of memory by not keeping a set of all filename
This is only used for conflict files, so only save conflict files.
(The _seenFile was used for other things in 2.5, but not anymore)
2020-12-15 10:59:01 +01:00
Olivier Goffart 83d743b66b
When moving is allowed but deleting is not, do not restore moved items
Issue #7293
2020-12-15 10:59:01 +01:00
Olivier Goffart ee611e6004
Restoration items should appear in the sync protocol
When an item is downloaded because it is restored, it shall be shown in the
sync protocol.
(It is also going to be shown in the not synchronized for a short while, but
that's fine)
2020-12-15 10:59:01 +01:00
Christian Kamm 9d422284af
Discovery: Distinguish readdir and closedir errors 2020-12-15 10:59:01 +01:00
Olivier Goffart adbd3d869b
Fix warning about serverJob not being used
And fix a FIXME in the same time
2020-12-15 10:59:00 +01:00
Christian Kamm 89216daee6
Propagate dir: Never write the etag on remote mkdir #7481
It must always only be written once all children are successfully
propagated.
2020-12-15 10:59:00 +01:00
Christian Kamm e91e1ca78f
Test: Disable local discovery parallelism in permission test
Adding parallelism broke the test because it depended on the order of
discovery.
2020-12-15 10:59:00 +01:00
Christian Kamm e596b55977
Discovery: Change local job signal signatures
To make it more explicit that data a copy of the data is transfered
between threads. (though Qt will make a copy of the arguments anyway)
2020-12-15 10:58:59 +01:00
Christian Kamm 71f71b38f1
Discovery: local job shouldn't be parented
Since it'll be deleted by the thread pool.
2020-12-15 10:58:59 +01:00
Christian Kamm 53a217d4e4
Don't store pointer to local job
There were crashes in the QPointer assignment. Possibly the thread pool
is done with the job and deletes it before the assignment is done.
2020-12-15 10:58:59 +01:00
Markus Goetz 26b5e36351
Discovery: List local directories from thread #7456 #7439 2020-12-15 10:58:59 +01:00
Markus Goetz 09a0dbbf82
Reconcile: Sort already during discovery #7445 2020-12-15 10:58:59 +01:00
Markus Goetz 41dc68f99c
Propagator: Delay job execution a bit #7439 2020-12-15 10:58:58 +01:00
Christian Kamm e37e954720
Discovery: Remove level of indent around moves
No code changes.
2020-12-15 10:58:58 +01:00
Christian Kamm 28797baa39
Discovery: If a move is forbidden, restore the source
Previously the source was deleted (or attempted to be deleted), even if
the new location was not acceptable for upload. This could make data
unavilable on the server.

For #7410
2020-12-15 10:58:58 +01:00
Christian Kamm c9d1037622
Propagation: Fix delete-before-rename bug #7441
By introducing a PropagateRootDirectory job that explicitly
separates the directory deletion jobs from all the other jobs.

Note that this means that if there are errors in subJobs the
dirDeletionJobs won't get executed.
2020-12-15 10:58:58 +01:00
Markus Goetz 475117dd60
Propagator: Make sure we schedule only one job #7439
To not starve the event loop.
(There is still ~= 3 jobs running at the same time)
2020-12-15 10:58:58 +01:00
Christian Kamm 3446412d92
PropagateDownload: Don't try to open readonly temporaries
This situation could arrise when receiving a read-only share and the
temporary rename failed for some reason.

See #7419
2020-12-15 10:58:58 +01:00
Christian Kamm 0ac8a3e6be
Don't fatal on "Storage temporarily unavailable"
This is an unreliable workaround. The real fix will need to be deferred
to another release.

For #5088
2020-12-15 10:58:57 +01:00
Hannah von Reth e5a36c3bc6
CMake VFS: Enable us to provided vfs plugins from an external directory 2020-12-15 10:58:57 +01:00
Dominik Schmidt 67656fb136
Add Q_PROPERTYs for gui testing 2020-12-15 10:58:56 +01:00
Hannah von Reth e97784bb9d
Don't use mutable lambdas as they hide where we modify work on a copy 2020-12-15 10:58:55 +01:00
Christian Kamm 18e1098e38
Remove maxLogLines config option
It's no longer used.

For owncloud/docs#1365
2020-12-15 10:58:55 +01:00
Christian Kamm ea829f96ca
Download: Don't trigger too many concurrent hash computations
Previously the job would only become "active" when the downloads
started. That meant that arbitrarily many hash computations could be
queued at the same time.

Since the the file was opened during future creation this could lead to
a "too many open files" problem if there were lots of new-new conflicts.

To change this:
- Make PropagateDownload become active when computing a hash
  asynchronously.
- Make the computation future open the file only once it gets run. This
  will make it less likely for this problem to occur even if thousands
  of these futures are queued.

For #7372
2020-12-15 10:58:55 +01:00
Christian Kamm 8a5a185752
Fix 'unused parameter name' warnings 2020-12-15 10:58:55 +01:00
Christian Kamm 5761f4cd8a
SyncEngine: Don't duplicate fatal errors
Previously fatal error texts were duplicated: Once they entered the
SyncResult via the SyncFileItem and once via syncError().

syncError is intended for folder-wide sync issues that are not pinned
to particular files. Thus that duplicated path is removed.

For #5088
2020-12-15 10:58:54 +01:00
Christian Kamm 61972c35a8
Discovery: Parse etag to be consistent with RequestEtagJob
This avoids unnecessary sync runs.

For #7345
2020-12-15 10:58:54 +01:00
Christian Kamm 55ee3f440b
Vfs: Remove old db record when dehydrating via rename
For #7338
2020-12-15 10:58:54 +01:00
Christian Kamm e6990bd04e
Vfs: Make move detection work with virtual files #7001
Previously a checksum computation could be done on a suffix-placeholder
file, making discovery believe that no move took place.
2020-12-15 10:58:54 +01:00
Christian Kamm 00dcf3ef59
Vfs: Ensure pins change with (de-)hydration
Previously an implicit hydration of a file in an online-only folder
would not change the pin state and cause a dehydration on the next
sync.
2020-12-15 10:58:53 +01:00
Christian Kamm 0df3b83bd2
Vfs: Add hook to allow update-metadata for unchanged files
Allows winvfs to convert files to placeholders when vfs is enabled. This
is required to mark files as in-sync #7329.
2020-12-15 10:58:53 +01:00
Christian Kamm 5bc2180478
Vfs: Preserve pin state on hydration
For #7322 and #7323
2020-12-15 10:58:53 +01:00
Dominik Schmidt 92f6d866e1
Add missing OWNCLOUDSYNC_EXPORT 2020-12-15 10:58:52 +01:00
Christian Kamm 5acb157a7e
VfsSuffix: Wipe stale pin states #7273
Previously the pin states of deleted files stayed in the 'flags'
database and could be inadvertently reused when a new file with the same
name appeared. Now they are deleted.

To make this work right, the meaning of the 'path' column in the 'flags'
table was changed: Previously it never had the .owncloud file suffix.
Now it's the same as in metadata.path.

This takes the safe parts from #7274 for inclusion in 2.6. The more
elaborate database schema changes (why use 'path' the join the two
tables in the first place?) shall go into master.
2020-12-15 10:58:52 +01:00
Christian Kamm 0e9f030b0f
RequestEtagJob: Consistently parse etags #7271
Previously RequestEtagJob did return the etag verbatim (including extra
quotes) while the db had the parsed form. That caused the etag
comparison during discovery move detection to always fail. The test
didn't catch it because the etags there didn't have quotes.

Now:
- RequestEtagJob will parse the etag, leading to a consistent format
- Tests have etags with quotes, detecting the problem
2020-12-15 10:58:52 +01:00
Christian Kamm 69fa1e4775
UploadDevice: Fix windows issues #7264
- Close the UploadDevice to close the QFile after the PUT job is done.
  This allows winvfs to get an oplock on the file later.

- Don't rely on QFile::fileName() to be valid after
  openAndSeekFileSharedRead() was called. The way it is openend on
  Windows makes it have an empty filename.
2020-12-15 10:58:52 +01:00
Christian Kamm fb47419e84
Vfs: Move pin state if files move #7250
Previously renames of items didn't carry the pin state with them.
2020-12-15 10:58:52 +01:00
Christian Kamm 34dc5e4e88
Vfs: Don't let new local files start out unpinned #7250
If one adds a new file to an online-only folder the previous behavior
was to upload the file in one sync and dehydrate it in the next. Now
these new files get set to Unspecified pin state, making them retain
their data.
2020-12-15 10:58:52 +01:00
Markus Goetz 62d876b09a
OAuth2: Better error logging
This does not fix a bug, just was found while spotting a bug that was no bug.
For https://github.com/owncloud/enterprise/issues/2951
2020-12-15 10:58:51 +01:00
Christian Kamm 452ed56571
Upload: Read file chunks gradually #7226
Instead of all at once, to reduce peak memory use.

Changing UploadDevice in this way requires keeping the file open for the
duration of the upload. It also means changes to open(), seek(), close()
to ensure that uses of the device work right when a request needs to
be resent.
2020-12-15 10:58:51 +01:00
Christian Kamm a7852e3aba
Http2: Resend requests on ContentReSend error #7174
Since Qt does not yet transparently resend HTTP2 requests in some cases
we do it manually.

The test showed a problem where the initial non-200 reply would close
the target temporary file and the follow-up request couldn't store any
data. Removing that close() call is safe because there also is a
_saveBodyToFile flag that guards writes to the target file.
2020-12-15 10:58:51 +01:00
Olivier Goffart c335f69a65
Discovery: Do not abort the sync in case of error 404 (or 500)
Issue: #7199
2020-12-15 10:58:51 +01:00
Olivier Goffart 9f08636a4a
SyncEngine: Fix renaming a single file cause the "delete all file" popup
Possibly a regression, since the new discovery discovers rist the renamed
files as removed

Issue #7204
2020-12-15 10:58:51 +01:00
Christian Kamm edad7ce7d7
Vfs: Mark sqlite temporaries excluded on db-open #7141
The previous patch ensured that the sqlite temporaries weren't deleted
and recreated for every sync run, but there was still time between
client startup and the first sync run where they would have the
"needs-sync" icon.
2020-12-15 10:58:50 +01:00
Christian Kamm 7774b8049e
Vfs: Distinguish availability error kinds #7143
Previously "no-availability" meant db-error and querying the
availability of a nonexistant path returned AllHydrated.

Now, the availability has a DbError and a NoSuchItem error case.
2020-12-15 10:58:49 +01:00
Christian Kamm 21cb93e3ce
SyncEngine: Don't close db when done #7141
The db-close operation is likely a leftover from when the SyncEngine
owned its own db connection and serves no purpose anymore.

Closing the db causes the removal of the temporary wal and shm files.
These files are recreated when the db is opened again, which happens
almost immediately.

This is a problem for winvfs because the delete-recreate step wipes the
exclusion state on these files just after the sync is done. That meant
that the db temporaries permanently had a "needs sync" icon marker shown
in the explorer.

Avoiding reopening the db also reduces the number of log messages per
sync.
2020-12-15 10:58:48 +01:00
Christian Kamm cfbcdc01db
Discovery: Improvements to doc comments 2020-12-15 10:58:48 +01:00