A backup can have two notions of its local database path: the stored
Backup.DBPath field and a --dbpath advanced option in its settings. The runner
computes an effective path that lets --dbpath override Backup.DBPath, so most
operations honor it. But the "Show log", "Show remote log" and "Delete database"
endpoints read Backup.DBPath directly, so when --dbpath differs they open/delete
the wrong database - "Show log" then fails with "no such table: LogData".
Add a shared Runner.GetEffectiveDBPath(IBackup) helper (same precedence as
Runner.ApplyOptions) and use it in ExecuteGetLog, ExecuteGetRemotelog and
ExecuteDeleteDb so all operations agree on the database file. Adds a unit test
for the precedence.
The database move/update endpoints are intentionally left unchanged, as they
manage the DBPath field itself.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This PR adds new endpoints to support the removal of versions and the purge-broken-files flow.
Prior to this PR a UI-user had to resort to the commandline UI and figure out how to configure the commandline tool to perform the operations.
With this update, the user can now pick "Delete versions" and will be presented with a list of versions. Any versions that are checked will then be deleted.
For the purge-broken-files, this will first run "list-broken-files" and present any broken files to the user, and then allow the user to proceed with purging the broken files.
This refactors a part of the database and adds a new "sync" command that reuses a lot of the backup logic to take a set of sources and apply them to a backend.
Unlike the backup process, the sync copies files verbatim without any encryption.
The SelfOnly mode was removed as was the "removeAdditionalSources" logic. Instead, the new SelfLimited mode always removes sensitive information, such that by default we do not store any sensitive information, not even with encryption enabled.
This is required to avoid accidentially leaking secrets found in remote sources, or the target url, in case the leak happens somewhere else than on the remote destination.
Additionally, this resolves an issue where remote source information could leak via the DisplayNames property.
To reduce logic bugs a separate ResolvedTaskConfigMode extracts the 3 different dimensions of the selection, and a test is added to ensure it behaves as expected.
When performing searches on some remote source, like MS365, the actual file paths are not meaningfull to the user. Instead, the UI will display metadata that makes it easier to navigate.
This PR updates the search feature to optionally look in metadata and find matches there as well, making it simpler to work with such data.
This PR revives the `store-task-config` option that was never shown in the user interface and extends the feature to allow more flexibility in exporting the configurations.
The `Auto` setting is now on by default. For encrypted backups, this will store the backup configuration of the current backup with the backup for easy restore of a configuration.
For unencrypted backups, nothing will be stored by default.
To manually pick the what backup configurations are stored, the following options are also available:
- None: no configuration is stored
- Self: The configuration of the current backup is stored
- All: The configurations of all backups are stored
If the backup is not encrypted, the data is stored without any secrets (encryption keys, passphrases, passwords, api-keys, etc).
To override this, the following two options are also present:
- SelfWithForcedSecrets
- AllWithForcedSecrets
Using one of these when encryption is enabled has no additional effects, but for unecrypted backups this will include all secrets in the backups in plain-text.
This fixes#6256
This fixes#3073
This PR fixes a bug that caused backup searching to be case-sensitive.
The PR also exposes the case sensitive-flag in the API endpoint so the UI can toggle case-sensitive searching.
This PR adds experimental support for running the backup in an isolated process.
The motivation for this is to protect the server from a faulty process and later enable running server and processing with different security levels.
This needs to be toggled on, and then it will run the process isolated. When running as an isolated process, the "Abort" call will kill the process so it can no longer become "stuck".
This PR has a large blast radius because it takes the final step and bumps up the Controller to be fully async.
We have historically done a piece-by-piece update, so all operations were already async but the controller interface was kept synchronous.
With this update, the controller is now fully async and all tests are updated.
Most places where the new C# compiler warns about function names not ending in `Async` were also adressed, giving a massive refactor change.
Functionally, no changes are done.
This PR extends the search API to allow versions to be added so searching can be limited to specific versions.
Before this PR, only time was supported, but this is picking versions older than the timestamp as well.
This PR changs the logic for queued tasks, so they throw if they fail. Without this fix, some tasks may look like the succeeded, when they actually failed.
The default is to report progress every second.
In some cases the report output is stuck at the "Starting backup..." phase.
This PR adds a new `Starting_Operation` enum to indicate that we do not yet know which operation is starting.
Then an additional trigger is added to flush the progress when the pahse changes. This means that as soon as we know which operation is active, this will be flushed to the UI.
This adds a notification message that is sent after a task has completed and the metadata is updated. This makes the websocket get a fresh list of backups, sorted as prefered.
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.
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`
The new API avoids using HTTP status codes and verbs.
Added new structure for having a similar response envelope and pagination support for V2 calls.
Added extensions to the systemInfo call so the client knows if the V2 methods are available.
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".
* 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