Commit Graph
67 Commits
Author SHA1 Message Date
Kenneth Skovhede ee64517f7d Removed calls to Console.WriteLine as we may run somewhere without a console. 2018-05-15 11:29:08 +02:00
Tyler Gill e7e1ccdec2 Fix auth-id hiding in MS Graph backends. 2018-04-10 10:10:19 -06:00
Kenneth Hsu c0c29e579d Make string comparison use ordinal (binary) sort rules.
This string comparison should not be culture-aware.
2018-03-28 20:49:47 -07:00
Tyler Gill f93f9dcc5a Add new utility class, OAuthHttpClient.
This class extends HttpClient and uses an OAuthHttpMessageHandler under the covers to automatically authenticate requests.
Additionally, it automatically respects the global HttpContextSettings for overall timeout, read/write timeout, and SSL certificate validation.
(BufferRequests isn't currently handled, as HttpClient doesn't seem to easily expose that flag, and as of .NET 4.5, seems to not buffer by default.)
2018-03-23 15:07:51 -06:00
Tyler Gill 407bead9f9 Change some fragment settings.
Default retry delay is now 1000ms, and fragment sizes must be at least the multiple size (320 KiB)
2018-03-23 15:04:23 -06:00
Tyler Gill 5a4d170165 Update strings for Microsoft Group backend. 2018-03-23 15:03:04 -06:00
Tyler Gill 448577f5ff Handle cases where the SharePoint path is given with an 'https' prefix in the UI. 2018-03-22 16:15:09 -06:00
Tyler Gill 7491da2add Add entry for --group-email so it isn't treated as an unknown property. 2018-03-22 16:14:42 -06:00
Tyler Gill 5bec41b665 Update both SharePoint and Office 365 group backends to support more human-discernable methods of specifying the backend destination.
For SharePoint, this means instead of giving the site ID as a parameter (and a relative path as the backup URL), the full URL to the folder in SharePoint (e.g., 'sharepoint://{tenant}.sharepoint.com/{PathToSite}/{DocumentBase}/{subfolder}') can be given, and the site ID will be looked up.
(This should match the existing SharePoint backend, including the convention of using '//' to indicate the document root, though I can't explicitly test that since the SharePoint sites I have access to require 2FA, which the old backend doesn't support.)
I've tested both explicit ID and site path methods of specifying the destination, and they appear to be working.
For Office 365 groups, it now supports looking up a group by its email address.
2018-03-22 15:20:17 -06:00
Tyler Gill 987cda7e1d When uploading large files, MS graph backends need to parse the response inside the try block for retries to work (since that is where errors are thrown) 2018-03-22 14:41:19 -06:00
Tyler Gill 258799266e SharePoint and Group drives appear to report quota info that is all zeros.
In that case, pretend that no quota info was reported instead of causing incorrect quota warnings and errors.
2018-03-22 14:40:37 -06:00
Tyler Gill 438c84f824 Ensure custom fragment sizes fit the recommended sizes (under 60 MiB and multiple of 320 KiB) 2018-03-21 11:32:41 -06:00
Tyler Gill 55c182b946 Strip authorization header and access token out of Microsoft Graph exception messages. 2018-03-21 11:16:27 -06:00
Tyler Gill 6c05da925e Explicitly request the 'replace' conflict resolution behavior when uploading large files. 2018-03-20 15:28:57 -06:00
Tyler Gill dbb28c5f62 Make sure DNS names reported by Microsoft Graph backends are unique. 2018-03-20 15:26:52 -06:00
Tyler Gill c57d7e75cd Add helpId parameter to UserInformationExceptions in MicrosoftGraphBackends. 2018-03-20 15:09:06 -06:00
Tyler Gill 94341a640d Implement DNSName method in MicrosoftGraphBackend base class. 2018-03-20 15:08:30 -06:00
Tyler Gill f4c6100873 Add Duplicati + version as the user agent in the MS Graph backends. 2018-03-20 15:07:46 -06:00
Tyler Gill 4578a5bd91 Merge branch 'master' of https://github.com/duplicati/duplicati into feature/ms-graph-backends 2018-03-20 14:24:48 -06:00
Tyler Gill a98c967f70 Add new backends for OneDrive+OneDrive for Business, SharePoint, and Microsoft Groups based on the Microsoft Graph API.
These backends are implemented via the common base class, MicrosoftGraphBackend, with only a few minor tweaks (different id parameters, protocol keys, descriptions, etc.)
All three backends support streaming, quota retrieval, and rename.
2018-03-20 14:18:49 -06:00
Tyler Gill c542d65997 Update service agreement and privacy policy link for OneDrive backend. 2018-03-20 14:01:28 -06: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
Rune Henriksen fc77b476fc changed from NYI to null returns. Added check to skip DNS check if no DNSName is provided 2018-02-21 22:38:01 +01:00
Rune Henriksen 00292953c3 added DNSName getter on Backend interface and added NotImplementedException methods on each backend class 2018-02-18 00:18:44 +01:00
osmogar 8f1f972f09 A malfunction OneDrive account can retrieve a inconsistent list of files when we fetches a partial list of objects through the onedrive rest api. Retries the download of the file list until all files are listed 2018-01-26 14:22:32 +01:00
Kenneth SkovhedeandGitHub 36aadc4ad1 Merge pull request #2910 from warwickmm/refactor/remove_redundant_tostring
Remove redundant calls to ToString
2017-11-27 08:50:00 +01:00
Kenneth Hsu 5fb1958ceb Remove redundant calls to ToString. 2017-11-26 15:44:34 -08:00
Kenneth Hsu 8810e0130d Make string comparisons use ordinal (binary) sort rules.
These string comparisons should not be culture-aware.
2017-11-26 11:19:54 -08:00
Kenneth Hsu 3d51e9153b Avoid signing assemblies.
Using strong-named assemblies can cause difficulties with the GNU LGPL
license, which allows for one to recombine or relink their application
with modified versions of the code.  While one solution is to share the
private key so that people can sign the assemblies themselves, this
would break the trust that is expected from signed assemblies.  For now,
the easiest fix is to simply not sign the assemblies.  Note that by
doing so, we prevent the code from being referenced from other signed
assemblies.

