Commit Graph
49 Commits
Author SHA1 Message Date
Kenneth Skovhede e3f1aefec2 Implemented a nonce for refresh tokens
This adds a nonce to the refresh token such that each request to obtain a refresh token must now also provide a matching nonce.

When using non-persisted logins, the request to the server is the same, but the "remember me" flag toggles a shorter duration for the refresh token.

The FE can then store the nonce in either local storage for persisted logins or in session storage for non-persisted logins.

The default is currently to always issue refresh tokens with a nonce, but this can be toggled with the JWT configuration.

The ngax client does not have the non-persisted login so it stores the nonce in local storage, using a name that is compatible with ngclient so the user can swap between them without needing to re-login.

The server util was updated to also store the nonce.

This fixes #6451
2025-08-07 23:10:54 +02:00
Carl Johnsen bd493638af Merge branch 'master' into performance/mssqlite-async 2025-06-02 10:39:33 +02:00
Kenneth Skovhede 55d821add1 Added support for disabling API extensions from the commandline
Also added extension that signals if websocket is supported.

Also removed the option to disable visual captcha as it is no longer used.
2025-05-28 12:47:42 +02:00
Kenneth Skovhede c8b9fb5c73 Websocket subscriptions
This PR adds the ability to subscribe to messages over a websocket.

To prevent polling data, the server can now push messages through the websocket, so the client can instantly update when new data is available.

The change is backwards compatible, still serving the status updates over the socket. If the client is providing the authentication token, it is auto-subscried to the legacy status message.

If the client is using the new authentication message, it needs to subscribe to get the status updates (and any other services it needs).

The event system has been extended to support new, and more accurate, events. This is the first step towards removing the general status update and the long-poll mechanism.

This also re-introduces the blocking marker, so the client can know if the operation is halted due to too many pending transfers.

Some endpoints have been moved to service implementations, to allow serving the exact same data from both endpoints and websocket.

This PR also updates the way the progress is handled, so that all transfers are returned to the client, and the transfer speeds for each transfer is calculated based on a small sample buffer, so the values are more accurate even if the program is paused during transfers.
2025-05-27 12:13:07 +02:00
Carl Johnsen ee40767412 Merge branch 'master' into performance/mssqlite-async 2025-05-27 12:04:50 +02:00
Carl Johnsen a4e608d7c4 Updated transaction propagation logic, as all commands must have a transaction 2025-05-27 06:23:49 +02:00
Kenneth Skovhede 9723b78279 Fixed nullability issues 2025-05-24 13:54:59 +02:00
Kenneth Skovhede d34b20d38a Remove Sia backend
The Sia backend implementation is based on the previous version of Sia and will no longer work after the hard fork later this year.
2025-05-22 15:28:59 +02:00
Carl Johnsen b399adf534 BeginTransactionSafe() was a legacy helper method that called BeginTransaction() directly 2025-05-22 13:27:36 +02:00
Carl Johnsen 37039f467e Removed whitespace 2025-05-22 13:26:55 +02:00
Kenneth Skovhede 5630c5e34a Fixed default config no longer loading 2025-05-12 15:11:46 +02:00
Kenneth Skovhede c9f985ecdd Final removal of FIXMEGlobal 2025-05-05 16:13:46 +02:00
Kenneth Skovhede 072f89c747 Remove WorkerThread class
This removes the WorkerThread class and many of the complications around it.

Instead of having a generic worker, there is now the `QueueRunnerService` which takes on all the resposibilities for handling queued tasks.

