Commit Graph
728 Commits
Author SHA1 Message Date
Kenneth SkovhedeandGitHub 30cb3ae9a3 Merge pull request #6383 from duplicati/feature/drop-sebackupprivilege
Update permission check to drop privilege
2025-07-01 15:18:06 +02:00
Kenneth Skovhede 9d8f426c99 Fixed crashs in debug mode
This fixes the callstack walker to handle cases where the call frame has no assembly.
The code is only compiled for debug builds.
2025-07-01 11:47:30 +02:00
Kenneth Skovhede 9eb2ceada5 Update permission check to drop privilege
This PR adjusts the check for SeBackupPrivilege and unassigns the privilege after testing if it could be enabled.

This fixes #6317
2025-07-01 11:45:29 +02:00
Kenneth SkovhedeandGitHub 9dfe618444 Merge pull request #6338 from duplicati/feature/detect-erperm-errors
Detect EPERM on mac/Linux
2025-06-12 22:25:54 +02:00
Kenneth Skovhede af82ed3a49 Detect EPERM on mac/Linux
This PR updates the check for permission denied to include EPERM and EACCES on macOS/Linux.
2025-06-12 13:36:53 +02:00
Kenneth Skovhede 35058d333e Update handling of alternate OAuth url
This PR removes the `OAuthContextSettings` class, and makes the `--oauth-url` option available on each backend that uses it, so it can be configured as part of the destination.

To assemble everything related to configuring OAuth, the code was moved to the `AuthIdOptionsHelper`, such that the usage can be shared between implementations.

This PR also adds the option to set the default OAuth url from the environment variable `DUPLICATI_OAUTH_SERVICE`.

The server can then be set in the following locations (most important last):
- Environment variable
- Server-wide advanced settings
- Backup job advanced settings (or commandline)
- Destination url
2025-06-11 09:27:40 +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
Kenneth Skovhede 6a42613f70 Fixed passing the FolderMissingException to the caller for triggering the autocreate 2025-05-24 15:34:38 +02:00
Kenneth Skovhede 0eef7ec49b Final removal of AsyncHttpRequest. 2025-05-24 13:55:19 +02:00
Kenneth Skovhede 6031b4de8b Update Test method to check for write permissions
This PR moves the check from the FTP backend into shared code, so all backends will now check for read/write permissions when using the "Test" button.

For situations where write permissions are not required (like restore or verify) there is a flag on the v2 API that indicates if the connection was established, so the UI can show a message suggesting that it is possible to proceed, if the current UI operation does not require write permissions.

This fixes #2473
2025-05-21 17:19:27 +02:00
Kenneth Skovhede 8fb37cb6f5 Fixed query to ensure privilege is enabled.
Removed wrong check.
2025-05-20 17:34:05 +02:00
Kenneth Skovhede ded55740de Set VSS to Auto if user has permissions
If th user has the SeBackupPrivilege, set the default snapshot policy to `Auto` and otherwise use `Off` (the current default).

This ensures that if the process is running with the correct permissions, there will be fewer warnings.

This only changes the default value on Windows.

This fixes #2833
2025-05-20 16:53:11 +02:00
Kenneth Skovhede 1cfacca794 Enabled nullable for FilterExpression and Options
This adds nullability to FilterExpression and Options.
It also updates almost all properties in Options to use a common format that enforces uniform parsing of the values.

A few options have been updates to have the default values specified as a constant, to avoid replicating the value in two places.
2025-05-20 14:36:39 +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
Carl Johnsen 8be97bcefd Whitespace changes 2025-05-16 10:22:51 +02:00
Carl Johnsen 04153d2c12 Removed Microsoft.DotNet.Analyzers.Compatibility from csproj's as it's deprecated. 2025-05-16 09:53:26 +02:00
Kenneth Skovhede 42c3ecd009 Fix throttle stream issues
Some providers, B2, Idrivee2, JottaCloud and S3 (AWS version) needs a checksum for the content.

To calculate this content the libraries will calculate the hash by reading the stream. But since the stream can be throttled, the hash calculation is throttled.

In some cases the contents are buffered, so the transfer is done at full speed, but the hashing at throttled speed. The average speed is the same, but network traffic is bursty, which it should not be with a throttle.

