diff --git a/Duplicati/UnitTest/ServerApiIntegrationTests.cs b/Duplicati/UnitTest/ServerApiIntegrationTests.cs index 3d7799e69..17070cb20 100644 --- a/Duplicati/UnitTest/ServerApiIntegrationTests.cs +++ b/Duplicati/UnitTest/ServerApiIntegrationTests.cs @@ -408,7 +408,7 @@ public class ServerApiIntegrationTests : BasicSetupHelper { var restoreResponse = await httpClient.PostAsJsonAsync( $"/api/v1/backup/{backupId}/restore", - new RestoreInputDto(null, passphrase, "now", restoreFolder, true, false, false, null), + new RestoreInputDto(null, passphrase, "now", restoreFolder, true, false, false, null, null), JsonOptions).ConfigureAwait(false); restoreResponse.EnsureSuccessStatusCode(); var task = await restoreResponse.Content.ReadFromJsonAsync(JsonOptions).ConfigureAwait(false) diff --git a/Duplicati/WebserverCore/Dto/RestoreInputDto.cs b/Duplicati/WebserverCore/Dto/RestoreInputDto.cs index e7f3ada56..7e1e7c65b 100644 --- a/Duplicati/WebserverCore/Dto/RestoreInputDto.cs +++ b/Duplicati/WebserverCore/Dto/RestoreInputDto.cs @@ -30,6 +30,7 @@ namespace Duplicati.WebserverCore.Dto; /// Whether to overwrite existing files /// Whether to restore permissions /// Whether to skip metadata +/// The connection string ID to use, if the destination is a masked remote source /// The source prefix to use, if the destination is a masked remote source public sealed record RestoreInputDto( string[]? paths, @@ -39,4 +40,5 @@ public sealed record RestoreInputDto( bool? overwrite, bool? permissions, bool? skip_metadata, + long? connection_string_id, string? source_prefix); diff --git a/Duplicati/WebserverCore/Endpoints/V1/Backup/BackupPost.cs b/Duplicati/WebserverCore/Endpoints/V1/Backup/BackupPost.cs index 42c9263f4..3a600ce0a 100644 --- a/Duplicati/WebserverCore/Endpoints/V1/Backup/BackupPost.cs +++ b/Duplicati/WebserverCore/Endpoints/V1/Backup/BackupPost.cs @@ -120,7 +120,7 @@ public class BackupPost : IEndpointV1 var restorepath = input.restore_path; if (restorepath != null && restorepath.StartsWith("@")) { - var res = await SharedRemoteOperation.ExpandUrl(connection, applicationSettings, restorepath.Substring(1), id, input.source_prefix, cancellationToken); + var res = await SharedRemoteOperation.ExpandUrl(connection, applicationSettings, restorepath.Substring(1), id, input.connection_string_id ?? -1, input.source_prefix, cancellationToken); if (!string.IsNullOrWhiteSpace(res.Url)) restorepath = "@" + res.Url; }