Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support opening remote databases #10896

Conversation

t-h-e
Copy link
Contributor

@t-h-e t-h-e commented Jun 14, 2024

Follow up to #7222

Adding an option to import a remote database. Import the data to a new database, existing database or a temporary database (see option "Temporary Database" in section "Import Into")

Screenshots

327211408-1d46de32-1ed9-43e8-b47c-4b3f1fc8dcd3

Testing strategy

Similar to syncing with a remote database, specify a download command and if necessary input to download the remote database.

Also added a unit test.

Type of change

  • ✅ New feature (change that adds functionality)

@droidmonkey droidmonkey added this to the v2.8.0 milestone Jun 16, 2024
@t-h-e t-h-e force-pushed the feature/remote-database-support-open-remote branch from ea3edd2 to 2bc6afd Compare June 17, 2024 11:40
@t-h-e
Copy link
Contributor Author

t-h-e commented Jun 17, 2024

I'm not sure why this test fails in the CI on Ubuntu

11:46:32   FAIL!  : TestGui::testOpenRemoteDatabase() 'QApplication::activeWindow()->findChildren<QTableWidget*>().count() > 0' returned FALSE. ()
11:46:32      Loc: [/opt/buildagent/work/c401303cba1b4098/tests/gui/TestGui.cpp(512)]
11:46:32   FAIL!  : TestGui::testOpenRemoteDatabase() 'action->isEnabled()' returned FALSE. ()
11:46:32      Loc: [/opt/buildagent/work/c401303cba1b4098/tests/gui/TestGui.cpp(2307)]

Windows and Mac seem fine. Also tested locally in Windows and Manjaro and there, this test works as well...

@droidmonkey
Copy link
Member

Could be a modal dialog open on Linux? Like a question or notice dialog.

@Hidigoudi
Copy link

It would be nice to add the WebDav protocol inside this new feature. Instead of using a NextCloud client sync for example, the database would be accessible only from the server with an authentication. It would add a great feature for companies that want manage employees databases in a central server.

@droidmonkey
Copy link
Member

droidmonkey commented Jun 22, 2024

@Hidigoudi WebDav can be setup in all major OS's natively as a mounted drive. You can use a third-party WebDav utility with the Remote Sync feature if you like.

@Maasea
Copy link

Maasea commented Aug 28, 2024

@Hidigoudi You can use the curl command to download and upload 'kdbx' files on Webdav server.

  1. You may create a download action:
Name: Download
Command: curl -u username:password -o {TEMP_DATABASE} https://you_webdav.com/path/xxxxx.kdbx

Input: exit

  1. You also need an upload action:
Name: Upload
Command: curl -u username:password -T {TEMP_DATABASE} https://you_webdav.com/path/xxxxx.kdbx

Input: exit

As far as I know, Windows 10/11 has a built-in curl command.

Don't forget to change the username, password and the webdav server.

@t-h-e
Copy link
Contributor Author

t-h-e commented Aug 28, 2024

@Maasea you can leave Input: blank as curl will exit on its own.

@tburny
Copy link

tburny commented Sep 27, 2024

In am eagerly waiting for this for months now. Is there anything where we can help?

@droidmonkey droidmonkey self-requested a review September 27, 2024 23:42
@droidmonkey droidmonkey force-pushed the feature/remote-database-support-open-remote branch from 5b65092 to f4f4e8a Compare September 28, 2024 02:59
@droidmonkey
Copy link
Member

This is great, fixed a regression with importing into an existing database. Couple things that could be done in future improvements to the code base:

  1. We should be able to unlock the temporary database file using a proper DatabaseUnlockDialog... but the code right now makes a lot of assumptions that prohibit that. This would enable use of hardware keys.
  2. We should write the download sync configuration to the database custom data. Then the user can re-download the database without having to type in the same configuration.

You may be able to implement the second suggestion, but not sure if that would be merged properly in DatabaseTabWidget

@t-h-e
Copy link
Contributor Author

t-h-e commented Oct 2, 2024

Failing tests seem unrelated to my changes

@droidmonkey droidmonkey merged commit d2da13d into keepassxreboot:develop Oct 7, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants