Commit Graph

31 Commits

Author SHA1 Message Date
Martin Kleusberg
0da9e1c3e0 dbhub: Don't tolerate host name mismatch errors
These were only accepted for debug purposes and shouldn't occur in an
actual installation.
2017-08-13 13:45:59 +02:00
Martin Kleusberg
17cf3ad7d9 dbhub: Support multiple simultaneous downloads/uploads of databases
This feature isn't explicitly available via the UI (yet) but should
prevent errors when the user is faster than the network connection, e.g.
when opening two directories very quickly.
2017-08-13 13:42:30 +02:00
Martin Kleusberg
09319001ea dbhub: Don't read entire file at once when pushing it to remote server 2017-08-13 13:24:36 +02:00
Martin Kleusberg
3d1f2062f9 dbhub: Also clear access cache when pushing a database as other user 2017-08-12 21:49:32 +02:00
Martin Kleusberg
d5e922f204 dbhub: Fix progress dialog when fetching/pushing db after cancelling 2017-08-12 18:59:59 +02:00
Martin Kleusberg
1c7cc24b15 dbhub: Improve push database UI
This adds a new Push Database dialog which lets you specify the database
name, the licence, a commit message, and the visibility of the database.
2017-08-12 14:58:30 +02:00
Martin Kleusberg
f458ac37bf dbhub: Fix wrong certificate being used
When changing the client certificate we need to clear the authentication
and access cache of our Qt network access manager instance. If we don't
do so, Qt might decide to use the old certificate information which is
still in the cache for some recurring queries.
2017-08-03 20:31:18 +02:00
Martin Kleusberg
e08ebffd63 dbhub: Improve UI for pushing databases
This improves the user experience for pushing database files. Before
this you had to type in the entire URL for pushing, e.g.:
https://db4s-beta.dbhub.io:5550/username/databasename
With this the host name as well as the user name is taken from the
currently active client certificate. So all you have to type in now is
the database name. And for this we make a sensible automatic suggestion
based on the name of the local file you're trying to push.

Note that while this makes pushing databases a lot easier, it still
doesn't implement proper version control or any extra code for handling
conflicts etc.
2017-08-03 19:02:42 +02:00
Martin Kleusberg
d14fb1fbb1 dbhub: Remove remote menu, add push button to remote dock
This commit removes the File -> Remote menu entirely. The only menu item
that was left was the Save to Remote item which is replaces by a button
in the remote dock.

The button is only enabled when a database file is opened and the user
has logged in using a certificate.

Clicking the button opens the same dialog and performs the same actions
as before. The only difference is that we don't use the first client
certificate - no matter which one it is - but instead use the client
certificate that was used for logging in.
2017-08-03 17:35:36 +02:00
Martin Kleusberg
917e33ff95 dbhub: Fix local version control code 2017-08-02 17:43:40 +02:00
Martin Kleusberg
e17fb6f8ca dbhub: Use commit id instead of version number
This changes all the code to use the commit id of a database version
instead of a version number. This means changing the UI, the code for
the communication with dhhub.io, and the internal database for storing
information on downloaded databases.

The last step makes it necessary to delete that database file on your
system, so it will be recreated! Please do that :)
2017-07-28 14:22:10 +02:00
Justin Clift
ec916226b0 Add dodgy temporary workaround for Qt OSX's missing cert verify() 2017-04-06 20:37:31 +01:00
Martin Kleusberg
43a5175af1 dbhub: Keep track of the cloned databases
This adds a local database to keep track of all the cloned databases.
For now we only use this information to prevent exactly the same
database being downloaded twice.
2017-03-23 19:08:26 +01:00
Martin Kleusberg
b5d352bcdc Fix includes 2017-03-20 23:19:57 +01:00
Martin Kleusberg
f1194d845e Rename all the settings accessor functions
Rename the settings accessor functions from Settings::getSettingsValue()
(and similar) to Settings::getValue() (and similar). The 'Settings' bit
seems a bit redundant and costs a lot of screen space.
2017-03-20 23:16:52 +01:00
Martin Kleusberg
e6390b4d22 dbhub: Automatically generate a file name to save a database under
When fetching a remote database automatically generate a file name to
save the database as instead of asking the user for a path and name.

Also add a preferences option to set the directory for all cloned remote
databases.

