Commit Graph
745 Commits
Author SHA1 Message Date
Kenneth Skovhede 1f41c7af12 Moved to JsonSignature library
Code that was previously embedded in th Duplicati.Library.Utility is now in its own library.
2025-10-08 10:11:57 +02:00
Kenneth Skovhede 39cca5c24f Simplified calling code to not rely on extension methods 2025-09-25 11:33:56 +02:00
Kenneth Skovhede 230d80642a Fixed invariant formatting helpers
This fixes an issue with formatting for invariant values that was caused by incrorrect function overload selection.

To avoid future issues, the two similar functions have been renamed to clarify what they are working for.
2025-09-25 11:14:54 +02:00
Kenneth SkovhedeandGitHub 360253c062 Merge branch 'master' into feature/hyperv-and-mssql-sources 2025-09-12 09:07:04 +02:00
Carl Johnsen 7670ea9a58 Ensured that all values that are passed to interpolation strings have been passed through FormatInvariant to prevent SQLite errors related to string formatting cultures. 2025-09-05 14:11:05 +02:00
Carl Johnsen 1a5fef36d7 Removed whitespace 2025-09-05 14:07:58 +02:00
Carl Johnsen b3fe276a13 Ensured that all temporary tables uset the same type of generated guid name 2025-09-05 14:06:55 +02:00
Svend Roperos c1e22faa03 fix: make string.Split calls explicit to resolve ambiguous overloads 2025-09-04 20:14:52 +02:00
Kenneth Skovhede a673bd0fab Fixed pre-calc SHA256 on AWS S3
This fixes pre-calculating the SHA256 hash for AWS SDK requests to S3.
This fixes an issue where a throttled stream would not be throttled correctly, because the AWS library would read the throttled stream twice (once for hashing, and once for transmitting).

To ensure compatibility with Wasabi S3, the hash is also lowercased.
2025-08-15 10:59:38 +02:00
Kenneth SkovhedeandGitHub ba7bee397c Merge branch 'master' into 0nbrsf-codex/find-outdated-packages 2025-08-07 10:48:59 +02:00
Kenneth Skovhede 9a97562a81 Added the Uri changes 2025-08-07 08:08:56 +02:00
Kenneth Skovhede 80945398fc Fixed nullability for Uri class 2025-07-15 13:33:16 +02:00
Kenneth Skovhede 9c6c52fbbb Fixed a null error 2025-07-15 13:29:40 +02:00
Kenneth Skovhede 19af340d49 Added support for correct parsing of Windows paths as URLs 2025-07-15 13:04:50 +02:00
Kenneth Skovhede aa42734cf8 Dots in url hostname
This fixes the encoding of hostnames with `.` characters in them. Without this fix, the hostname would be encoded making it impossible to use regular DNS hostnames.
2025-07-15 10:58:36 +02:00
Kenneth Skovhede 79811dc4c6 Added correct encode and decode of paths in urls.
The URLs passed to the custom URL parser were not decoding the path part, but passing it directly. This caused problems if the input was correctly URL encoded.

The updated code now correctly decodes the hostname+path parts, and encodes them again.
2025-07-11 12:08:04 +02:00
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 Skovhede 819af9e66f Update .NET dependencies 2025-06-24 07:51:26 +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