From 0981c66465f2619ec0d912ebe9bb218068ef220a Mon Sep 17 00:00:00 2001 From: TopperDEL Date: Thu, 15 Jul 2021 17:15:03 +0200 Subject: feat: Create a copy of old Tardigrade-Backend with reuse of new Storj-Backend --- .../Duplicati.Library.Backend.Tardigrade.csproj | 130 +++++++++++++++++++++ .../Backend/Tardigrade/Properties/AssemblyInfo.cs | 36 ++++++ Duplicati/Library/Backend/Tardigrade/Strings.cs | 15 +++ .../Backend/Tardigrade/TardigradeBackend.cs | 80 +++++++++++++ .../Backend/Tardigrade/libstorj_uplink.dylib | Bin 0 -> 14341776 bytes .../Library/Backend/Tardigrade/libstorj_uplink.so | Bin 0 -> 15439776 bytes .../Library/Backend/Tardigrade/packages.config | 13 +++ .../Backend/Tardigrade/win-x64/storj_uplink.dll | Bin 0 -> 9595904 bytes .../Backend/Tardigrade/win-x86/storj_uplink.dll | Bin 0 -> 8198656 bytes 9 files changed, 274 insertions(+) create mode 100644 Duplicati/Library/Backend/Tardigrade/Duplicati.Library.Backend.Tardigrade.csproj create mode 100644 Duplicati/Library/Backend/Tardigrade/Properties/AssemblyInfo.cs create mode 100644 Duplicati/Library/Backend/Tardigrade/Strings.cs create mode 100644 Duplicati/Library/Backend/Tardigrade/TardigradeBackend.cs create mode 100644 Duplicati/Library/Backend/Tardigrade/libstorj_uplink.dylib create mode 100644 Duplicati/Library/Backend/Tardigrade/libstorj_uplink.so create mode 100644 Duplicati/Library/Backend/Tardigrade/packages.config create mode 100644 Duplicati/Library/Backend/Tardigrade/win-x64/storj_uplink.dll create mode 100644 Duplicati/Library/Backend/Tardigrade/win-x86/storj_uplink.dll (limited to 'Duplicati/Library/Backend/Tardigrade') diff --git a/Duplicati/Library/Backend/Tardigrade/Duplicati.Library.Backend.Tardigrade.csproj b/Duplicati/Library/Backend/Tardigrade/Duplicati.Library.Backend.Tardigrade.csproj new file mode 100644 index 000000000..a37d1d2e1 --- /dev/null +++ b/Duplicati/Library/Backend/Tardigrade/Duplicati.Library.Backend.Tardigrade.csproj @@ -0,0 +1,130 @@ + + + + + Debug + AnyCPU + {AE035E01-C917-4F13-F35E-78F21C1A2F17} + Library + Properties + Duplicati.Library.Backend.Tardigrade + Duplicati.Library.Backend.Tardigrade + v4.7.1 + 512 + true + + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + x64 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\..\packages\sqlite-net-pcl.1.7.335\lib\netstandard2.0\SQLite-net.dll + + + ..\..\..\..\packages\SQLitePCLRaw.bundle_green.2.0.3\lib\net461\SQLitePCLRaw.batteries_v2.dll + + + ..\..\..\..\packages\SQLitePCLRaw.core.2.0.3\lib\netstandard2.0\SQLitePCLRaw.core.dll + + + ..\..\..\..\packages\SQLitePCLRaw.bundle_green.2.0.3\lib\net461\SQLitePCLRaw.nativelibrary.dll + + + ..\..\..\..\packages\SQLitePCLRaw.provider.dynamic_cdecl.2.0.3\lib\netstandard2.0\SQLitePCLRaw.provider.dynamic_cdecl.dll + + + + ..\..\..\..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll + + + + ..\..\..\..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll + + + + ..\..\..\..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll + + + ..\..\..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + + + + + + + ..\..\..\..\packages\uplink.NET.2.6.1451\lib\netstandard2.0\uplink.NET.dll + + + + + + + + + + {d63e53e4-a458-4c2f-914d-92f715f58acf} + Duplicati.Library.Common + + + {c5899f45-b0ff-483c-9d38-24a9fcaab237} + Duplicati.Library.Interface + + + {b68f2214-951f-4f78-8488-66e1ed3f50bf} + Duplicati.Library.Localization + + + {de3e5d4c-51ab-4e5e-bee8-e636cebfba65} + Duplicati.Library.Utility + + + {ae035e01-c917-4f13-a35e-78f21c1a2f17} + Duplicati.Library.Backend.Storj + + + + + PreserveNewest + + + PreserveNewest + + + + + + PreserveNewest + + + PreserveNewest + + + + + + Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}". + + + + + \ No newline at end of file diff --git a/Duplicati/Library/Backend/Tardigrade/Properties/AssemblyInfo.cs b/Duplicati/Library/Backend/Tardigrade/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..5f3cc907e --- /dev/null +++ b/Duplicati/Library/Backend/Tardigrade/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die einer Assembly zugeordnet sind. +[assembly: AssemblyTitle("Duplicati.Library.Backend.Tardigrade")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Duplicati.Library.Backend.Tardigrade")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly +// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von +// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("ae035e01-c917-4f13-a35e-78f21c1a2f17")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +// indem Sie "*" wie unten gezeigt eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Duplicati/Library/Backend/Tardigrade/Strings.cs b/Duplicati/Library/Backend/Tardigrade/Strings.cs new file mode 100644 index 000000000..4d4eda2f1 --- /dev/null +++ b/Duplicati/Library/Backend/Tardigrade/Strings.cs @@ -0,0 +1,15 @@ +using Duplicati.Library.Localization.Short; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Duplicati.Library.Backend.Strings +{ + internal static class Tardigrade + { + public static string DisplayName { get { return LC.L(@"Tardigrade Decentralised Cloud Storage"); } } + public static string Description { get { return LC.L(@"This backend can read and write data to the Tardigrade Decentralized Cloud Storage. It is deprecated - please move over to the new Storj DCS."); } } + } +} diff --git a/Duplicati/Library/Backend/Tardigrade/TardigradeBackend.cs b/Duplicati/Library/Backend/Tardigrade/TardigradeBackend.cs new file mode 100644 index 000000000..2ef32099f --- /dev/null +++ b/Duplicati/Library/Backend/Tardigrade/TardigradeBackend.cs @@ -0,0 +1,80 @@ +using Duplicati.Library.Interface; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Linq.Expressions; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using uplink.NET.Interfaces; +using uplink.NET.Models; +using uplink.NET.Services; + +namespace Duplicati.Library.Backend.Tardigrade +{ + + /// + /// This backend is deprecated! It will be removed in the future. + /// Tardigrade renamed to Storj DCS in Spring 2021 - but existing Tardigrade-Configurations could not be easily renamed. + /// So we decided to "copy" Tardigrade over to the new name Storj DCS. In order to reduce duplicate code, the old + /// Tardigrade-Backend hands it's logic over to Storj DCS. Only the UI-specific part, the config-parameters and + /// the protocol-key stay here named for Tardigrade. + /// + public class Tardigrade : Duplicati.Library.Backend.Storj.Storj + { + private const string TARDIGRADE_AUTH_METHOD = "tardigrade-auth-method"; + private const string TARDIGRADE_SATELLITE = "tardigrade-satellite"; + private const string TARDIGRADE_API_KEY = "tardigrade-api-key"; + private const string TARDIGRADE_SECRET = "tardigrade-secret"; + private const string TARDIGRADE_SHARED_ACCESS = "tardigrade-shared-access"; + private const string TARDIGRADE_BUCKET = "tardigrade-bucket"; + private const string TARDIGRADE_FOLDER = "tardigrade-folder"; + + private const string PROTOCOL_KEY = "tardigrade"; + + // ReSharper disable once UnusedMember.Global + // This constructor is needed by the BackendLoader. + public Tardigrade():base() + { + } + + // ReSharper disable once UnusedMember.Global + // This constructor is needed by the BackendLoader. + public Tardigrade(string url, Dictionary options) :base(url, options) + { + } + + public new string DisplayName + { + get { return Strings.Tardigrade.DisplayName; } + } + + public new string ProtocolKey => PROTOCOL_KEY; + + public new IList SupportedCommands + { + get + { + return new List(new ICommandLineArgument[] { + new CommandLineArgument(TARDIGRADE_AUTH_METHOD, CommandLineArgument.ArgumentType.String, Strings.Storj.StorjAuthMethodDescriptionShort, Strings.Storj.StorjAuthMethodDescriptionLong, "API key", null, null), + new CommandLineArgument(TARDIGRADE_SATELLITE, CommandLineArgument.ArgumentType.String, Strings.Storj.StorjSatelliteDescriptionShort, Strings.Storj.StorjSatelliteDescriptionLong, "us1.storj.io:7777", null, null), + new CommandLineArgument(TARDIGRADE_API_KEY, CommandLineArgument.ArgumentType.String, Strings.Storj.StorjAPIKeyDescriptionShort, Strings.Storj.StorjAPIKeyDescriptionLong, null, null, null), + new CommandLineArgument(TARDIGRADE_SECRET, CommandLineArgument.ArgumentType.Password, Strings.Storj.StorjSecretDescriptionShort, Strings.Storj.StorjSecretDescriptionLong, null, null, null), + new CommandLineArgument(TARDIGRADE_SHARED_ACCESS, CommandLineArgument.ArgumentType.String, Strings.Storj.StorjSharedAccessDescriptionShort, Strings.Storj.StorjSharedAccessDescriptionLong, null, null, null), + new CommandLineArgument(TARDIGRADE_BUCKET, CommandLineArgument.ArgumentType.String, Strings.Storj.StorjBucketDescriptionShort, Strings.Storj.StorjBucketDescriptionLong, null, null, null), + new CommandLineArgument(TARDIGRADE_FOLDER, CommandLineArgument.ArgumentType.String, Strings.Storj.StorjFolderDescriptionShort, Strings.Storj.StorjFolderDescriptionLong, null, null, null), + }); + } + } + + public new string Description + { + get + { + return Strings.Tardigrade.Description; + } + } + } +} diff --git a/Duplicati/Library/Backend/Tardigrade/libstorj_uplink.dylib b/Duplicati/Library/Backend/Tardigrade/libstorj_uplink.dylib new file mode 100644 index 000000000..a3e4de942 Binary files /dev/null and b/Duplicati/Library/Backend/Tardigrade/libstorj_uplink.dylib differ diff --git a/Duplicati/Library/Backend/Tardigrade/libstorj_uplink.so b/Duplicati/Library/Backend/Tardigrade/libstorj_uplink.so new file mode 100644 index 000000000..0ecab8ba8 Binary files /dev/null and b/Duplicati/Library/Backend/Tardigrade/libstorj_uplink.so differ diff --git a/Duplicati/Library/Backend/Tardigrade/packages.config b/Duplicati/Library/Backend/Tardigrade/packages.config new file mode 100644 index 000000000..1592ab1f8 --- /dev/null +++ b/Duplicati/Library/Backend/Tardigrade/packages.config @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/Duplicati/Library/Backend/Tardigrade/win-x64/storj_uplink.dll b/Duplicati/Library/Backend/Tardigrade/win-x64/storj_uplink.dll new file mode 100644 index 000000000..8b42a9c6b Binary files /dev/null and b/Duplicati/Library/Backend/Tardigrade/win-x64/storj_uplink.dll differ diff --git a/Duplicati/Library/Backend/Tardigrade/win-x86/storj_uplink.dll b/Duplicati/Library/Backend/Tardigrade/win-x86/storj_uplink.dll new file mode 100644 index 000000000..c34a75d19 Binary files /dev/null and b/Duplicati/Library/Backend/Tardigrade/win-x86/storj_uplink.dll differ -- cgit v1.2.3