Commit Graph
233 Commits
Author SHA1 Message Date
Kenneth Skovhede eb34f8a6b8 Revert "Reverted flag to be allow-empty-source so the check is on by default."
This reverts commit 139b4747af.
2025-08-15 11:01:34 +02:00
Kenneth Skovhede ba2ea61ca4 Add option to log HTTP and socket requests
This adds the options `--log-http-requests` and `--log-socket-data` which can be activated to capture diagnostics about HTTP requests and socket operations.
2025-08-08 19:18:30 +02:00
Kenneth Skovhede 139b4747af Reverted flag to be allow-empty-source so the check is on by default. 2025-08-06 08:18:38 +02:00
Kenneth Skovhede 3526b1f117 Added --prevent-empty-source 2025-08-05 15:19:25 +02:00
Marcelo C. 0bc6f990bf Excludes dummy backend from command check
Avoids unnecessary backend command checks for the dummy backend url which was manifesting into issue #6442
2025-07-31 17:29:57 -03:00
Kenneth Skovhede 6d63f86610 Avoid stack traces for missing sources 2025-07-10 18:01:44 +02:00
Carl Johnsen f6ac30e831 Merge remote-tracking branch 'upstream/master' into performance/mssqlite-async 2025-06-19 12:17:30 +02:00
Carl Johnsen 2412800c0c Removed the sqlite page cache option. It should be set through the environment variable, or some other way of providing a custom database configurotion 2025-06-19 11:41:39 +02:00
Carl Johnsen 31c5441bdb Forwarded cancellation tokens, added some missing .ConfigureAwait() and added some missing docstrings 2025-06-19 11:04:09 +02:00
Carl Johnsen 9ac583db94 Made all relevant using statements use await to use DisposeAsync 2025-06-18 11:53:11 +02:00
Carl Johnsen 859b65054d Simplified using statements that uses databases or accesses their methods 2025-06-18 11:52:05 +02:00
Kenneth SkovhedeandGitHub 15eb009594 Merge pull request #6343 from duplicati/feature/fix-module-loading
Handle loading and unloading of modules
2025-06-13 10:47:26 +02:00
Kenneth Skovhede f6094baddb Handle loading and unloading of modules
This PR fixes the issues with not correctly loading and disposing modules.

Prior to this PR, there would be only a single instance of each module loaded, which would be configured and later disposed, meaning that the same instance would be used after being disposed, and disposed multiple times.

This mostly worked, but it could carry configuration details over between unrelated runs.

This fixes #6314
2025-06-12 22:13:55 +02:00
Kenneth Skovhede 8c0e5e579d Ensure booleans are false by default
This PR changes `--replace-faulty-index-files` to `--dont-replace-faulty-index-files`, and swaps the default value.

This PR also adds a check that triggers a warning if any boolean values are introduced with a default value that is `true`.
2025-06-12 10:34:57 +02:00
Carl Johnsen 3d11a05400 Added .ConfigureAwait(false) to all of the await statements 2025-06-12 08:34:29 +02:00
Carl Johnsen bd493638af Merge branch 'master' into performance/mssqlite-async 2025-06-02 10:39:33 +02:00
Kenneth SkovhedeandGitHub 0207ad1516 Merge pull request #6299 from duplicati/feature/correct-transfer-progress-api
Websocket subscriptions
2025-05-28 21:40:21 +02:00
Kenneth Skovhede 02439a1f3a Give a custom error message if the backend is not supported.
This fixes #1920
2025-05-28 12:58:30 +02:00
Kenneth Skovhede fb08a0b174 Fixed an issue with retry downloads causing errors 2025-05-28 12:49:29 +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 a37f0dda31 Merge branch 'master' into performance/mssqlite-async 2025-05-22 14:09:17 +02:00
Carl Johnsen 8999dc4baa Updated Controller to use the new async database methods 2025-05-22 08:18:10 +02:00
Carl Johnsen 3e19db371d Removed whitespace 2025-05-22 08:17:53 +02:00
Kenneth SkovhedeandGitHub 697a0b62d0 Merge pull request #6271 from duplicati/feature/issue6200
Flush messages after backup stop
2025-05-20 17:00:07 +02:00
Kenneth Skovhede ef631a1199 Added feature to suppress warnings
This PR adds the option to suppress warnings by their log id. Warning IDs that are supplied to `--suppress-warnings` will be converted to information messages before being logged.

