Commit Graph

45 Commits

Author SHA1 Message Date
Martin Kleusberg
ddf5117331 dbhub: Refactor networking code
This splits up the RemoteDatabase class into two classes, RemoteDatabase
and RemoteNetwork. The first is for managing the directory of cloned
databases while the second is for network handling only. Moving the
network code into a separate class requires some rewriting but should
make the code easier to maintain and extend.
2020-07-24 13:30:52 +02:00
Martin Kleusberg
ab5b633709 dbhub: Add context menu action for saving a revision to another file
This adds a new context menu action to the commit list in the Current
Database tab of the Remote dock which downloads the database from that
commit and saves it to another file. This file can then be opened and
inspected just like any other database file and does not update the
local clones data.
2020-07-23 14:08:15 +02:00
Martin Kleusberg
065adabe75 dbhub: Allow checking out different commits and different branches
After opening a clone of a remote database, allow checking out the
different branches and commits of this database in the Current Database
section. This way you access all branches and see their history in DB4S.
2020-07-22 14:21:35 +02:00
Martin Kleusberg
12ba01ffdb dbhub: Add link to webUI page of currently opened database
Add a toolbar to the Current Database tab of the Remote dock with one
button for now. This button opens the web page of the currently opened
database in the browser.

Also reduce the margins in the Remote dock a bit.
2020-07-18 13:28:29 +02:00
Martin Kleusberg
0572b76fd7 dbhub: Simplify code 2020-07-17 21:41:55 +02:00
Martin Kleusberg
dd323faf2a dbhub: Add context menu action to delete local databases
Add a context menu action to the list of locally cloned databases which
allows you to delete the cloned databases.
2020-07-15 15:35:11 +02:00
Martin Kleusberg
062822d3b2 dbhub: More fixes to the branch handling 2020-07-15 12:01:35 +02:00
Martin Kleusberg
c05b92e9f9 dbhub: Highlight current commit in commit list
Highlight the last locally known commit id in the commit list in the
Remote dock. This should make it more obvious whether there are any
newer commits on the server.
2020-07-14 16:25:04 +02:00
Martin Kleusberg
5d89bb8991 dbhub: Show list of commits in Remote dock
When opening a clone of a remote database show a list of all branches,
releases, and tags in the Remote dock and show the commit list when
selecting one of them.
2020-07-13 23:02:17 +02:00
Martin Kleusberg
8428c934a3 dbhub: Show some information on the currently opened database file
If the current database file is a clone of a remote database show some
information on it in the Remote dock. Even though this information is
already nice to have the new tab in the Remote dock is mainly added as a
place for future features. Also switch to the new tab automatically when
opening a remote database to show the user that this is a tracked
database.
2020-07-10 22:16:14 +02:00
Martin Kleusberg
c776af9880 dbhub: Add view of all checked out databases
The Remote dock shows a list of all databases on dbhub.io. Double
clicking a database downloads and opens it. If the database has already
been downloaded before, the local file is simply opened. This only works
for a small number of databases: To open the database you want, you just
search for it and double click it. But for a larger number of databases
on dbhub.io this does not perform very well since finding a database can
be very difficult. Because of this this commit adds a new view which
shows all checked out databases, i.e. those databases which are already
downloaded. Double clicking one of these opens it without trying to
update it first.

In the future this might also provide a place to add extra options like
deleting local copies.
2020-07-10 18:19:43 +02:00
Martin Kleusberg
6c2e38c269 dbhub: Improve support for different branches
This adds initial support for handling of different branches. Before
this we would always assume we were working with the master branch even
if in fact we were not. Now we respect the actual branch name and
support checkouts of different branches of the same database.
2020-07-10 10:52:08 +02:00
Martin Kleusberg
ba1270cedb Clean up the code and make some more minor optimisations
This also includes replacing some more Qt containers by their STL
counterparts.
2019-11-06 20:25:18 +01:00
Martin Kleusberg
16768d5474 dbhub: Respect the order of the licence list and remove "Unspecified"
Respect the suggested order of the licences as provided by the dbhub.io
server instead of sorting them alphabetically by their internal key.

