From e80a591932097c199879eb727dcf6c82e3e82d3d Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Sat, 4 May 2013 14:23:10 +0200 Subject: [PATCH 1/3] Added +s suffix for protocols, so that ftps and webdavs are supported uri schemes --- .../Library/DynamicLoader/BackendLoader.cs | 21 +++++++++++++++++-- .../Duplicati.Library.DynamicLoader.csproj | 1 + 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Duplicati/Library/DynamicLoader/BackendLoader.cs b/Duplicati/Library/DynamicLoader/BackendLoader.cs index 889beaf1a..3bc199df3 100644 --- a/Duplicati/Library/DynamicLoader/BackendLoader.cs +++ b/Duplicati/Library/DynamicLoader/BackendLoader.cs @@ -23,6 +23,7 @@ using System.Text; using Duplicati.Library.Interface; using System.Collections.Specialized; using System.Web; +using System.Linq; namespace Duplicati.Library.DynamicLoader { @@ -94,8 +95,24 @@ namespace Duplicati.Library.DynamicLoader { if (m_interfaces.ContainsKey(scheme)) return (IBackend)Activator.CreateInstance(m_interfaces[scheme].GetType(), url, newOpts); - else - return null; + else if (scheme.EndsWith("s")) + { + var tmpscheme = scheme.Substring(0, scheme.Length - 1); + if (m_interfaces.ContainsKey(tmpscheme)) + { + var commands = m_interfaces[tmpscheme].SupportedCommands; + if (commands != null && (commands.Where(x => + x.Name.Equals("use-ssl", StringComparison.InvariantCultureIgnoreCase) || + (x.Aliases != null && x.Aliases.Where(y => y.Equals("use-ssl", StringComparison.InvariantCultureIgnoreCase))) + ).Any())) + { + newOpts["use-ssl"] = true; + return (IBackend)Activator.CreateInstance(m_interfaces[tmpscheme].GetType(), url, newOpts); + } + } + } + + return null; } } diff --git a/Duplicati/Library/DynamicLoader/Duplicati.Library.DynamicLoader.csproj b/Duplicati/Library/DynamicLoader/Duplicati.Library.DynamicLoader.csproj index df1044354..1780bab32 100644 --- a/Duplicati/Library/DynamicLoader/Duplicati.Library.DynamicLoader.csproj +++ b/Duplicati/Library/DynamicLoader/Duplicati.Library.DynamicLoader.csproj @@ -59,6 +59,7 @@ + From 37a60c10dfade8d76f0fe5817b8a02983a87d26a Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Sat, 4 May 2013 14:25:07 +0200 Subject: [PATCH 2/3] Auto-gen stuff --- Duplicati/Library/Main/Strings/Options.Designer.cs | 12 ++++++------ .../Library/Utility/Strings/Utility.Designer.cs | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Duplicati/Library/Main/Strings/Options.Designer.cs b/Duplicati/Library/Main/Strings/Options.Designer.cs index 06ae0383e..f33f918bd 100644 --- a/Duplicati/Library/Main/Strings/Options.Designer.cs +++ b/Duplicati/Library/Main/Strings/Options.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.296 +// Runtime Version:4.0.30319.1 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -295,7 +295,7 @@ namespace Duplicati.Library.Main.Strings { } /// - /// Looks up a localized string similar to If the backup is encrypted, the remote backend cannot verify the backup contents without the password. If this option is activated, Duplicati stores an unencrypted file on the backend. The file is never read by Duplicati, but allows the remote server to verify the backup integrity without requiring a password. The file contains no sensitive information, only a list of files that are expected to exist on the backend and their respective hashes. This option only has an effect when creating a backup and when v [rest of string was truncated]";. + /// Looks up a localized string similar to If the backup is encrypted, the remote backend cannot verify the backup contents without the password. If this option is activated, Duplicati stores an unencrypted file on the backend. The file is never read by Duplicati, but allows the remote server to verify the backup integrity without requiring a password. The file contains no sensitive information, only a list of files that are expected to exist on the backend and their respective hashes. This option only has an effect when creating a backup and when verifying a backup set.. /// internal static string CreateverificationfileLong { get { @@ -367,7 +367,7 @@ namespace Duplicati.Library.Main.Strings { } /// - /// Looks up a localized string similar to The operating system keeps track of the last time a file was written. Using this information, Duplicati can quickly determine if the file has been modified. If some application deliberately modifies this information, Duplicati won't work correctly unless this flag is set.. + /// Looks up a localized string similar to The operating system keeps track of the last time a file was written. Using this information, Duplicati can quickly determine if the file has been modified. If some application deliberately modifies this information, Duplicati won't work correctly unless this flag is set.. /// internal static string DisablefiletimecheckLong { get { @@ -421,7 +421,7 @@ namespace Duplicati.Library.Main.Strings { } /// - /// Looks up a localized string similar to When deciding if a full backup should be made or an old backup should be deleted, Duplicati will adjust the times by a small fraction to ensure that minor time differences do not interfer with expected operation. If the backup is set to produce a full backup each day, and a full backup is made at, say 12:00:01, and the backup is executed again at 12:00:00, a full day has not passed and thus an incremental backup is performed. To avoid this, Duplicati inserts a 1% tolerance (max 1 hour). Use this option to d [rest of string was truncated]";. + /// Looks up a localized string similar to When deciding if a full backup should be made or an old backup should be deleted, Duplicati will adjust the times by a small fraction to ensure that minor time differences do not interfer with expected operation. If the backup is set to produce a full backup each day, and a full backup is made at, say 12:00:01, and the backup is executed again at 12:00:00, a full day has not passed and thus an incremental backup is performed. To avoid this, Duplicati inserts a 1% tolerance (max 1 hour). Use this option to disable the tolerance, and use strict time checking. /// internal static string DisabletimetoleranceLong { get { @@ -1114,7 +1114,7 @@ namespace Duplicati.Library.Main.Strings { } /// - /// Looks up a localized string similar to This settings controls the usage of snapshots, which allows Duplicati to backup files that are locked by other programs. If this is set to "off", Duplicati will not attempt to create a disk snapshot. Setting this to "auto" makes Duplicati attempt to create a snapshot, and fail silently if that was not allowed or supported. A setting of "on" will also make Duplicati attempt to create a snapshot, but will produce a warning message in the log if it fails. Setting it to "required" will make Duplicati abort the [rest of string was truncated]";. + /// Looks up a localized string similar to This settings controls the usage of snapshots, which allows Duplicati to backup files that are locked by other programs. If this is set to "off", Duplicati will not attempt to create a disk snapshot. Setting this to "auto" makes Duplicati attempt to create a snapshot, and fail silently if that was not allowed or supported. A setting of "on" will also make Duplicati attempt to create a snapshot, but will produce a warning message in the log if it fails. Setting it to "required" will make Duplicati abort the backup if the snapshot creation fails. On windows this uses the Volume Shadow Copy Services (VSS) and requires administrative privileges. On linux this uses Logical Volume Management (LVM) and requires root privileges.. /// internal static string SnapshotpolicyLong { get { @@ -1285,7 +1285,7 @@ namespace Duplicati.Library.Main.Strings { } /// - /// Looks up a localized string similar to This settings controls the usage of NTFS USN numbers, which allows Duplicati to obtain a list of files and folders much faster. If this is set to "off", Duplicati will not attempt to use USN. Setting this to "auto" makes Duplicati attempt to use USN, and fail silently if that was not allowed or supported. A setting of "on" will also make Duplicati attempt to use USN, but will produce a warning message in the log if it fails. Setting it to "required" will make Duplicati abort the backup if the USN usage fail [rest of string was truncated]";. + /// Looks up a localized string similar to This settings controls the usage of NTFS USN numbers, which allows Duplicati to obtain a list of files and folders much faster. If this is set to "off", Duplicati will not attempt to use USN. Setting this to "auto" makes Duplicati attempt to use USN, and fail silently if that was not allowed or supported. A setting of "on" will also make Duplicati attempt to use USN, but will produce a warning message in the log if it fails. Setting it to "required" will make Duplicati abort the backup if the USN usage fails. This feature is only supported on Windows and requires administrative privileges.. /// internal static string UsnpolicyLong { get { diff --git a/Duplicati/Library/Utility/Strings/Utility.Designer.cs b/Duplicati/Library/Utility/Strings/Utility.Designer.cs index 8b8e50840..9a1dd7fbf 100644 --- a/Duplicati/Library/Utility/Strings/Utility.Designer.cs +++ b/Duplicati/Library/Utility/Strings/Utility.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.269 +// Runtime Version:4.0.30319.1 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -106,7 +106,7 @@ namespace Duplicati.Library.Utility.Strings { } /// - /// Looks up a localized string similar to The digit '{0}' is not a valid hex digit. + /// Looks up a localized string similar to The digit '{0}' is not a valid hex digit. /// internal static string InvalidHexDigitError { get { From 23e09566fb3e910f6260a898d1eaa73132a5beaf Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Sat, 4 May 2013 14:27:30 +0200 Subject: [PATCH 3/3] Missing commit --- Duplicati/Library/DynamicLoader/BackendLoader.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Duplicati/Library/DynamicLoader/BackendLoader.cs b/Duplicati/Library/DynamicLoader/BackendLoader.cs index 3bc199df3..e515777d4 100644 --- a/Duplicati/Library/DynamicLoader/BackendLoader.cs +++ b/Duplicati/Library/DynamicLoader/BackendLoader.cs @@ -103,10 +103,10 @@ namespace Duplicati.Library.DynamicLoader var commands = m_interfaces[tmpscheme].SupportedCommands; if (commands != null && (commands.Where(x => x.Name.Equals("use-ssl", StringComparison.InvariantCultureIgnoreCase) || - (x.Aliases != null && x.Aliases.Where(y => y.Equals("use-ssl", StringComparison.InvariantCultureIgnoreCase))) + (x.Aliases != null && x.Aliases.Where(y => y.Equals("use-ssl", StringComparison.InvariantCultureIgnoreCase)).Any()) ).Any())) { - newOpts["use-ssl"] = true; + newOpts["use-ssl"] = "true"; return (IBackend)Activator.CreateInstance(m_interfaces[tmpscheme].GetType(), url, newOpts); } }