1
0
Fork 0
Commit Graph

1822 Commits

Author SHA1 Message Date
Dominik Schmidt a50c665051
Simplify Sparkle handling in CMake 2020-11-25 09:43:59 +01:00
Christian Kamm a8ad946758 Settings: Add update channel combobox #6259 2020-11-24 18:22:33 +00:00
allexzander 665a8c4217 Use dynamic path for account online/offline state icon. Refresh GUI on connection state change.
Signed-off-by: Alex Zolotov <alex.zolotov.nextcloud.com>
Signed-off-by: allexzander <blackslayer4@gmail.com>
2020-11-23 17:49:25 +02:00
Kevin Ottens 3427dadaeb
Get rid of FindQt5Keychain.cmake
QtKeychain provides Qt5KeychainConfig.cmake and friends nowadays, so no
need to have a less reliable and outdated find module on our end.

Also this shows that we were including keychain.h in the wrong way and
were not using the link target, so both got fixed as well.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-11-02 13:19:48 +01:00
Christian Kamm 00e901f5a7
SocketAPI: Introduce conflict resolution actions #6252
For conflicts generally as well as new files in read-only directories
the context menu will now present delete and move options.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-22 16:40:10 +02:00
Christian Kamm f62be57ef2
FileSystem: make removeRecursively() reusable
We want to use it for deleting directory conflicts.
2020-10-22 16:39:17 +02:00
Christian Kamm e70371f408
FileSystem: Fix bad indentation 2020-10-22 16:39:17 +02:00
Kevin Ottens 7536e4c00b
Expose the branding related members of Theme as properties
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 13:46:04 +02:00
Kevin Ottens 10cb4170c7
Don't use depth infinity anymore to get the folders e2ee status
This way we avoid the expensive SQL query on the server at the price of
more round-trips since we're doing the recursive traversal by hand now.

Also it turns out this depth was used for all the other propfind calls
during sync when we want fresher information regarding a folder. This
was very inefficient in all cases and won't happen anymore.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:59 +02:00
Kevin Ottens b5fdbefb0e
Make sure jobs don't outlive ClientSideEncryption
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:58 +02:00
Kevin Ottens 399b97442e
Factor out the logic to start a new e2ee status job
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:58 +02:00
Kevin Ottens cbc40b5a15
Mention the folder we listed in the debug logs
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:58 +02:00
Kevin Ottens 8e3ca71763
Change the way we store the job result
If there's more than one job we need to unite the maps not simply overwrite
them.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:58 +02:00
Kevin Ottens 9aeb7046d2
Start managing a list of GetFolderEncryptStatusJob
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:58 +02:00
Kevin Ottens cfb66ddadd
Add a way to know which folder was listed for encrypted status
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-21 10:00:58 +02:00
Michael Schuster 61dc4b9137
Update comments
Everyone uses their private mail, so ensure people can get in touch.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-10-15 02:18:52 +02:00
Kevin Ottens a53a87a3eb
Export the WordList functions
Now that they are used from gui/ they need to be properly exported so
that linking doesn't fail when visibility is activated (only on our
Windows build it seems).

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-08 15:58:29 +02:00
Kevin Ottens ab67741d87 Use setHeader instead of setRawHeader for the user agent
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-08 05:55:47 +00:00
Kevin Ottens 50dd715f4d Don't force user agent if one is already set on the request
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-08 05:55:47 +00:00
Kevin Ottens 607347289e Expose more of the logger state
It is better to rely on the Logger state to know exactly where we're
logging. Indeed due to the the various ways to impact its state the
config alone might not now where we're logging.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 13:33:20 +00:00
Kevin Ottens b0a38816fc Change the defaults for logging
Turn on the logging by default for everyone. Let's use a log dir within
the config directory of the application and have debug logs expiring
after a day.

This obviously means we'll generate quite some logs but with the
automated compression it shouldn't be too horrible. Obviously that
scales with the amount of files and syncs occurring. In our tests with a
large setup we're around 100 MB for a day worth of logs, this shouldn't
be too much of an issue on today's average desktop/laptop.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 13:33:20 +00:00
Kevin Ottens e356acbcee Add sharePublicLinkAskOptionalPassword to Capabilities
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-10-07 09:43:47 +00:00
Aldaris1985 ef6773bd60 Update propagateupload.cpp
Typo corrected.
2020-10-01 21:26:17 +00:00
Michael Schuster ce71ffe9f9 Allow server URL to be pre-defined without enforcing it to be used unmodified
APPLICATION_SERVER_URL can be either empty or be specified. This commit adds the new CMake option APPLICATION_SERVER_URL_ENFORCE to decide whether to enforce the
URL's unmodified use (like before, default: ON) or to allow modification by the user (new).