Also remove the hard-coded "Unspecified" licence option because the
dbhub.io server provided its own "No licence specified" option.
2019-05-03 15:28:02 +02:00
Martin Kleusberg
40aff11086 Use even less Qt containers 2019-05-03 15:04:15 +02:00
Martin Kleusberg
d344f396b2 Use Niels Lohmann's JSON library everywhere
We started to use Niels Lohmann's JSON library instead of the one
included in Qt for the Export JSON dialog a while ago because Qt's
implementation showed some problems. To avoid any similar issues and
because Niels' library has a much nicer API, this commit migrates all
our code to his library.
2019-05-02 20:09:24 +02:00
Martin Kleusberg
189652d350 Remove some unnecessary includes 2019-04-29 20:54:26 +02:00
Martin Kleusberg
a75acc01ef Move the automatic update check back into the main window class
See issue #1595.
2019-02-18 17:54:02 +01:00
Martin Kleusberg
abac190e76 Make early network accesses more reliable when using WLAN
The automatic update check is performed early during the application
start. It turns out that, when using a Wifi connection, the Qt
networking code is not ready yet at this point which leads to an
"Network inaccessible" error. This commit delays the automatic update
check until the network configuration is loaded completely.

See issue #1595.
2019-02-17 13:45:10 +01:00
Martin Kleusberg
fb1eba1391 Remove some virtuals and add some overrides
In our case this is more a question of code style.
2018-10-09 20:28:22 +02:00
Iulian Onofrei
961141ec36 Replace deprecated qt5_use_modules function (#1419)
* Replace deprecated qt5_use_modules function

* Fix includes that fall under a larger module

* Bump minimum Cmake version to use newer features and properly use libs

* Replace deprecated qt5_use_modules function and bump minimum CMake version to 3.1.0 for 3rd party libraries
2018-07-10 20:57:55 +02:00
Martin Kleusberg
c692ae0de5 dbhub: When pushing a database, save the new commit id and/or the file
When pushing a local database to the remote server, the new commit id is
returned. Grab that id and insert it into the database of local
checkouts. If there already is an entry for the given file, update that
record. When doing an initial push of a database, also copy the source
database file to our checkout directory to avoid redownloading the file
upon first use.

This should eliminate all unnecessary database downloads, both after
doing the initial push and after committing a modified database.
2017-09-30 16:05:01 +02:00
Martin Kleusberg
f926a67dba dbhub: Add foce push option to push dialog 2017-09-30 14:07:18 +02:00
Martin Kleusberg
fef884a4e1 dbhub: Send last known commit id along with the database when pushing 2017-09-30 12:57:46 +02:00
Martin Kleusberg
08e5f532ce dbhub: Fix branch list in push dialog
The JSON format generated by the server has changed.
2017-09-08 14:49:59 +02:00
Martin Kleusberg
4339119377 dbhub: Support pushing to different branches than "master" 2017-09-03 13:20:27 +02:00
Martin Kleusberg
ab7f0cf4af dbhub: Ask user what to do when trying to open an updated database
If there is a local clone of a remote database but the remote database
has been updated to a newer version in the meantime, we're now asking
the user what to do. The choice is between downloading the newer version
and overwriting the local one with all the changes it might have
contained or opening the local version and not downloading anything.

See issue #1096.
2017-09-01 18:54:55 +02:00
Martin Kleusberg
84615258af dbhub: Push databases using the POST method instead of PUT 2017-08-15 21:22:05 +02:00
Martin Kleusberg
38caf867bc dbhub: Refresh the directory list when a database upload has finished 2017-08-13 14:53:19 +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
3d1f2062f9 dbhub: Also clear access cache when pushing a database as other user 2017-08-12 21:49:32 +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
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
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
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
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
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
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