Commit Graph
59 Commits
Author SHA1 Message Date
Kenneth Skovhede 4d569c51e4 Added read-only testing to backends
This PR adds a flag to the test method so we can choose to test for read-only access (needed for restore) or read-write (needed for backups).

Additionally, this PR fixes a logic bug in that the BackendSourceProvider would not actually test the connection, but just check the placeholder element returned (which is always returned). With this PR the backend's ListAsync command is tested fully.

Also renamed the methods on ISourceProvider to have the `...Async` prefix.

This replaces #6939
2026-06-03 17:27:34 +02:00
Kenneth Skovhede c0f40e19ca Updated copyright year to 2026 across the project 2026-04-16 15:21:24 +02:00
Kenneth Skovhede 1e7afbd49e Fixed issues with paths on Windows with remote sources 2026-01-31 12:15:55 +01:00
Kenneth SkovhedeandGitHub f9df5f4457 Merge branch 'master' into feature/implement-rename-on-backends 2026-01-30 14:40:13 +01:00
Kenneth Skovhede bb78aa57ae More work on Box paths 2026-01-29 22:33:42 +01:00
Kenneth Skovhede e9f2b4e4d6 Updated Box to better handle cross-os strings 2026-01-29 21:17:27 +01:00
Kenneth Skovhede 8a08b35546 Extended support for remote sources
This PR adds support for using Box, Dropbox, GoogleDrive, SharepointV2, MicrosoftGroups, and OneDrive as remote sources.

For GoogleDrive, this requires full permissions and not just the regular OAuth access token.

Also extended S3 and SMB to actually look up a file if requested, which makes it possible to rely on the backup exclusion files, even when using remote sources. (SSH/SFTP does not currently support this).
2026-01-28 14:37:51 +01:00
Kenneth Skovhede 05f2702c82 Added support for renaming files on backends that support it.
This PR updates existing backends to implement the `IRenameEnabledBackend` interface, allowing for more efficient file renaming operations. The implementation varies by backend, with some using native rename operations and others falling back to copy-and-delete patterns.
2026-01-27 13:08:20 +01:00
Kenneth Skovhede 012aeed7de Add dynamic streaming toggle
This PR adds a dynamic property so a backend can signal if it supports streaming, based on the settings.

This is currently used for the File backend, so that toggling `--use-move-for-put` will disable streaming on the backend instead of relying on the `--disable-streaming-transfers` flag.
2025-11-03 12:48:37 +01:00
Svend Roperos c1e22faa03 fix: make string.Split calls explicit to resolve ambiguous overloads 2025-09-04 20:14:52 +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 9723b78279 Fixed nullability issues 2025-05-24 13:54:59 +02:00
Kenneth Skovhede c44bac7474 Removed checks for status code as that is done in the helper 2025-05-23 14:00:39 +02:00
Kenneth Skovhede d3b65f1e92 Remove OAuthHelper
This PR removes OAuthHelper.

Initial commit is removal of OAuthHelper in GoogleCommon, GoogleDrive and GCS.
2025-05-23 10:40:55 +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 5d16081940 Resillient box error parsing
When an error is thrown from box.com, it is sometimes not formatted according to the API documentation (most likely html/xml output).

This commit handles an invalid JSON response and returns the body contents in the error message.

This fixes #4283
2025-05-01 14:40:40 +02:00
Marcelo C. 0aaba8c32a Defaulting to InfiniteTimeSpan
Defaulting to InfiniteTimeSpan because the timeout mechanisms now handle the cancelations.
2025-04-10 08:58:23 -03:00
Marcelo C. 10207edf6a Fix to Box backend - overwrite default HttpClient 100 second timeout
If timeouts are specified, they are applied, otherwise it will default to infinite timeout rather than the 100 second timeout HttpClient defaults to.
2025-04-08 11:46:14 -03:00
Kenneth Skovhede d665828a83 Re-implemented box.com on new version.
Removed some non-async methods on the JsonWebHelperHttpClient.
2025-03-24 17:14:21 +01:00
Kenneth Skovhede 83c5806a7a Merge remote-tracking branch 'origin/master' into feature/improve-auth-parsing-helper 2025-03-24 14:53:08 +01:00
Marcelo C. 769f687693 Converting AccessToken helper method to be fully async 2025-03-21 13:29:29 -03:00
Marcelo C. b27acf52d5 Removing custom boundary, leaving for framework to add its own value 2025-03-21 10:43:51 -03:00
Kenneth Skovhede 597c7e1fa3 Implemented nullable for the backends 2025-03-21 08:54:24 +01:00
Marcelo C. 3fd663e923 Terminal Box.com replacement of deprecated WebClient/OAuth
Creating of the new OAuthHelper for HttpClient.
Removal of manual assembly of the multipart post.
2025-03-20 15:23:31 -03:00
Kenneth Skovhede 0247f13ebf Updated box.com 2025-03-20 11:17:35 +01:00
Kenneth Skovhede 0f9669b273 Final conversion to async backends
This PR is the final change, where all backends are now purely implemented with async interfaces.

The code changes here replace the LIST call with an async version. This affect all backends (and then some) but the changes are mostly mechanical rewrites of the code.

In many places, the backeds were already prepared for async output, in other some glue was needed.

To reduce the scope of this change, some backends simply report a synchronous result as an async list.
2025-02-17 16:45:51 +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 Skovhede 61ea36091a Added DNSNames as async 2024-10-02 09:37:52 +02:00
Kenneth Skovhede 586c08522e Implemented async method for Test, CreateFolder and Quota in all backends.
Still missing the List and DNSHostnames.
The AsyncRequest class is also preventing many backends from fully upgrading.
2024-10-01 09:30:02 +02:00
Kenneth Skovhede ecf2e8b551 Implemented DeleteAsync on all backends 2024-09-29 23:04:54 +02:00
Kenneth Skovhede e3e3d1305f Implemented async version of Get for all backends. 2024-09-29 22:00:57 +02:00
Kenneth Skovhede 40dd3c6816 Updated all license mentions to MIT 2024-02-28 15:45:30 +01:00
Kenneth Hsu de2a651763 Fix bug in PutAsync implementations.
Without await, the using statement can dispose the Stream before the
call to PutAsync completes, resulting in an ObjectDisposedException.

This fixes #4556.
2021-06-12 15:12:13 -07:00
Kenneth Hsu afab61a05b Use pattern matching to simplify casts. 2019-10-19 10:15:38 -07:00
Kenneth Hsu b19102f11a Disable warnings about unused constructors. 2019-05-14 19:22:51 -07:00
Kenneth Hsu 3d32cd482f Disable warning about unused class. 2019-05-14 19:22:51 -07:00
Sean Templeton b02b19e683 Change Put method name to PutAsync 2019-03-17 18:28:45 -05:00
Sean Templeton 7f09c7af27 Update Box and Rackspace Cloud Files backends for async Put 2019-03-05 21:08:25 -06:00
Sean Templeton 0c122ff550 Change IBackend and IStreamingBackend to return Task for Put() 2019-03-03 21:43:10 -06:00
verhoek b2cc18426c Renamed Library.IO to Library.Common.IO.
Moved basic Platform functions to Library.Common.Platform.
Turned IO_OS into property within Library.Common.
2018-11-02 21:34:07 +01:00
verhoek bc053df294 Moved basic IO helper functions to Library.IO. 2018-10-27 12:17:07 +02:00
Kenneth Hsu 9e0b031fee Remove unused members. 2018-10-15 21:20:30 -07:00
Kenneth Hsu 0c1ac9c489 Replace chained LINQ calls with call to overload with predicate.
This simplifies the code by reducing the number of enumerators created
while also making the code slightly more readable.
2018-10-06 16:20:18 -07:00
Kenneth SkovhedeandGitHub 0ec49d3a87 Merge pull request #3393 from warwickmm/fix_append_dir_separator
Fix behavior of AppendDirSeparator utility method
2018-09-28 22:24:11 +02:00
Kenneth Hsu d4d1945faf Use utility method to append trailing slash.
This removes some duplicated code.
2018-09-22 10:19:45 -07:00
Kenneth Hsu 18aae7a5c4 Simplify method resolution by removing default parameters.
The previous implementations resulted in an overload being hidden by one
without a default parameter, making it unclear which method was being
called.  For example, consider the following signatures:

public MultipartItem(string content, string contenttype = null, string name = null, string filename = null)
public MultipartItem(string contenttype, string name = null, string filename = null)

From https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/named-and-optional-arguments,

> If two candidates are judged to be equally good, preference goes to a
> candidate that does not have optional parameters for which arguments
> were omitted in the call. This is a consequence of a general preference
> in overload resolution for candidates that have fewer parameters.
2018-09-20 19:30:49 -07:00
Kenneth Hsu 2717bbd09a Avoid null reference exceptions with Box.com backend.
This addresses issue #3276, and possibly issue #3062.
2018-06-16 11:18:59 -07:00
Kenneth Hsu f12858e6a5 Mark fields that shouldn't be reassigned as readonly.
This makes it explicit at compile-time that these fields should not be
reassigned outside the constructor.
2018-05-25 10:04:52 -07:00
Kenneth Skovhede ee64517f7d Removed calls to Console.WriteLine as we may run somewhere without a console. 2018-05-15 11:29:08 +02:00
Kenneth Skovhede bd863016fa Added support for returning multiple DNS names for cache invalidation.
Updated most backends to return the actual DNS names for cache invalidation.
2018-02-26 11:37:10 +01:00