This is one step towards removing `FIXMEGlobal`
2025-05-03 15:01:09 +02:00
Kenneth Skovhede 385581a16c Fixed minor issue with clearing metadata 2025-04-25 17:32:52 +02:00
Kenneth Skovhede ba298df915 Added an upgrade command to the database tool 2025-04-25 12:30:03 +02:00
Kenneth Skovhede a0ecc5e05d Added a database downgrade tool 2025-04-24 16:36:14 +02:00
Kenneth Skovhede c3c9105d26 Fixed an issue where schedules would be invisible in the UI but still work. 2025-04-17 18:03:14 +02:00
Kenneth Skovhede faede65d8d Changed transactions to use a wrapper that ensures a transaction is allocated. 2025-04-14 12:04:00 +02:00
Kenneth Skovhede 8703f2c014 Fixed a bug with settings after sql queries were updated 2025-04-03 17:05:13 +02:00
Kenneth Skovhede 0b735d79ff More cleanup and a few bug fixes 2025-04-03 16:38:51 +02:00
Kenneth Skovhede 451c8168fc Added Connection 2025-04-03 13:59:07 +02:00
Kenneth Skovhede 2b06faaf4f Added simple sorting support to backend 2025-03-26 15:58:06 +01:00
Kenneth Skovhede b754caccc3 Added metadata to reports to report current update channel 2025-03-25 12:34:54 +01:00
Kenneth Skovhede cbb639651a Added support for handling control messages.
This enables automatic reporting setup via remote management.
2025-03-03 17:39:25 +01:00
Kenneth Skovhede 27f0bb4ea0 Unified code to find the data folder.
The `machineid.txt` and `installation.txt` files are now default located in same folder where the database is default located.
2025-01-27 22:51:45 +01:00
Kenneth Skovhede bee1f141ea Added UI warning for unencrypted database 2025-01-27 08:52:06 +01:00
Kenneth SkovhedeandGitHub 6bbd64a655 Fixed nullability warnings in Utility.cs (#5861)
* Fixed nullability warnings in `Utility.cs`

* Fixed a number of nullability issues and warnings

* More nullable fixes

* Fixed the overwrite issue

* Fixed additional nullability issues

* Removed additional nullability issues

* More nullability fixes and added some xmldoc

* Added more xmldocs and removed an unused argument

* Removed more warnings
2025-01-14 14:03:48 +01:00
Kenneth SkovhedeandGitHub 9464caf622 Feature/update license 2025 (#5851)
* Fixed some minor whitespace issues

* Updated all copyright to 2025
2025-01-07 09:40:39 +01:00
Kenneth SkovhedeandGitHub ff1b2b7990 Simplified task control (#5753)
* Simplified task control by having all logic in a single class and using async control mechanism
* Fixed the tests
* Made the marking of a backup partial explicitly communicated if the enumeration process is stopped.
* Added support for pausing active transfers
* Introduced transfer token to abort operations.
* Updated the way LiveControl is emitting events.
* Retains the paused state of the server across reboots, this fixes #5760.
* Reworked the way throttle speeds are propagated through LiveControls.
* Added option to pause transfers in the UI.
* Removed throttle settings from the LiveControls class so it is exclusively handled by the ApplicationSettings.
* Removed `thread-priority` as it does not work at all when tasks are used.
* Fixed the stop dialog and API to only support stop and abort.
* Removed unused variables
2024-12-18 08:27:59 +01:00
Kenneth Skovhede c9665da91b Reworked the tokens to only support emitting a single token per server startup 2024-12-12 11:05:09 +01:00
Kenneth Skovhede 7d4f9ffab3 Implemented a forever-token feature 2024-12-12 08:59:59 +01:00
Kenneth SkovhedeandGitHub 58a5fc57f4 Implemented support for emitting intermediate certificates from pfx (#5739)
* Implemented support for emitting intermediate certificates from pfx files

* Added certificate check to crash earlier

* Fixed loading certificate on Windows
2024-12-05 10:34:10 +01:00
Kenneth Skovhede 42c4e50482 Fixed issues with update detection.
This fixes a case where the update checker keeps an old reference to the previous updated version, despite running a newer version.

It also removes some use of `Assembly.GetExecutingAssembly().GetName().Version` with the information from `UpdaterManager.SelfVersion.Version` as that should follow the update info.

This fixes #5698
This fixes #5252
2024-11-25 17:27:50 +01:00
Kenneth Skovhede 0a5baa127c Merge remote-tracking branch 'origin/master' into feature/fix-dst-changing-scheduled-time 2024-11-25 13:05:28 +01:00
Kenneth Skovhede 74bb22e022 Implemented support for keeping time-of-day stable across daylight savings time changes.
This fixes #1364
2024-11-05 21:26:30 +01:00
Kenneth Skovhede c99e819d70 Merge remote-tracking branch 'origin/master' into feature/add-secret-provider 2024-11-01 08:49:52 +01:00
Kenneth Skovhede aca02f0801 Fixed upgrade path with insecure passwords 2024-10-30 10:39:48 +01:00
Kenneth Skovhede 18c531205a Also clear password when clearing certificate 2024-10-29 14:08:11 +01:00
Kenneth Skovhede 56816abed8 Reverted to not storing the certificate as a file, since the x509Certificate loader was the broken part, not Kestrel. 2024-10-29 13:55:12 +01:00
Kenneth Skovhede e914794b30 Simplified running TrayIcon with self-signed certificate.
Added workaround method to avoid loading certificate directly as that crashes .NET with EC-based keys.
2024-10-29 13:28:44 +01:00
Kenneth Skovhede ed4d8bc6a6 Encapsulated the updating of the SSL certificate into a single method, to prevent wrong updates. 2024-10-29 12:02:42 +01:00
Kenneth Skovhede 4783050d53 Simplified logic by having an option to disable https.
Simplified checks for https by having a single property that unifies the logic.
2024-10-29 11:15:06 +01:00
Kenneth Skovhede f9154137a3 Merge remote-tracking branch 'origin/master' into feature/ex-certificates 2024-10-29 09:24:53 +01:00
Kenneth Skovhede 34d13a20e2 Initial version of the external secret provider 2024-10-24 16:06:59 +02:00
Kenneth Skovhede 227b8d6dca Added feature to keep the remote control setting, and reconnect on startup.
Updated message types to fit the procotol.
2024-09-27 16:14:40 +02:00
Kenneth Skovhede 669e90704d Initial work on supporting a secure remote control connection. 2024-09-18 11:07:59 +02:00
Max 1bb03a5673 upstream sync 2024-09-11 21:31:04 +02:00
Kenneth Skovhede 3548475360 Implemented preload support.
This commit adds the option to provide preload/preset options that change the default values for Duplicati's commandline or environment variables.
This fixes #5480
2024-08-28 00:18:55 +02:00
Kenneth Skovhede d1008bc7a2 Fix the Duplicati.Library.RestAPI path.
It was previously located in the root, but placed correctly in the solution file.
2024-08-27 08:30:26 +02:00