By default APPLICATION_SERVER_URL_ENFORCE is set to ON, to no break with the previous implementation's expectations.

If APPLICATION_SERVER_URL is empty, APPLICATION_SERVER_URL_ENFORCE will be ignored by the Account Wizard.

The previous behaviour confused me a bit with branded builds. When the URL was (usually) specified but not forced, it was simply discarded, forcing the user to
manually supply it.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-09-23 07:21:35 +00:00
Kevin Ottens 80cc196f6f Enable bugprone-narrowing-conversions clang-tidy check
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-01 06:37:03 +00:00
Kevin Ottens c8ea848596 Enable the bugprone-branch-clone clang-tidy check
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-01 06:37:03 +00:00
Kevin Ottens eb76682b1e Use httpd/unix-directory mimetype for E2EE folders
We don't do much with that mimetype on our end, but other clients
somehow don't expect inode/directory to let's lie. ;-)

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-31 10:08:48 +00:00
Michael Schuster 5945f18d5a
Remove remaining QLinkedList includes in addition to #2300
Now the only remaining reference is in:

src/3rdparty/libcrashreporter-qt/3rdparty/drkonqi-parser/backtraceparser.cpp:269:        || line.functionName().startsWith(QLatin1String("QLinkedList")

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-08-27 03:12:09 +02:00
Michael Schuster bd519ffe7a
Adapt code style in addition to #2300
- Use "!empty()" instead of "size() > 0" in std::list
- Add comments for namespace brackets

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-08-27 01:31:06 +02:00
V.C b20ea25201 Code review changes implemented
Code review changes implemented for bandwidthmanager.cpp
1. Use auto instead of size_t
2. Check for empty instead of size comparisions

Signed-off-by: V.C <c******@rediffmail.com>
2020-08-26 02:45:20 +00:00
V.C af1bb7e98c Support client builds on VS2019
Scenario: Build fails on Qt 5.15.0 + VS2019 16.7.2
Root cause: QLinkedList seems to be depreciated. Advise to use std::list instead.
Fix: Used std::list insead of QLinkedList.

Signed-off-by: V.C <c******@rediffmail.com>
2020-08-26 02:45:20 +00:00
Kevin Ottens f6e36523d2 Make sure we don't assert when calling fileStatus
It happens that sometimes we leak a directory path ending with a slash,
but that violates fileStatus' precondition so let's catch it early and
skip such path.

Of course the right fix would be a larger swipe in the sync engine and
around it to not use naked strings anymore but rely on the typesystem.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-18 13:52:28 +02:00
Olivier Goffart a7847a4e82
Upload: Store the size in the UploadInfo, and compare it when resolving potential conflict
This is about the conflicts that happens when the file has been uploaded
correctly to the server, but the etag was not recieved because the connection
was closed before we got the reply.

We used to compare only the mtime when comparing the uploaded file and the
existing file.  However, to be perfectly correct, we also should check the
size.

This was found because TestChunkingNG::connectionDroppedBeforeEtagRecieved is
flaky. Example of faillure found in https://drone.owncloud.com/owncloud/client/481/5
while testing PR #6626

(very trimmed log:)

06-29 07:58:02:015 [ info sync.csync.csync ]:	## Starting local discovery ##
06-29 07:58:02:016 [ info sync.csync.updater ]:	Database entry found, compare: 1530259082 <-> 1530259051, etag:  <-> 1644a8c8750, inode: 1935629 <-> 1935629, size: 301 <-> 300, perms: 0 <-> ff, type: 0 <-> 0, checksum:  <-> SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1, ignore: 0
06-29 07:58:02:016 [ info sync.csync.updater ]:	file: A/a0, instruction: INSTRUCTION_EVAL <<=
06-29 07:58:02:972 [ warning sync.networkjob ]:	QNetworkReply::NetworkError(OperationCanceledError) "Connection timed out" QVariant(Invalid)
.. next sync...
06-29 07:58:02:980 [ info sync.engine ]:	#### Discovery start ####################################################
06-29 07:58:02:981 [ info sync.csync.csync ]:	## Starting local discovery ##
06-29 07:58:02:983 [ info sync.csync.updater ]:	Database entry found, compare: 1530259082 <-> 1530259051, etag:  <-> 1644a8c8750, inode: 1935629 <-> 1935629, size: 302 <-> 300, perms: 0 <-> ff, type: 0 <-> 0, checksum:  <-> SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1, ignore: 0
06-29 07:58:02:983 [ info sync.csync.updater ]:	file: A/a0, instruction: INSTRUCTION_EVAL <<=
06-29 07:58:02:985 [ info sync.csync.csync ]:	## Starting remote discovery ##
06-29 07:58:02:985 [ info sync.networkjob ]:	OCC::LsColJob created for "http://localhost/owncloud" + "" "OCC::DiscoverySingleDirectoryJob"
06-29 07:58:02:987 [ info sync.csync.updater ]:	Database entry found, compare: 1530259082 <-> 1530259051, etag: 1644a8c8b26 <-> 1644a8c8750, inode: 0 <-> 1935629, size: 301 <-> 300, perms: ff <-> ff, type: 0 <-> 0, checksum: SHA1:5adcdac9608ae0811247f07f4cf1ab0a2ef99154 <-> SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1, ignore: 0
06-29 07:58:02:987 [ info sync.csync.updater ]:	file: A/a0, instruction: INSTRUCTION_EVAL <<=
06-29 07:58:02:989 [ info sync.csync.csync ]:	Update detection for remote replica took 0.004 seconds walking 13 files
06-29 07:58:02:990 [ info sync.engine ]:	#### Discovery end ####################################################  9 ms
06-29 07:58:02:990 [ info sync.database ]:	Updating file record for path: "A/a0" inode: 1935629 modtime: 1530259082 type: 0 etag: "1644a8c8b26" fileId: "16383ea4" remotePerm: "WDNVCKR" fileSize: 301 checksum: "SHA1:cc9adedebe27a6259efb8d6ed09f4f2eff559ad1"
06-29 07:58:02:990 [ info sync.csync.reconciler ]:	INSTRUCTION_UPDATE_METADATA    client file: A/a0
06-29 07:58:02:990 [ info sync.csync.csync ]:	Reconciliation for local replica took  0 seconds visiting  13  files.
06-29 07:58:02:990 [ info sync.csync.reconciler ]:	INSTRUCTION_UPDATE_METADATA    server dir:  A
06-29 07:58:02:990 [ info sync.csync.csync ]:	Reconciliation for remote replica took  0 seconds visiting  13  files.
06-29 07:58:02:990 [ info sync.engine ]:	#### Reconcile end ####################################################  9 ms
06-29 07:58:02:990 [ info sync.database ]:	Updating local metadata for: "A/a0" 1530259082 302 1935629
FAIL!  : TestChunkingNG::connectionDroppedBeforeEtagRecieved(small file) '!fakeFolder.syncOnce()' returned FALSE. ()
2020-08-13 16:46:08 +02:00
Christian Kamm c74c0d8e6e
Upload: Add more chunk resuming unit tests #6405 2020-08-13 16:45:55 +02:00
Kevin Ottens 866ffc2a6b Enable the modernize-loop-convert check on clang-tidy
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-13 12:55:14 +00:00
Kevin Ottens 0e2af4b502 Enable the modernize-deprecated-headers check on clang-tidy
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-13 14:53:52 +02:00
Kevin Ottens 2f8c29082a Enable the modernize-use-equals-default check on clang-tidy
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-13 14:19:42 +02:00
Kevin Ottens cdf6e7d72b Enable the modernize-user-nullptr check on clang-tidy
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-12 19:45:25 +02:00
Kevin Ottens d58ec4bf70
Enable the modernize-use-using check on clang-tidy
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-12 18:18:57 +02:00
Kevin Ottens 3e79e1861b
We don't really need two \ here
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-12 09:48:33 +02:00
Kevin Ottens ef3c516598
Add support for BASE64 encoded '|' when decrypting
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-10 13:13:19 +02:00
Kevin Ottens 595eb78c8a
Move the private key salt handling in its own function
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-10 13:13:19 +02:00
Kevin Ottens d5339265fb
Ignore the salt part of the key during decryption
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-10 13:13:19 +02:00
Kevin Ottens 54a19945fd
Restore the symmetry between *StringSymmetric functions
If we receive data without base64 encoding for encryption, it makes
sense to get it without base64 encoding out of decryption.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-10 13:13:19 +02:00
Kevin Ottens 26b88131cc
Add unit tests for the encryption helpers
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-10 13:13:19 +02:00
Kevin Ottens 66ede652f8 Use PNGs for branded clients
For branded clients try to load a png of the right size, for unbranded
clients use the SVGs. If something fails at load time skip it.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-28 09:20:34 +00:00
Kevin Ottens 72eba2b93d Move the svg rendering part in a lambda
This simplifies the loop body a bit, opening the door to what's next.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-28 09:20:34 +00:00
Kevin Ottens 73c3aa7898 Extract the svg renderer from the loop
No need to recreate it each time for nothing.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-28 09:20:34 +00:00
Kevin Ottens 16a37c6aa0 Branded clients have more size variety for their icons
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-28 09:20:34 +00:00
Kevin Ottens 983c02b6db Switch to for range loop
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-28 09:20:34 +00:00