Commit Graph
36 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 SkovhedeandGitHub 414789f209 Merge branch 'master' into feature/full-disk-backup 2026-02-20 10:46:40 +01:00
Kenneth Skovhede d7f9981f49 Fixed a few nullable warnings 2026-02-17 10:37:08 +01:00
Carl Johnsen 594efeca04 Merge branch 'master' into feature/full-disk-backup 2026-02-15 16:42:08 +01:00
Carl Johnsen 92ed7e6757 Removed whitespace 2026-02-09 12:27:49 +01:00
Carl Johnsen 3fe57b308d Added functionality for priority files for restore providers 2026-02-09 11:36:15 +01:00
Kenneth Skovhede cf8ef437c9 Fixed an edge case where the code would attempt to create a parent folder outside the restore target prior to applying metadata 2026-02-05 15:17:14 +01:00
Kenneth Skovhede 56f74803fc Fixed edge cases for path traversal protection 2026-02-05 09:21:24 +01:00
Kenneth Skovhede d4eace8544 Made the restore more robust in the event of failures with individual files/directories. 2026-01-27 17:06:52 +01:00
Kenneth Skovhede 655d6cbe65 Prevent restore target escape
This PR adds checks on limited restores, where the user has asked for files to be restored within a specific folder.

This PR adds explicit checks to ensure that the restore data cannot accidentially or maliciously constructed in such a way that it will affect files outside of the restore target folder.
2026-01-27 15:51:30 +01:00
Kenneth Skovhede 732b4e3989 Implemented support for the Test operation on sourceProvider and restoreDestinationProvider 2026-01-25 11:57:09 +01:00
Kenneth Skovhede a4b33e5d16 Implemented Restore feature and refactored a bit.
Added a free tier for the Office 365 module.
2026-01-20 10:36:37 +01:00
Kenneth Skovhede 27dc64121b Implemented cross-tenant email restore 2026-01-16 11:09:13 +01:00
Kenneth Skovhede 996bb8e0de Change the metadata on the ISourceProviderEntry interface to be async 2026-01-14 10:08:05 +01:00
Kenneth Skovhede 22e66a27a6 Rewrote logic to provide a restore destination 2026-01-14 10:04:52 +01:00
Kenneth Skovhede 1523f730e3 Added support for storing metadata in the database 2026-01-14 10:01:20 +01:00
Kenneth Skovhede 3b695cf065 Added support for Photos on MacOS
This PR adds detection of the MacOS Photos folder, and intercepts reads and replaces them with PhotoKit calls.
With this, it is possible to make backups of all MacOS Photos, even if they are not stored locally.

The previous versions would just make a backup of the on-disk structure, which was not guaranteed to contain all photos, but instead has various indexing for finding photos, and may contain some original photos.

The option `--photos-handling` controls how Duplicati now deals with the Photos folder. The options are:
- `LibraryOnly`: Same as before, just treat it as a folder
- `PhotosOnly`: Ignore the folder contents and just back up the actual photos
- `PhotosAndLibrary` (default): Make a backup of the photos and the library on-disk. This may cause images to be stored twice, but de-duplication will usually limit the storage increase.

The option `--photos-library-path` can be used to point to the on-disk Photo library that should be handled, in case the auto-detection does not pick it up. If this does not point to a valid Photoslibrary, or the path is not being backed up, no special handling will be done.

Note that the restore is not restoring into Photos itself, but instead restores into a sub-folder in the Photolibrary that is called `dup_backup`. To get the photos out after a restore, one needs to right-click the Photolibrary folder, and choose "Show package contents" and then the `dup_backup` folder is revealed.

This is done to keep all photos in the same folder, but avoid messing with the structure of the on-disk Photolibrary.

A future update could allow restoring back into Photos, and metadata is captured for each image to eventually allow this.

This fixes #6381
2025-11-17 17:12:10 +01:00
Kenneth Skovhede 5620c083d8 Fixed some 9.0.6 refs 2025-11-14 17:08:19 +01:00
Kenneth Skovhede 178440f869 Fixed a number of warnings 2025-11-14 16:00:06 +01:00
Kenneth Skovhede 1ea74a3c63 Updated to .NET10 2025-11-14 15:05:39 +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
Kenneth Skovhede 819af9e66f Update .NET dependencies 2025-06-24 07:51:26 +02:00
Carl Johnsen 58db4c9753 Restructured ItemGroups 2025-05-16 10:15:31 +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 1465d7c368 Updated CIFS 2025-03-20 12:02:25 +01:00
Kenneth Skovhede 30b1cd59b8 Fixed cases where Windows paths were sent to the remote destination 2025-02-24 13:04:35 +01:00
Kenneth Skovhede 26bbe6a577 Added setup step for source providers.
This enables a fail-early approach, where the remote source loads the initial results.
By storing the `IAsyncEnumerable` it is possible to not perform any additional remote calls, even with the initial probing call.

This makes it possible to detect the absence of sources, so the backup can be aborted if sources are missing.
2025-02-24 12:50:58 +01:00
Kenneth Skovhede 4e73be1806 Fixed path conversion on Windows 2025-02-21 16:25:18 +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 5a4fcaa6d7 Added tool to work with remote sources 2025-02-21 11:51:45 +01:00
Kenneth Skovhede 0e8df7ccd8 Removed unsupported code 2025-02-17 14:05:21 +01:00
Kenneth Skovhede bb5fd80a29 Implemented support for some backends as sources: SSH, CIFS, and S3 2025-02-17 14:01:08 +01:00
Kenneth Skovhede 989ba60211 Updated license copyright years 2025-02-17 08:52:01 +01:00
Kenneth Skovhede 8c935a7344 This creates a new ISourceProvider interface for describing a data source.
With this interface it is possible to wrap the current support for snapshots and USN and simplify the enumeration.

This makes a number of assumptions into fields such as `IsMetaEntry` and `IsRootEntry` that removes code that was checking for various properties.

This first commit has support for VSS and USN as well as "naked" files, keeping feature parity.

There is also an experimental support for loading a backend-as-a-source. The support for this is currently limited as the backends need to be extended to support a folder concept.
2025-02-09 16:14:22 +01:00