Also added option to disable signing with AWS Sigv4 as that interferes with the throttled stream. It is not currently possible to pass the sha-256 hash to the Sigv4 code, so it will always read the entire (potentially throttled) stream before sending the contents, causing unwanted delays. Use the new option `--s3-disable-payload-signing` to disable v4 signing.
2025-05-09 13:46:45 +02:00
Kenneth SkovhedeandGitHub 9f6a24ad4f Update AuthIdOptionsHelper.cs
Change type to Password
2025-05-08 15:34:21 +02:00
Kenneth SkovhedeandGitHub ff9351ee56 Merge pull request #6226 from duplicati/feature/track-tasks-lifetime
Added task metadata
2025-05-08 10:47:28 +02:00
Kenneth Skovhede b7600401f3 Bump again to get flushing working 2025-05-05 16:18:21 +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 3430c73e33 Update StreamUtil
This makes smoother progress when throttling
2025-05-02 22:57:26 +02:00
Kenneth SkovhedeandGitHub a15c3262be Merge branch 'master' into fix-regexp-combine 2025-04-30 16:14:17 +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 SkovhedeandGitHub 2837a105ee Merge pull request #6186 from duplicati/feature/add-sqlite-cache-value
Added option to set the SQLite page cache
2025-04-25 14:45:43 +02:00
Kenneth Skovhede a906787c74 Bumped streamutil package 2025-04-25 13:55:15 +02:00
Kenneth Skovhede 0d5bd3027e Fixed reporting all available tiers 2025-04-24 21:45:06 +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 8aee23c278 Updated Minio to 6.0.4 2025-04-15 00:00:55 +02:00
Kenneth Skovhede f0f68dfebf Fix locale-sensitive time parsing
On some locales, odd strings would parse as valid full dates, causing relative dates to be incorrectly calculated.

This commit fixes the issues and revisits the DST aware calculations with more tests.
2025-04-08 23:38:36 +02:00
Kenneth Skovhede f91c814a45 Introduce DateTime option type.
This commit adds the `DateTime` option to support validation of the `--time` parameter, which can both be an absolute date and time, or a relative value.

This fixes #6107
2025-04-01 14:17:37 +02:00
Carl Johnsen dd888c2761 Pushed incorrect fix 2025-03-26 13:49:05 +01:00
Carl Johnsen 3e38139953 DateTime can sometimes be a local kind, which doesn't match with TimeSpan.Zero, which is in UTC, and DateTimeOffset requires that they match. 2025-03-26 13:45:50 +01:00
Kenneth Skovhede c57401934d Merge commit '99ad60571ec7ad3b6e613ff7cf7f9829310f9a8e' into feature/allow-trayicon-disconnected 2025-03-25 14:02:27 +01:00
Kenneth SkovhedeandGitHub 5eb1f9edd3 Merge pull request #6077 from duplicati/feature/fix-decoding-windows-paths
Fixed URL parser not treating `file://C:\path` the same as `C:\Path`.
2025-03-25 12:35:56 +01:00
Kenneth Skovhede e056e651f9 Fixed issues with cross-talk options from TrayIcon and Server 2025-03-25 11:36:44 +01: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 SkovhedeandGitHub fcaeea4245 Merge branch 'master' into feature/fix-decoding-windows-paths 2025-03-25 08:55:06 +01:00
Kenneth SkovhedeandGitHub 11f68523b3 Merge branch 'master' into feature/fix-time-parser 2025-03-25 08:52:18 +01:00
Kenneth Skovhede 41d01b8486 Cleaned up the DST aware DateTime parser to be more readable 2025-03-24 21:32:07 +01:00
Kenneth Skovhede fe887d5cf9 Made the datetime parser a bit more readable 2025-03-24 21:28:32 +01:00
Kenneth Skovhede 392901d77a Fixed validator warning on negative timespans
This changes the parse to use custom logic for parsing the timespan, instead of trying to base it on the datetime parser code.

This fixes #954
2025-03-24 21:27:11 +01:00
Kenneth Skovhede c5d5bb356d Also expand paths with file:// prefix 2025-03-24 20:56:32 +01:00
Kenneth Skovhede 53ee9526ca Fixed some nullability warnings 2025-03-24 17:10:15 +01:00
Kenneth Skovhede a685c6c4e5 Fixed URL parser not treating file://C:\path the same as C:\Path.
This fixes #6071
2025-03-24 11:35:04 +01:00
Kenneth Skovhede 631c80d6a8 Cleaned up some option names 2025-03-24 10:17:26 +01:00
Kenneth Skovhede 9d617fe08a Updated TahoeLAFS 2025-03-24 09:15:49 +01:00
Kenneth Skovhede fc927b881f Updated rclone backend 2025-03-22 08:08:54 +01:00
Kenneth Skovhede 9cecee04b9 Updated pCloud 2025-03-21 17:01:37 +01:00