Commit graph

171 commits

Author SHA1 Message Date
abraunegg 83c28ba3b6
Fix: Multiple versions of file shown on website after single upload (Issue #2) (#40)
* Resolve multiple versions of file shown on website after single upload - however Issue #23 & OneDrive API bug (https://github.com/OneDrive/onedrive-api-docs/issues/877) will still create 2 file versions on OneDrive Business. The work around is to disable file versions until #877 is resolved.
2018-07-03 07:24:57 +10:00
abraunegg 17e5138b5a
Resolve sync issues with Shared Folders & Personal OneDrive Accounts (#26)
* Resolve Shared Folders not syncing (OneDrive Personal)
* Resolve 'Key not found: fileSystemInfo' when then item is a remote item (OneDrive Personal)
* Resolve where file names are being truncated by 5 characters with each sync (OneDrive Business)
* remove extra // not required
* Remove commented out code to avoid confusion
2018-06-17 12:02:58 +10:00
abraunegg d6b4930d0a Revert "Resolve: Key not found: fileSystemInfo when syncing shared folders"
This reverts commit e7267e597b.
2018-06-13 16:35:52 +10:00
abraunegg e7267e597b Resolve: Key not found: fileSystemInfo when syncing shared folders
* Resolve #11 where shared folders were unable to be sync'd due to fileSystemInfo data being within the remoteItem object
* Initial work on resolving #2, but fix not validated or complete
2018-06-09 21:43:39 +10:00
abraunegg 41976ed216 Update long path handling
* Update long path handling to account for differences between OneDrive Personal and OneDrive Business Accounts
* Update logging to be cleaner on fragment uploads
2018-05-09 06:47:03 +10:00
abraunegg 0b5dc66507 Rework OneDrive generating a 412 'Precondition Failed' Error
* Rework the 412 fix so that the OneDrive client gracefully handles the
error & retries the metadata update without the eTag/cTag causing the
issue.
* Fix the double logging to console of 'upload' and 'download' items
2018-05-03 16:21:53 +10:00
abraunegg 034eccfaec Resolve #132 - Couldn't resolve host name on handle
* By default the DNS timeout on HTTP.method is too short. If DNS
resolution takes too long, a resolution error is thrown. Increase DNS
timeout to 5 seconds.
* Cleanup unittest - double declaration
2018-04-24 12:10:27 +10:00
abraunegg dff245d29b Resolve 'view.delta can only be called on the root'
* Resolve the error 'view.delta can only be called on the root' when
using OneDrive Business Account & --single-directory switch
* Change checkDatabaseForOneDriveRoot so that it is performed at init()
and not needed to be called a number of other times throughout the code
- leads to less HTTPS calls being made
* Cleanup comments that are no longer relevant due to
checkDatabaseForOneDriveRoot being run at init()
2018-04-23 10:58:47 +10:00
abraunegg 8a059dc0e1 Revert "Switch to using list_children for an item id's children"
This reverts commit fedaedacd7.
2018-04-21 07:19:04 +10:00
abraunegg fedaedacd7 Switch to using list_children for an item id's children
* Change how onedrive get's the children from a particular item id.
Previously view.delta was used to return the children, however
view.delta is not implemented on children when using OneDrive Business
accounts. By using list_children, we can get the children from any id
correctly when using either a 'personal' or 'business' account
2018-04-19 14:31:35 +10:00
abraunegg 5cb92c01b9 Expand HTTPS debug to include GET JSON responses
* Change debug flag from --debug-http to --debug-https as OneDrive only
uses HTTPS, not HTTP
* Expand --debug-https to print the JSON responses to GET operations.
This is to assist with debugging #334 where a change in the MS API
(https://github.com/OneDrive/onedrive-api-docs/issues/834) no longer
sends 'lastModifiedDateTime' with responses to some GET's. This issue
seems to manefest itself with OneDrive Business accounts currently.
2018-04-15 20:02:39 +10:00
abraunegg 8463e60acc Update onedrive.d to remove '&'
Change '&error' to 'error' on line 37 of onedrive.d

Issue uncovered where prior code with '&' would compile without issue on
DMD reference compiler v2.078.3 and below, but using '2.079.0' this
would throw an error if '&' was present.

The original patch added the '&' to get the code to compile, this simple
reverts this change.

Note: For future reference compile this code with DMD v2.079.0 or later.
2018-03-30 08:14:00 +11:00
abraunegg dd73ae3c4b OneDrive Client Changes
* Fix 4xx errors including (412 pre-condition)
* Add Logging - log to a file (/var/log/onedrive/onedrive.log)
* Add http(s) debugging as a flag
* Add dont sync when just blindly running the application
* Add individual folder sync - ie ~/OneDrive/blah/ vs. syncing
everything in ~/OneDrive/
* Add sync from local directory first rather than download first then
upload
* Add upload long path check (430 character limitation)
2018-03-14 15:43:40 +11:00
skilion d9a5d1b3b9 fix regex for parsing authentication uri 2018-01-20 21:13:01 +01:00
Mikael Göransson a1e326f9b4 invalid_grant, error 70000
when trying to redeem an code, this error always occured, no matter
which parts of the response uri/url that was used.

the old regexp for parsing the code contained 3 groups, where as the
actual code always was the last group, and the second group was either ?
or &, and the first group would've been everything up until "code=".

changed from a matching group to character class so there would only be
two matching groups, so calling popFront() would actually leave the
authorization code in the front.
2018-01-20 20:51:33 +01:00
skilion 867c8ed26c improved regex 2018-01-19 18:56:14 +01:00
skilion 9f7d9249bc restore prev redirect url 2018-01-02 16:32:16 +01:00
skilion fba3ed999e handle large uploads with parent id 2017-12-31 16:11:02 +01:00
skilion c8d5e03be8 upload files new with parent id 2017-12-31 13:47:18 +01:00
skilion 6907daa5e8 create dir with parent id 2017-12-31 13:18:11 +01:00
skilion b7adc4d0cc WIP on remote folders 2017-12-31 02:30:31 +01:00
skilion 35ce743b39 removed exception chaining 2017-12-28 15:03:15 +01:00
skilion d9c9915bc3 update API to use full item addressing 2017-12-27 15:12:38 +01:00
lanhin 8f5f54f6a1 Merge branch 'master' of github.com:skilion/onedrive 2017-06-22 22:25:04 +08:00
skilion 9e2123249a do not check token status during initialization 2017-06-15 13:02:04 +02:00
skilion c2815d6498 fix indentation 2017-05-29 01:14:22 +02:00
skilion 691862b18f implement the recommended way to enumerate changes 2017-05-28 20:54:57 +02:00
skilion 3d8daa086d added --print-token 2017-05-28 20:14:50 +02:00
lanhin 79139600ac Merge branch 'master' of github.com:skilion/onedrive
This may fix some up load problems.
2017-04-24 13:45:52 +08:00
skilion 0d69ed805d wip for OneDrive Biz 2017-03-21 18:11:32 +01:00
skilion 8b204d18b4 hardcode the client id 2017-03-12 10:30:31 +01:00
skilion ac555fd574 added missing scope 2017-03-11 14:52:33 +01:00
skilion 1260fcfcc1 fix addressing root by path 2017-03-11 13:34:07 +01:00
skilion 1beadf2577 switch to Microsoft Graph API 2017-03-11 11:44:53 +01:00
skilion 0afb6fa392 workaround for error 412 (Precondition Failed) on item delete 2016-12-28 23:47:29 +01:00
skilion 6a7c30e34f added missing checkAccessTokenExpired() in createByPath 2016-12-28 16:29:55 +01:00
skilion ad4e910e55 check if the token is valid on init 2016-12-25 17:40:43 +01:00
skilion 9ad9394b98 better handle the case when cTag is null 2016-12-25 17:40:43 +01:00
skilion 7257c4c9bf do not throw on expired status token 2016-12-14 15:17:20 +01:00
skilion 947136cf62 show onedrive error response 2016-12-13 18:04:16 +01:00
lanhin 7c112304b5 Bug fixed: 1. Replace mkdirRecurse with mkdir to deal nested directory;2. Before download an item, check if its dirName exists, if not, build it. 2016-11-23 23:10:37 +08:00
skilion 738536736a Refactoring
- unified configs
- logging module
- new cmd line option to change the config dir
2016-08-04 23:43:10 +02:00
skilion 7d700e1a4c ask for the response uri one time only 2016-06-30 12:51:44 +02:00
skilion 18b279a339 restored AVOverride 2016-06-29 21:41:44 +02:00
skilion 0efc2fe382 use view.delta instead of view.changes
removed dependency on client_secret
2016-06-27 19:23:14 +02:00
Jonathon M. Abbott 8b68adf8dd Ignore antivirus errors when downloading files
- closes #31
2016-04-01 22:45:42 +10:00
skilion 880af3ec03 changed redirect_url to redirect_uri 2016-03-07 14:34:35 +01:00
skilion 89452985ec workaround for segfault in std.net.curl.Curl.shutdown() on exit 2016-03-07 14:04:08 +01:00
skilion c2b0b7f733 intercept curl exceptions 2015-12-29 19:38:15 +01:00
skilion ea970890a2 capability to run as service 2015-11-29 21:12:44 +01:00
skilion 32009e2747 responses are encoded in UTF-8 2015-10-04 17:33:48 +02:00
skilion e7d493807d reimplemented std.net.curl basic methods in order to intercept http status codes 2015-10-04 16:24:45 +02:00
skilion 9b80d99ad4 support for files bigger than 100 MB and resumable uploads 2015-09-28 13:25:25 +02:00
skilion 88b11433a7 removed space from auth url 2015-09-27 18:56:50 +02:00
skilion f7e4b2f1e3 fixed acces to json nested objects 2015-09-22 16:14:16 +02:00
skilion 1c21474301 more error handling 2015-09-22 11:52:28 +02:00
skilion 21993b36ee removed useless destructor 2015-09-22 10:56:14 +02:00
skilion 7ea7c0f9cd case insensitive patterns 2015-09-21 13:04:05 +02:00
skilion 4d230a394c finalizing 2015-09-17 00:16:23 +02:00
skilion f887b29061 sync root folder 2015-09-16 10:29:20 +02:00
skilion 2d4cf32be5 refactoring 2015-09-14 23:56:14 +02:00
skilion ff07f13cd6 command line options 2015-09-14 19:21:06 +02:00
skilion 20dbc9795c upload should fail if the file already exists 2015-09-07 13:28:15 +02:00
skilion f8e87a2d4f removed old code 2015-09-06 13:00:05 +02:00
skilion 84f6d59813 added createByPath 2015-09-06 11:06:13 +02:00
skilion 61c5ea7789 added deleteById 2015-09-06 10:23:32 +02:00
skilion a732845db3 renamed check to checkHttpCode 2015-09-06 10:07:18 +02:00
skilion 60a5b799f9 added updateById 2015-09-05 21:23:43 +02:00
skilion 8b7cf7a58d removed useless dup 2015-09-02 11:20:42 +02:00
skilion 8cddcf3b80 renew access token after expiration 2015-09-01 22:23:42 +02:00
skilion 00d53f648e first commit 2015-09-01 20:47:44 +02:00