Support remote database access using external tools (#7222)

* Provide remote database sync capability

Allow arbitrary commands to be defined and executed for syncing databases with remote services. This includes sftp, scp, rsync, etc. 

Remote commands are stored per-database and sync operations are manually triggered by the user from the Database -> Remote Sync menu. 

---------

Co-authored-by: Stefan Forstenlechner <t-h-e@users.noreply.github.com>
Co-authored-by: Jonathan White <support@dmapps.us>
This commit is contained in:
sforst 2024-06-13 12:23:41 +02:00 committed by GitHub
parent ad8a00d56b
commit 1ca607792d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 1780 additions and 21 deletions

View file

@ -1672,6 +1672,10 @@ Are you sure you want to continue with this file?.</source>
<source>Maintenance</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Remote Sync</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DatabaseSettingsWidgetBrowser</name>
@ -2241,6 +2245,121 @@ removed from the database.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DatabaseSettingsWidgetRemote</name>
<message>
<source>Sync Commands</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Remove</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Command Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Save</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Download</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Command:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Download command field</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>e.g.: &quot;sftp user@hostname&quot; or &quot;scp user@hostname:DatabaseOnRemote.kdbx {TEMP_DATABASE}&quot;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Input:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Download input field</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>e.g.:
get DatabaseOnRemote.kdbx {TEMP_DATABASE}
exit
---
{TEMP_DATABASE} is used as placeholder to store the database in a temporary location
The command has to exit. In case of `sftp` as last commend `exit` has to be sent
</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Upload</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Upload command field</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>e.g.: &quot;sftp user@hostname&quot; or &quot;scp {TEMP_DATABASE} user@hostname:DatabaseOnRemote.kdbx&quot;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Upload input field</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>e.g.:
put {TEMP_DATABASE} DatabaseOnRemote.kdbx
exit
---
{TEMP_DATABASE} is used as placeholder to store the database in a temporary location
The command has to exit. In case of `sftp` as last commend `exit` has to be sent
</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Name cannot be empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Test</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Download command cannot be empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Download failed with error: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Download finished, but file %1 could not be found.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Download successful.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Save Remote Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>You have unsaved changes. Do you want to save them?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DatabaseTabWidget</name>
<message>
@ -2313,6 +2432,11 @@ This is definitely a bug, please report it to the developers.</source>
<comment>Database tab name modifier</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 [Temporary]</source>
<comment>Database tab name modifier</comment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DatabaseWidget</name>
@ -2505,6 +2629,34 @@ Disable safe saves and try again?</source>
<comment>Database tab name modifier</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Remote Sync did not contain any download or upload commands.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Remote sync &apos;%1&apos; completed successfully!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Remote sync &apos;%1&apos; failed: %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Error while saving database %1: %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Downloading...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Uploading...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Syncing...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Remove passkey from entry</source>
<translation type="unfinished"></translation>
@ -5879,10 +6031,18 @@ We recommend you use the AppImage available on our downloads page.</source>
<source>Toggle Allow Screen Capture</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Remote S&amp;ync</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Remove Passkey From Entry</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Setup Remote Sync</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ManageDatabase</name>
@ -8753,6 +8913,37 @@ This option is deprecated, use --set-key-file instead.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RemoteHandler</name>
<message>
<source>Command `%1` did not finish in time. Process was killed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to upload merged database. Command `%1` did not finish in time. Process was killed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Invalid download parameters provided.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Command `%1` failed to download database.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Invalid database pointer or upload parameters provided.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Command `%1` exited with status code: %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to upload merged database. Command `%1` exited with status code: %2</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ReportsWidgetBrowserStatistics</name>
<message>