This also fixes an issue introduced in revision ba94d36a80 ("Added
auto-update for WindowsService and Service."), where the WindowsService
project (signed) referenced the AutoUpdater project (not signed).

We also removed instances of <SignAssembly>false</SignAssembly> to be
consistent with newly created .csproj files that do not contain the
SignAssembly element.

This was motivated by the discussion in issue #2814.
2017-10-15 22:00:23 -07:00
Tyler Gill 44c53d3eb1 Merge branch 'master' of https://github.com/duplicati/duplicati into fix/list-ienumerable 2017-09-25 23:19:38 -06:00
Tyler Gill 38883285ee Change IBackend.List() to return IEnumerable instead of List
By changing to IEnumerable, it is possible to iterate only a portion of the list, which is useful when not all entries are needed (e.g., when testing a connection).
All existing backends have been updated, and any which were able to be changed to yield return results in a straightforward way now do.
Many backends had a try/catch in the List() method. Due to the fact that yield returns can't be placed within a try/catch block, these have been refactored to either scope the try/catch to the parts that (should) be the only places throwing exceptions, so that exceptions are still caught and handled.
Note that lazy evaluation may cause some changes in behavior - exceptions that were previously thrown at the point of invokation of List() may now be thrown while it is being enumerated.
I believe this will not be problematic though, as the only well-known exception seems to be FolderMissingException, which should be thrown by Test(), but TestList() attempts to enumerate the list to force this exception.
Any places that require the legacy behavior can get it by simply converting the lazy enumerable to a List()
2017-09-25 23:17:45 -06:00
Tyler Gill b4f56750f8 Add IQuotaInfo interface
It also makes quota enabled backends return an instance of this interface instead of the quota components separately.
This way, getting quota stats requires only a single remote request on backends like Google Drive and OneDrive.
2017-09-24 17:30:52 -06:00
Kenneth Skovhede 6c921ab3ec Merge branch 'master' of github.com:duplicati/duplicati 2017-09-23 22:01:08 +02:00
Kenneth Skovhede a06f38442a Updated all Newtonsoft.Json packages 2017-09-23 00:25:50 +02:00
Tyler Gill 7c3ce32ee2 Add support for the quota reporting and renaming interfaces to the OneDrive backend.
To test the quota support, quota information is reported on the command line if it is available.
However, the rename support hasn't been tested, since I don't see anything using that functionality yet.
2017-09-22 00:30:10 -06:00
Tyler Gill 83a1dcfb64 Replace all instances of InvariantCultureIgnoreCase with OrdinalIgnoreCase in string comparisons.
InvariantCulture is useful when comparing / sorting human language strings in a culturely correct way. It handles things like accented letters in a way that makes sense to humans (e.g., 'a' should be sorted next to 'á', rather than after 'z').
Ordinal looks just at the raw code points of the characters. As such, it is recommended for use in cases when comparing system strings (file paths, command line parameters, config settings, etc.). Since it doesn't need to use the culture specific sorting rules, this method can often be faster.

For more information, see https://stackoverflow.com/questions/492799/difference-between-invariantculture-and-ordinal-string-comparison (and other related questions)
2017-09-18 23:55:08 -06:00
Kenneth Skovhede 046b522a8d Updated NewtonSoft.Json 2017-05-17 11:08:51 +02:00
Kenneth Skovhede 52eb8e8478 Disabled MSBuild for much faster builds on MacOS 2016-12-29 23:12:41 +01:00
Kenneth Skovhede 0c68daff6c Fixed all whitespace to be 4 spaces instead of tabs 2016-09-15 11:39:27 +02:00
Kenneth Skovhede bde606ae60 Updated packages 2016-06-27 15:30:25 +02:00
Kenneth Skovhede 3005594b38 Merge branch 'master' into nuget_setup
# Conflicts:
#	Duplicati/GUI/Duplicati.GUI.TrayIcon/Duplicati.GUI.TrayIcon.csproj
#	Duplicati/Library/Backend/S3/Duplicati.Library.Backend.S3.csproj
#	Duplicati/Library/Backend/S3/S3Wrapper.cs
#	thirdparty/CoCoL/CoCoL.dll
#	thirdparty/SSH.NET/Renci.SshNet.dll
2016-06-27 15:25:52 +02:00
Kenneth Skovhede d0711011a2 Rewrote all WebRequest code to use AsyncHttpRequest, and normalized usage such that WebResponse objects are always correctly disposed. 2016-04-16 11:12:28 +02:00
Kenneth Skovhede 848dd7c85d Fixed a few issues where reporting the error message would cause an exception that masks the real error 2016-04-13 10:54:29 +02:00
Kenneth Skovhede 785c4d325f Reverted changes to solution file so it again forces Windows linefeeds.
This also moved stuff around in some project files.
2016-04-13 00:36:22 +02:00
Kenneth Skovhede 59cc0005a3 Removed unused references and updated most libraries to come from NuGet sources instead of being provided in the thirdparty library 2016-01-29 10:47:39 +01:00
Kenneth Skovhede cb8c89d748 Fixed an issue with OneDrive not throwing the correct exceptions on FileNotFound 2015-11-17 12:35:07 +01:00
Kenneth Skovhede 1d3d24f2a4 Renamed the SkyDrive class to OneDrive. 2015-06-29 22:38:47 +02:00
Kenneth Skovhede 678f0ceb24 Fixed some file-size limits and a missing counter in OneDrive BITS transfer 2015-06-27 01:11:25 +02:00
Kenneth Skovhede 4a299c8500 Updated the OneDrive backend to use the shared OAuth library.
Updated the OneDrive backend to support BITS transfer of large files.
This closes #1222
2015-06-25 20:35:21 +02:00
Kenneth Skovhede b68290b95a Follow up to the latest pull request, changed all references to HexaD to "Duplicati Team" 2015-05-17 11:06:07 +02:00