If a specific warning is disabled, such as `CompressionReadErrorFallback`, this will then no longer count as a warning for the job, and the log file will see the warning as an information message.

This PR also adds two simpler filter options that makes it possible to filter log messages by supplying the log IDs. This can already be achieved with log filters, but the ID filter is a bit simpler to apply, as you only need to know the ID.

Finally, this PR also adds common logging for errors in the categories:
- Permission denied, id = `PermissionDenied`
- File locked, id = `FileLocked`
- Path not found, id = `PathNotFound`
- Path too long, id = `PathTooLong`

These new log ids makes it simpler to ignore warnings about locked or inaccesible files.
2025-05-20 14:26:10 +02:00
Kenneth Skovhede 04c7ec5287 Flush messages after backup stop
This change now flushes all pending messages from the backendmanager to the database, even if the main operation crashes (or is stopped).

This ensures that the database and remote storage are more in sync.

Also removed a redundant warning from the backendmanager during shutdown, and simplified a check for active operations.

This fixes #6200
2025-05-20 09:23:29 +02:00
Kenneth Skovhede 6af08d90bb Simplified log setup 2025-05-02 14:45:01 +02:00
Kenneth Skovhede a3bc9b80ca Implemented 4 new list methods that are optimized for a single operation 2025-04-29 10:03:57 +02:00
Kenneth SkovhedeandGitHub af9465d8e3 Merge pull request #6187 from duplicati/feature/fix-throttle-speeds
Fixed throttle support
2025-04-25 15:36:44 +02:00
Kenneth Skovhede f393c00030 Fixed throttle support
This moves the throttle support to the StreamUtil throttled stream, which allows multiple streams to share a throttle value, such that the throttle setting is applied to the entire communication from Duplicati, and not for each connection.

This also cleans up a bit in the progress reporting, where the backend manager now keeps track of the "active" transfer and only emits progress on that. Once it finishes, a new transfer is promoted a "active".
2025-04-22 22:54:48 +02:00
Kenneth Skovhede 0a7a1cd689 Added option to set the SQLite page cache
This adds an extra option to allow setting the SQLite page cache size as a regular option.

Prior to this commit it was only possible to set the SQLite page cache size via environment variables.

The option to use environment variables is preserved, and as options from the environment variable are applied after the new setting, environment variables take precedence.

The default value for the new option is to use 1% of the system memory for the page cache. For the restore process, a connection per worker may be made which defaults to half the number of cores, so the maximum amount of memory is 1% * half the CPU cores.

This is just the upper limit, and SQLite may choose not to use all of it.

This fixes #6178
2025-04-22 14:26:46 +02:00
Kenneth Skovhede 1a38df7709 Cleaned up some callbacks to not use events with async methods.
Implemented argument validation for the TrayIcon and server startup.
2025-03-25 11:14:03 +01:00
Kenneth Skovhede 7f008341df Untangle the results and database
The code was using a two-way reference linking the database to the results and the results to the database.

However, this was not really used so it ended up just cluttering the code. With this commit, the results and databases are no longer keeping track of each other, and the only interaction is when the results are written to the database at the end of the operation.

To ensure result data is always written, this code has been moved into the controller, which will now flush the results for all operations. Prior to this, only some operations would write result data to the log.

The controller now also handles logic for cleaning old log data and invoking the vacuum command.

Fixed a bug due to using System.Text.Json where some attributes from NewtonSoft.Json were being applied and not picked up.
2025-03-20 09:51:49 +01:00
Kenneth Skovhede 6c7843b332 Unified options
This PR adds a unified way of supplying timeouts to each of the backends.

It also adds an opt-in way of adding commonly used options, so parsing and usage can be standardized across multiple backends.
2025-03-19 15:27:02 +01:00
Kenneth Skovhede c1bdaa069e Async operation handlers
Rewrote all operation handlers to be async.
This moves the async/sync threshold out into the controller.

