This means adjusting PropagateDownloadEncrypted so that it knows where
the file will end (otherwise it would create temporary files in non
existant paths for instance).
In turn we have to adjust PropagateDownloadFile accordingly so that it
resolves the local folder the file will end up in.
And last we adjust PropagateLocalMkdir to resolve paths as well and
demangle as needed.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
We give them a parent to make sure they will be destroyed when the jobs
which created them are destroyed themselves.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
PropagateUploadEncrypted made the assumption of the folder names never
being mangled. This is not true since the previous commits so make sure
we properly deal with that using the journal db.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This is not only a question of performances in our case (complexity
being better on look ups). It also provides a few more services.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
We ensure the PROPFIND Depth is infinity by explicitly specifying the
header (turns out our implementation just doesn't assume infinity
otherwise). This way we have a clear picture about *all* the folders of
the user, otherwise ClientSideEncryption couldn't be a trustable oracle
on the encryption state for any folder not on the root and all the
encryption code assumes it has a full picture of encryption.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
We catch when a directory is inside a known encrypted folder and in such
a case we now do the following:
1) we encrypt the folder meta data (its name) properly and create it
under that mangled name on the server side
2) we mark the new folder itself as encrypted
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
It was assuming we'd encrypt only files but directory names also need to
be encrypted. We just skip the writing to temp file part in that case.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This way this whole logic isn't stuck into the settings dialog anymore.
Also cleaned up the unused "decrypt folder" logic.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This is a much better place than the GUI, this way we ensure the
propagator is always operating of up to date information. Previously if
the propagator kicked in without user interaction from startup (not
showing the settings dialog) it would have no E2E information available
whatsoever... unsurprisingly it would thus take wrong information at
every turn.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
Since we want to move to a place where the encryption of subfolders is
always enforced it makes no sense to leave it in control of the user.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
Using a reference capture is a disaster waiting to happen here, if for
some reason we'd move from exec() to popup() for the menu below we'd be
getting garbage in the lambda call.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
The Qml position setting code is moved to C++, which allowed to get rid
of the currentScreenIndex() method (which seemed to be just a detour to
pass the screen from C++ to Qml).
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Commit 07bede8 (PR #1892) introduced a new helper method currentUser()
that didn't check for _users.count() thus causing to throw an
"index out of range" exception when no accounts are configured.
This commit uses the opportunity to add more sanity checks to UserModel.
Signed-off-by: Michael Schuster <michael@schuster.ms>
Commit a12205f322 (PR #1891) introduced
a circular ownership: qmlRegisterSingletonType<Systray>(...) makes the
QQmlEngine own the resulting singleton Systray instance, however, the
QQmlEngine _trayEngine itself is owned by the Systray instance. This
circular ownership results in a crash when the destructor of Systray
calls the destructor of _trayEngine which attempts to call the destructor
of Systray.
This commit solves this problem by making ownCloudGui, which is the
parent of Systray, the parent of the _trayEngine.
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Discovered on Windows in conjunction with PAC scripts:
- Already configured accounts worked
- Fresh client account setup did not work
Reason:
- Proxy was reset over and over again in Account::setCredentials
Signed-off-by: Michael Schuster <michael@schuster.ms>
In case the default color value will ever change, this
commit makes sure that the colors of the menu border and
the menu separator coincide.
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
The lightgray menu border color #ededed introduced in
commit f147e5a66f (by PR #2095)
is way too light for my display (and probably others).
Thus the menus have no clear border which looks odd and broken.
This commit simply darkens the menu border to #bdbdbd, which
coincides with the (current default) color of the menu separator.
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>