This is obviously a trade-off: on the one hand this makes opening remote
databases simpler (it's just a double click), on the other hand it takes
control away from the users. The main reason for doing this, however, is
to indicate to the user that the cloned databases are going to be
controlled by DB4S. We have to keep track of the local databases in
order to update them from the right place, push them back to the right
place, etc. And because the local copies are under DB4S control we don't
want the user to move, rename, or delete them.
2017-03-20 23:06:58 +01:00
Martin Kleusberg
1e9fec270b Merge automatic update check into dbhub.io code
Move the network part of the automatic version check code into the
dbhub.io parts. While semantically this doesn't make a lot of sense it
simplifies the code a bit, reduces the size of the main window class,
and avoids duplication of code e.g. when introducing proxy support.
2017-03-19 17:29:20 +01:00
Martin Kleusberg
dec1c6acb1 dbhub: Code refactoring 2017-03-19 16:56:14 +01:00
Martin Kleusberg
7426e2c143 dbhub: Fix progress dialog
Fix progress dialog interfering with the save file dialog.

Fix cancelling of progress dialog. Before this you couldn't download a
file anymore after cancelling a download.
2017-03-18 21:36:09 +01:00
Martin Kleusberg
3e4f3fc3d2 dbhub: Add remote dock with directory browsing support
This adds a new dock to the main window that contains all the remote
functionality (or is supposed to contain it all in the future).

It also adds a directory browsing feature which allows you to browse
through the folders and files on the dbhub server.

By double clicking a database you can download and open it. The Open
Remote menu action isn't needed anymore and has been removed.

This also fixes an issue with pushing databases where, after sending the
file is completed, the save dialog was opened.

Note that this is still WIP and is far from polished.
2017-03-18 20:40:59 +01:00
Justin Clift
c6f1373ba9 Trivial typo fix 2016-11-08 01:21:35 +00:00
Martin Kleusberg
df5e604e6e dbhub: Add support for sending files
NOt perfect yet but a start.
2016-11-07 23:38:51 +01:00
Martin Kleusberg
eeeec5f2fc dbhub: Use certificate manager to get client cert for authentication
When trying to fetch a database don't load a hardcoded client
certificate but grab one from the certificate manager in the preferences
dialog.

Also add support for password protected private keys.

Note: Since this is all testing code on the front-end side, we just use
the first certificate in case multiple certificates are configured.
2016-11-06 14:50:27 +01:00
Martin Kleusberg
60e4cb758e dbhub: Add client certificate management
Add a list of all configured client certificates to the preferences
dialog and show some information on them.

Add two button to the preferences dialog to add and remove client
certificates.

Copy configured client certificates to some safe place where they aren't
deleted by accident.

Change the remote code to expect certificate and private key in one
file. The path to this file is still hardcoded, now to client.cert.pem.

Remove the example client certificate as it's not up-to-date anymore
anyway.

Still missing: Option to use a configured client certificate from the
preferences dialog to authenticate.
2016-11-01 22:54:50 +01:00
Martin Kleusberg
6283f97598 dbhub: Add list of CA certificates and restructure code
Change the layout of the preferences dialog a bit.

Remove the server selection combo box from the preferences dialog as it
will probably never be required. The way we do logins using certificates
kind of makes this obsolete, I think.

Restructure the whole remote code a little bit. Also add helper
functions here and there.

Show a list of our the CA certificates built into the application in the
preferences dialog. This list is read only of course but still
informative as it tells the user which sites are supported ny DB4S.
2016-11-01 19:45:42 +01:00
Martin Kleusberg
19d45bfc54 dbhub: Ignore errors about self signed certificates in a chain
Previously we'd only ignore errors about a single self signed
certificate but apparently it's an entirely different matter to Qt or
OpenSSL if we're talking about a self signed certificate in a
certificate chain.
2016-10-26 23:56:32 +02:00
Martin Kleusberg
ae31dc82b8 dbhub: Support CA certificate chains 2016-10-26 23:07:31 +02:00
Martin Kleusberg
08e7f575ee dbhub: Fix weird progress bar behaviour 2016-10-25 20:54:42 +02:00
Martin Kleusberg
c2a9608c80 dbhub: Add basic HTTPS support
This adds basic support for fetching databases via HTTPS using client
certificates. You can include CA certificates to verify any responses
from a server. For now, one test CA certificate is included but it's
easy to add more.

It's also possible to authentify the client using a client certificate,
a client key and a password. As of this commit all three items are
hardcoded.

It's still possible to access any remote database via HTTP but if a
request URL starts with 'https' this new mechanism will be used.

All certificates, keys, and password included in here are taken from my
node.js test server repository. They will be replaced soon-ish.
2016-10-25 20:42:31 +02:00
Martin Kleusberg
fad7246400 dbhub: Show download progress and allow canceling downloads 2016-10-24 23:56:36 +02:00
Martin Kleusberg
4d26624bda dbhub: Add very basic support for opening remote files
This adds some initial support for opening remote files. You can enter a
URL and DB4S will try to download the file. When successful you'll be
able to specify a place and name to save the file under, and after
saving it locally to disk it'll be opened just like any local database
file.

See the included TODO comments for missing features. Most notably
missing is the HTTPS and certificate handling code. Also any support
for storing the remote source of a database is lacking.
2016-10-24 22:49:32 +02:00