Fixed all the uses of cancellation token in the handlers to use the provided cancellation token.

Introduced a new ReusableTransaction that can be passed around, avoiding a ref parameter passing of the transaction instance.
2025-03-14 10:41:14 +01:00
Kenneth Skovhede 30ec975469 Relaxed size requirement to better work with tests 2025-03-13 13:34:55 +01:00
Kenneth Skovhede 5edfcc5c6a Prevent blocksize near remote volume size
If the user selects the blocksize to be the same as the remote volume size, this will cause each block to be in a separate volume and will trigger repeated compact calls.

This commit adds a check that ensures the volume size is large enough to hold at least two blocks.

Also fixed an issue where the compact could create volumes larger than the set limit (at most one block larger).
2025-03-13 12:09:57 +01:00
Kenneth Skovhede fce09596f3 Removed unused parameter and redundant namespace prefixes 2025-03-08 15:18:19 +01:00
Kenneth Skovhede 4e60a7ad49 Merge remote-tracking branch 'origin/master' into feature/improved-failure-resilience 2025-03-06 12:09:42 +01:00
Kenneth Skovhede 1428d8cc6f Preserve order of input sources 2025-02-24 12:53:48 +01:00
Kenneth Skovhede 9dfe977d3f Changed logic so the source providers are now logically mounted into the source directory structure.
This fixes the restore issues as all sources will now appear as if they were originally part of the source file system.

The backend implementation has now been simplified so the backends only return names of entries with no path information.  Most backends already do this, but the S3 backends did not, so this was fixed as well.

This also clears up the interfaces, so the backend does not know about the `ISourceProviderEntry`. All mapping is done by the `BackendSourceProvider`, making it simpler to support other backends as sources.
2025-02-21 16:06:55 +01:00
Kenneth Skovhede 1716d09b51 Fixed source providers for S3, CIFS, and SSH.
Made the SMBShareConnection slightly more robust.

Introduced v2 List API to S3 backend, currently it retains v1 as the default.

Changed S3 backends to not recurse, potentially making smaller listings. This option can be disabled if it breaks things.

Added support for relative paths in the SSH backend.
2025-02-21 13:20:52 +01:00
Kenneth Skovhede 3e72768eec Added warning when using the Mega backend 2025-02-06 21:53:51 +01:00
Kenneth Skovhede fac12ba772 Further consolidated the data folder.
Added support for `--portable-mode` and `--server-datafolder` for the CLI, ServerUtil, and Agent.

Fixed a few places where file reads were not cached properly.

Moved some responsibilities of UpdaterManager into DataFolderManager.

This now supports storing `machineid.txt` and `installation.txt` inside the path pointed to by `--server-datafolder` or alternatively with `--portable-mode`.

It is possible that some fringe backwards compatibility is lost with this update.

Fixed an issue with AutoUpdater crashing on check/download.

This fixes #5902
2025-01-28 13:01:35 +01:00
Kenneth SkovhedeandGitHub 039e1a08fb Merge branch 'master' into feature/prevent-windows-subfolder-storage 2025-01-28 08:58:26 +01:00
Kenneth SkovhedeandGitHub d99f74ed94 Rewrite the backend manager. (#5896)
* Rewrite the backend manager.

This creates a new more logic backend manager that handles all backend operations.

For each top-level operation, there is now a single backend manager instance that is passed to sub-commands.

The internals of the backend manager are now rewritten to use async logic instead of threading.

The design uses a single task runner that dispatches operations and honors concurrent settings and limits from one place.

The logic for each operation has been moved into a separate files/classes to make it easier to understand each operation.

This fixes #5804

* Fixed a few issues with not awaiting tasks

* Fixed not creating empty databases

* Fixed an issue with hashes not being recorded on download

* Reworked the download logic to avoid attempting to decrypt the file if it has been modified.

* Review fixes

* Renamed db collector to better reflect the purpose.

* Review fixes
2025-01-28 08:54:50 +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 97d62163c5 Renamed methods for database path to better distinguish what they do 2025-01-27 11:46:24 +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