Commit graph

728 commits

Author SHA1 Message Date
abraunegg 540c2369f3
Fix error 'Key not found: remaining' with Business Shared Folders (#1713)
* Fix an API regression where the 'remaining' value for some API responses is no longer present in the 'quota'  JSON response
2021-11-22 17:42:29 +11:00
abraunegg cceb3cccdd
Do not re-auth on --logout (#1705)
* When issuing a --logout, do not perform a reauthentication of the application
2021-11-17 06:05:11 +11:00
abraunegg 6febb13408
Catch unhandled API response errors when listing OneDrive Business Shared Folders (#1704)
* When listing OneDrive Business Shared Folders, try the API query and catch any API error response, rather than blindly attempting the API query
2021-11-17 05:51:30 +11:00
abraunegg 2f660ff7b0
Catch unhandled API response errors when querying OneDrive Business Shared Folders (#1703)
* When syncing OneDrive Business Shared Folders, try the API query and catch any API error response, rather than blindly attempting the API query
2021-11-16 19:48:44 +11:00
Kleckkinator 4d25e68c65
Added operation_timeout as a new configuration (#1685)
* Added operation_timeout as a new configuration
2021-11-10 07:46:41 +11:00
abraunegg f3f04be2dc
Always prompt for credentials on authentication (#1673)
* Ensure that each time the authentication URL is used, we prompt for credentials, rather than using any cached credentials in the browser
2021-11-02 06:58:12 +11:00
abraunegg 606ee52ad2
Fix edge case with OneDrive Personal Shared Folders (#1586)
* In a `--resync --upload-only --single-directory 'dir'` scenario, and where the root 'dir' for --single-directory is a 'shared folder' we will not have the 'tie' DB entry created because of using --upload-only because we do not download the folder structure from OneDrive. As a result, query of the folder will fail and file uploads will fail.

Simulate the 'tie' DB record only when --resync --upload-only --single-directory 'dir' is being used, and if that folder is 'remote' and if we are using a 'personal' account.

The 'impact' of this however is, because of `--resync --upload-only` being used, local files are not in the local DB cache anymore, thus are treated as *new* files, thus, will be attempted to be re-uploaded.
2021-07-22 08:17:02 +10:00
abraunegg 8a20275dd2
Fix getPathDetailsByDriveId query when using --dry-run and a nested path with --single-directory (#1583)
* Fix getPathDetailsByDriveId query when using --dry-run and a nested path with --single-directory
* Fix fake response generation to use generated values for all account types to avoid DB lookup failures when using --dry-run for Personal account types
2021-07-20 13:27:35 +10:00
abraunegg 6d92bc8210
Fix that Business Shared Folders with parentheses are ignored (#1560)
* Fix issue where matching a OneDrive Business Shared Folder that contains '()' is not matched correctly
2021-07-13 18:31:48 +10:00
abraunegg 1fbe1d34a7
Fix application crash due to a conversion overflow when calculating file offset for session uploads (#1558)
* Fix an unhandled application crash when calculating the required offset for a file fragment size when resuming a session upload
2021-07-12 05:59:32 +10:00
c-maia 7171b83f5b
Fix error message when deleting a large number of files (#1559)
"delete" word appears twice in the error message. This commit removes the extra "delete".
2021-07-11 07:37:57 +10:00
abraunegg 54a6575709
Fix application crash due to invalid UTF-8 sequence in the pathname for the application configuration (#1551)
* Catch a Invalid UTF-8 handling error when attempting to initialise the application. This is caused by the 'path' to the application configuration (typically ~/.config/onedrive) contains a bad UTF-8 character thus cannot be read / initialised
2021-07-07 06:26:52 +10:00
abraunegg fc5d7f9327
Fix application crash and incorrect handling of --single-directory when syncing a OneDrive Business Shared Folder due to using 'Add Shortcut to My Files' (#1542)
* When syncing OneDrive Business Shared Folders and using --single-directory, select correct driveId and itemId for the remote directory that needs to be synced
* Normally, the 'remoteItem' field will contain 'fileSystemInfo' however, if the user uses the 'Add Shortcut ..' option in OneDrive WebUI to create a 'link', this object, whilst remote, does not have 'fileSystemInfo' in the expected place, this leading to a application crash
2021-07-06 18:11:53 +10:00
abraunegg e236c7cf12
Handle OneDrive API Bad Request response when querying if file exists (#1535)
* Add exception handling for when the API returns a 400 error when attempting to query a path on OneDrive. If the path generates a 'bad request' response, this needs to be correctly handled.
2021-07-01 06:18:48 +10:00
abraunegg 761cf3eb87
Support DMD 2.097.0 as compiler (#1505)
* Support DMD 2.097.0 as compiler and resolve deprecation messages
2021-06-07 08:26:36 +10:00
abraunegg b0771f79e1
Fix application crash when SharePoint displayName is being withheld when using --get-O365-drive-id (#1445)
* Handle bad ShaprePoint data when the API does not return the expected data points when using those references to display what SharePoint sites are available when using --get-O365-drive-id
2021-05-10 08:04:14 +10:00
abraunegg c9ca00466a
Add file check when adding item to database if using --upload-only --remove-source-files (#1437)
* Add a file check when using --upload-only --remove-source-files so that parental paths are added to the database, to allow child objects to be uploaded in this scenario
2021-05-06 06:00:55 +10:00
abraunegg b7eedbd8cd
Fix that options --upload-only & --remove-source-files are ignored on an upload session restore (#1399)
* Fix that options --upload-only & --remove-source-files are ignored on an upload session restore
2021-04-12 06:16:23 +10:00
abraunegg 3d5957986a
Fix 'sync_list' handling of inclusions when name is included in another folders name (#1390)
* Fix 'sync_list' handling of inclusions when name is included in another folders name to avoid creating empty parental root folders. When a 'sync_list' entry ends with '/*' the common path matching causes a sub path match to occur. Before directly hitting as an exact match, perform an additional check of the path to sync against the sync_list entry without the '/*' being present.
2021-04-09 08:18:00 +10:00
abraunegg 615aa05b42
Fix an unhandled Error 412 when uploading modified files to OneDrive Business Accounts (#1394)
* Update error 412 handling when uploading modified files to OneDrive Business Accounts
2021-04-09 06:21:01 +10:00
abraunegg 94cc6ee3d6
Revert #1343 as OneDrive API is now fixed in relation to handling '%' within filenames (#1386)
* Revert #1343 as OneDrive API is now fixed in relation to handling '%' within filenames
2021-04-06 20:34:03 +10:00
abraunegg 1203aebeb7
Fix file kept in database when using --no-remote-delete & --remove-source-files (#1383)
* Fix file kept in database when using --no-remote-delete & --remove-source-files
2021-04-06 06:43:19 +10:00
abraunegg b1b814f10a
Fix uploading documents to Shared Business Folders when shared folder exists on a SharePoint site (#1352)
* Fix uploading documents to Shared Business Folders when shared folder exists on a SharePoint site due to Microsoft Sharepoint 'enrichment' of files

See: https://github.com/OneDrive/onedrive-api-docs/issues/935 for further details
2021-03-27 07:31:03 +11:00
abraunegg 5c8083001a
Update logging output to handle directory entries only (#1364)
* When in --monitor mode, avoid outputting misleading logging when the new or modified item is a file, not a directory
2021-03-27 07:29:08 +11:00
abraunegg fd04d632d6
Fix application crash when unable to rename folder structure due to unhandled file-system issue (#1366)
* Fix application crash when unable to rename folder structure due to unhandled file-system issue
2021-03-27 07:28:40 +11:00
abraunegg 6b20478635
Fix 'Item cannot be deleted from OneDrive because it was not found in the local database' (#1354)
* When in --monitor mode, and there are multiple driveId being used (shared folders), when a deletion event occurs, search the DB using all the known driveids rather than just the default one. When using just the default driveid, if the file to be deleted resides on another drive, the following error message is printed: 'Item cannot be deleted from OneDrive because it was not found in the local database' - which is not entirely accurate as the item is in the database, it is just not being searched for correctly.
2021-03-19 17:29:55 +11:00
abraunegg 0dcc76f9f1
Update 'Skipping shared folder due to existing name conflict' check for Business Shared Folders (#1351)
* Update 'Skipping shared folder due to existing name conflict' check for Business Shared Folders
2021-03-18 13:24:26 +11:00
abraunegg 037a6b43e1
Support multiple 'document libraries' within a single Shared Library Site (#1350)
* Support providing the 'drive_id' for multiple 'document libraries' within a single Shared Library Site
2021-03-17 18:23:01 +11:00
abraunegg 6bec0ddc64
Correctly handle files which contain '%' as invalid files (#1343)
* Fix checking filenames which contain '%' which should be classified as invalid based on the MS OneDrive API Invalid characters designation
2021-03-15 16:24:55 +11:00
abraunegg b8717fbc53
Use 'nextLink' value if present when searching for specific SharePoint site names (#1329)
* Use 'nextLink' value if present when searching for specific SharePoint site names
* Update error output to provide more details why an error occurred if a SharePoint site lacks the details we need to perform the match
2021-03-13 05:11:44 +11:00
abraunegg 7786a17915
Remove depreciated config option 'force_http_11' (#1323)
* Remove depreciated config option 'force_http_11' which was flagged as depreciated by PR #549 in v2.3.6 (June 2019).
2021-03-08 07:17:48 +11:00
abraunegg f107427480
Fix 'sync_list' path handling for sub item matching (#1317)
* Fix 'sync_list' path handling for sub item matching, so that items in parent are not implicitly matched when there is no wildcard present
2021-03-05 09:15:44 +11:00
abraunegg 81e40ba76d
Update 429 retry-after response handling (#1305)
* Always check the response headers when a 429 response is returned from OneDrive, so that the 'retry-after' value is correctly consumed and used
2021-03-03 11:12:27 +11:00
abraunegg 1078795d6f
Fix support for '/*' regardless of location within sync_list file (#1293)
* Fix support for '/*' regardless of location within sync_list file
2021-03-02 14:28:31 +11:00
abraunegg 42b7945d9c
Support sync_list matching full path root wildcard with exclusions to simplify sync_list configuration (#1273)
* Support sync_list matching full path root wildcard with exclusions to simplify sync_list configuration
2021-02-14 08:55:49 +11:00
abraunegg cd7b7b0b68
Use correct path offset for sync_list exclusion matching (#1269)
* When processing sync_list entries, by default, if the path starts with '/', and offset of 1 is used to ensure correct path matching can be done. However, if the path starts with '!/' or '-/' to exclude a certain path, an offset of 1 was still being used, thus, exclusion matching was not occurring correctly. Use the correct offset, based on the 'sync_list' entry.
2021-02-14 06:43:55 +11:00
abraunegg 3ea16b619f
Revert the config & logpath change and check correct input entry (#1270)
* Revert the config & logpath change introduced via #1267 as the logging path should not be the value checked, the input path is what should be checked
2021-02-13 17:37:22 +11:00
abraunegg f37fdda836
Fix logging output when handing downloaded files (#1267)
* Fix logging output when processing downloaded files to remove potential ambiguity as to what events are actually occurring with individual file events post download
2021-02-11 04:07:45 +11:00
abraunegg 1bfd995153 Revert "Fix logging output when handing downloaded new files (#1265)"
This reverts commit 99a0f4bfed.
2021-02-10 13:33:32 +11:00
abraunegg 99a0f4bfed
Fix logging output when handing downloaded new files (#1265)
* Fix logging output when processing files to remove potential ambiguity as to what events are actually occuring with indivudual file events
2021-02-10 13:26:10 +11:00
abraunegg 66a172d13a
Correctly handle '~' when present in 'log_dir' configuration option (#1258)
* Handle '~' when present in 'log_dir' and expand based on user and shell environment  variables to ensure correct expansion.
2021-02-06 20:46:56 +11:00
abraunegg 2c253362bf
Improve upload handling of files for SharePoint sites (#1250)
* After a file has been uploaded to SharePoint, use the response JSON and compare the quickXorHash to that of the local file before the upload. If there is a difference, Microsoft has modified the file post upload, thus we now need to download this 'updated' file. If there is no hash difference, we do not need to download the file.
2021-02-01 16:46:12 +11:00
abraunegg 3b87602a81
Use correct driveId value to query for changes when using --single-directory (#1235)
* Use the driveId value rather than defaultDriveId when looking for changes when using --single-directory
2021-01-22 14:38:11 +11:00
abraunegg 6b0b6a66f7
Search all distinct drive id's rather than just default drive id for --get-file-link (#1230)
* Add new DB query to return distinct driveId's from database
* Use all distinct drive ID's to query if path is in-sync with OneDrive before attempting to retreive the item file link from OneDrive
2021-01-20 19:46:56 +11:00
abraunegg 15a84627e1
Support new file maximum upload size of 250GB (#1233)
* Support new file maximum upload size of 250GB
2021-01-20 09:25:59 +11:00
abraunegg cef00e74b2
Catch database assertion when item path cannot be calculated (#1217)
* Catch database assertion when item path cannot be calculated
2021-01-15 14:44:13 +11:00
abraunegg 96d3e68498
Add new config option to rate limit connection to OneDrive (#1210)
* Add new config option to rate limit connection to OneDrive
2021-01-04 08:28:34 +11:00
abraunegg be1757148f
Add upload speed metrics when files are uploaded (#1209)
* Add upload speed metrics when files are uploaded
* Clarify 'data to transfer' is what is needed to be downloaded from OneDrive
2021-01-03 12:20:43 +11:00
abraunegg 62a2b4f393
Fix application crash with --get-O365-drive-id when API response is restricted (#1198)
* Check OneDrive API response for required elements before attempting to use elements for next query
2020-12-23 15:25:59 +11:00
abraunegg 771a93242f
Fix application crash when calculating the path length due to invalid UTF characters (#1193)
* Fix application crash when calculating the path length due to invalid UTF characters
2020-12-21 07:27:27 +11:00
abraunegg ba94b92d8a
Improve application startup when using --monitor when there is no network connection to the OneDrive API (#1188)
* Improve application startup when using --monitor when there is no network connection to the OneDrive API
* Retry network connection test when using --monitor
* Only initialise application if OneDrive API is reachable
2020-12-18 06:17:52 +11:00
abraunegg 9b44bb1e96
Fix crash when unable to read a local file due to file permissions (Issue #1178) (#1179)
* Test if local file is readable based on user permissions before attempting to access file to determine the sync state or upload
2020-12-12 05:58:07 +11:00
abraunegg 5349340818
Add debug log output for configured API URL's (#1177)
* Add to debug log output the configured URL's which will be used throughout the application to remove any ambiguity as to using incorrect URL's when making API calls.
2020-12-10 11:18:13 +11:00
abraunegg 3b18638a63
Remove duplicate code for error output functions and enhance error logging output (#1170)
* Remove duplicate code for error output functions and enhance error logging output
2020-12-09 14:18:16 +11:00
abraunegg 335eab326d
Handle case where API provided deltaLink generates a further API error (#1175)
* Handle case where API provided deltaLink generates a further API error. Refer to: https://github.com/OneDrive/onedrive-api-docs/issues/1408
2020-12-09 14:03:49 +11:00
abraunegg 88f78c163f
Fix application crash in --monitor mode due to 'Failed to stat file' when setgid is used on a directory (#1157)
* Add debugging output when adding paths and items to an inotify watch
* Only if a path is a directory, perform a path walk
* Catch Exception as error when permissions cause access exception
2020-11-26 06:35:20 +11:00
abraunegg 48fc64a247
Check application_id before setting redirect URL when using specific Azure endpoints (#1165)
* If using specific AD endpoints, but using the default application ID, the redirect URL does not match. Check if the application_id before setting the redirect URL.
2020-11-26 05:51:29 +11:00
abraunegg a4a5a5f267
Fix logging output when authentication authorisation fails (#1156)
* If OneDrive generates an auth error, dont log that the auth was sucessful
2020-11-21 06:46:05 +11:00
abraunegg ac4da2e2ba
Update #1142 logging output handling (#1153)
* Update logging output to debug rather than standard log
2020-11-20 06:33:47 +11:00
abraunegg 8c23efc6c5
Fix changing permissions on pre-existing local directories (#1152)
* When attempting to create local directories, test to determine if they exist locally first before creating & setting file system permissions
2020-11-20 05:36:20 +11:00
abraunegg 17d5f97cb0
Merge branch 'master' into fix-issue-1137 2020-11-14 06:21:03 +11:00
abraunegg 550ab4b6dd
Use config set option for 'remove_source_files' and 'skip_dir_strict_match' rather than ignore (#1142)
* Remove items from direct config string update, as they are configurable via config file, thus set option via config file is not used
* Add debugging and application config output for used options
2020-11-14 06:17:53 +11:00
abraunegg aa533ef5a4 Update sync.d
* tweak skip message output
2020-11-13 09:52:48 +11:00
abraunegg b59596523e Update sync.d
* Full fix
2020-11-13 08:27:09 +11:00
abraunegg b57bb3fde5 Update sync.d
* Remove this
2020-11-13 08:02:28 +11:00
abraunegg dd989b73d1 Update sync.d
* Flag that this download failed
2020-11-13 07:48:14 +11:00
abraunegg ac02b768d3 catch folder creation errors due to file system permissions error
* catch folder creation errors due to file system permissions error
2020-11-13 07:34:52 +11:00
abraunegg cc2b8085f5 Update error catching and handling
* Update error catching and handling
2020-11-13 05:42:24 +11:00
abraunegg 68cc51ab4d Update onedrive.d
* Remove try block - incompatible with auto designation needed to open file ...
2020-11-12 21:51:07 +11:00
abraunegg aa47f1119f Fix download failure due to incorrect filesystem permissions
* Add try block for opening new file for writing when downloading a new file to catch any read only file systems
* Move set file attributes to master function, incase there is a download failure, exit scope cannot set attributes on a file that is non existent
2020-11-12 21:35:06 +11:00
abraunegg 2c80033c89
Correctly set config directory permissions at first start (#1132)
* When ~/.config/onedrive/ gets created for the first time, directory permissions are not set, thus, effective permissions of 'd---------' get applied. This then causes issues attempting to update the 'refresh_token' as permission is denied.
* When permission is denied, the file exception error is not correctly handled
* Set refresh_token file permissions
2020-11-09 08:06:48 +11:00
mp1994 7a4abfff40
Check if localModifiedTime >= item.mtime: avoid re-upload (#1131)
* Check if localModifiedTime is >= than item.mtime: avoid re-upload for equal modified time

Co-authored-by: abraunegg <alex.braunegg@gmail.com>
2020-11-08 08:44:57 +11:00
abraunegg 57d6753f80
Merge contents of SQLite WAL file into main database file on sync completion (#1128)
* When using WAL and SHM files, certain thresholds are used to automatically determine when WAL and SHM data is committed to the main database file. If these thresholds are not met, the data is not written. Before terminating the program, commit the data, and at the end of each monitor loop, commit the data
* Only try and write data to DB file and destroy variable if it was set to begin with
* Only try and destroy 'onedrive' variable if set, rather than set to null
2020-11-06 10:28:15 +11:00
abraunegg d2193c97f5
Fix uploading data to shared business folders when using --upload-only (#1127)
* Handle uploading new data to a OneDrive Shared Business Folder when using --upload-only and if the shared folder has never been synced before
2020-11-05 05:19:39 +11:00
abraunegg b4c3da6e10
Check the given local path in reverse order for a skip_dir match on --resync (#1125)
* When matching skip_dir entries, if there is no direct first match, perform a reverse directory walk to test each path block for a match
2020-11-05 04:51:35 +11:00
abraunegg 363f64df36
Check for the presence of .nosync when processing DB entries (#1124)
* Add check for .nosync if enabled for directory database objects as these might also be relevant mount points which have 'gone' away
2020-11-04 07:28:40 +11:00
abraunegg 106e114929
Update --list-shared-folders to only show folders (#1114)
* Update --list-shared-folders to only show folders
2020-11-01 10:06:08 +11:00
abraunegg b365ec6322
Cleanup dryrun shm and wal files if they exist (#1121)
* Cleanup dryrun shm and wal files if they exist
2020-11-01 06:55:17 +11:00
abraunegg cf4ee5017f
Configure specific File and Folder Permissions (#1108)
* Configure specific File and Folder Permissions, defaults for new items downloaded from OneDrive:
Directories: 700
Files: 600
2020-10-30 08:00:26 +11:00
abraunegg fe86dd1809
Fix Business Shared Folder handling to process only Business Shared Folders (#1104)
* Update Business Shared Folder handling to process only Shared Folders, not individually shared files
2020-10-26 17:23:24 +11:00
abraunegg 9f60b95eed
Fix logging output for modification comparison source (#1103)
* Fix logging output for modification comparison source
2020-10-23 06:36:14 +11:00
sebastiaopf a3c4ba1b3b
Adding support for authentication w/ single tenant custom applications (#1094)
* Adding support for authentication with single tenant custom applications in OneDrive Business/Enterprise accounts.

When using a custom single tenant application the /common/ part on the authentication URLs needs to be replaced
by the tenant name. This can be configured on the azure_tenant_id setting, but this entry was being ignored unless
a custom azure_ad_endpoint was also set.

* Updated documentation to mention that, when configuring for Single Tenant Applications,
both the Tenant Name and Application ID must be included on the config file.

Co-authored-by: abraunegg <alex.braunegg@gmail.com>
2020-10-10 15:39:04 +11:00
abraunegg b4328db2ef
Update debugging output for /delta changes available queries (#1089)
* Update debugging output for /delta changes available queries
2020-10-07 09:33:00 +11:00
themoox 2f35a33f4f
Allow config to specify a tenant id for non-multi-tenant applications (#1085)
* Allow config to specify a tenant id for non-multi-tenant applications
* Add instructions on how to find your O365 tenant identifier for National Cloud deployments.

Co-authored-by: Ryan Brown <ryan.brown@avarint.com>
Co-authored-by: abraunegg <alex.braunegg@gmail.com>
2020-10-06 08:06:04 +11:00
abraunegg e4d7821026
Handle deletion events for directories when inotify events are missing (#1082)
* Handle the missing inotify events for deleted items as a deletion event when running in --monitor
2020-10-03 09:21:56 +10:00
abraunegg e44e6b4233
Fix uninitialised value error as reported by valgrind (#1075)
* Fix uninitialised value error as reported by valgrind
2020-09-25 12:55:21 +10:00
abraunegg 7684c74600
Handle deletion events when inotify events are missing (#1073)
* Handle the missing inotify events for deleted items as a deletion event when running in --monitor
2020-09-25 08:22:37 +10:00
abraunegg 3604dc6984
Add notification to advise users when the client needs to be reauthenticated (#1046)
* Utilise errorAndNotify function to advise users when the client needs to be reauthenticated
2020-09-25 06:42:44 +10:00
abraunegg 19cf656c19
Implement Feature: Multiple skip_dir & skip_file configuration rules (#1068)
* Implement Feature: Multiple skip_dir & skip_file configuration rules
2020-09-19 07:51:49 +10:00
abraunegg 4809f91655
Implement Feature: Support negative patterns in sync_list for fine grained exclusions (#1065)
* Support negative patterns in sync_list where a new line is matched in a negative manner to be excluded is prepended with a '!' or '-' character to exclude an otherwise included path
2020-09-19 06:59:19 +10:00
abraunegg 1364f36aba
Support wildcard within sync_list entries (#1063)
* Support wildcard within sync_list entries
* Update usage documentation
2020-09-16 17:03:00 +10:00
abraunegg 0c770efa96
Implement Feature: Create shareable link (#1061)
* Implement feature request to create a shareable file link. Default is to create a read-only anonymous link

Co-authored-by: Norbert Preining <norbert@preining.info>
2020-09-14 17:49:50 +10:00
abraunegg 05fc734440
Handle removing child items on OneDrive when parent item responds with access denied (Issue #1041) (#1045)
* Handle removing child items on OneDrive when parent item responds with access denied due to parent folder permissions issue.
2020-09-02 06:23:41 +10:00
abraunegg fa3eb8bc1a
Remove 'Icon' check as no longer valid (#1038)
* Remove 'Icon' check as no longer listed as an invalid file or folder names in OneDrive API documentation
2020-08-28 06:18:56 +10:00
abraunegg 431678753d
Update --single-directory path handling when path does not exist locally (#1031)
* If the requested path for --single-directory does not exist locally, create it rather than display error and exit
2020-08-21 07:06:56 +10:00
abraunegg 2099ec2994
Flag when remaining free space is being restricted (#1029)
* In certain scenarios quota details are restricted, thus, remaining free space tracking is not possible. Flag this is the case rather than report a zero value.
2020-08-20 10:52:46 +10:00
abraunegg 880631982c
Update --single-directory handling of parent path matching (#1014)
* In certain scenarios when using --single-directory (either very first run or with --resync) the parent path for the selected path will not be in the database, thus, all items that should be synced are not. Add another special case handler to handle this scenario.
2020-08-09 15:48:27 +10:00
abraunegg 5907d9eb0a
Update how available free space is tracked when uploading files to OneDrive (#1011)
* Update how available free space is tracked when uploading files to OneDrive and Shared Folders
2020-08-08 08:56:00 +10:00
abraunegg 786446f79b
Fix 'Skipping uploading this new file as parent path is not in the database' when uploading to a Personal Shared Folder (#1009)
* Fix 'Skipping uploading this new file as parent path is not in the database' when uploading to a Personal Shared Folder
* When syncing OneDrive Personal Shared Folders, add the driveId to the driveIdArray
* Rename function to be more representative of what function does
2020-08-06 17:45:10 +10:00
abraunegg 2fe0574bcf
Update Office365 / SharePoint site search query (#1006)
* Update Office 365 / SharePoint site search query and response if query return zero match
2020-08-04 11:03:52 +10:00
abraunegg 928ad9512f
Check shared folder DB entries for matching skip_dir items (#1003)
* Check shared folder DB entries for matching skip_dir items
2020-07-28 07:00:34 +10:00
abraunegg 76ce1036a4
Update when 'Sync with OneDrive is ..' is outputted when in --monitor mode (#999)
* The original intention here was that 'Sync with OneDrive is ...' is outputted when the sync starts / ends in 'verbose' mode, and not added to when not using any 'verbose'. What is occurring is, this is being added when MONITOR_LOG_QUIET threshold is met, which was not the intention. This now fixes when this message is outputted so that it is more reflective of when a sync is being done, when in --monitor mode
2020-07-22 15:56:20 +10:00
abraunegg beb737e903
Fix segfault when moving file when using --monitor (#997)
* Fix segfault when attempting to perform a comparison on an inotify event when determining if event path is directory or file
2020-07-22 06:54:35 +10:00
Mateusz P-K f6002311cd
Improve --single-directory sync performance (#992)
* Remove erroneous 'return' statement which could prematurely end processing all changes returned from OneDrive
* Improve --single-directory sync performance

This commit modifies code inside applyDifferences function,
the part responsible for deleting changes/moving them out
of the selected sync directories. This change makes an HTTP
request responsible for checking whether a changed item still
exists on OneDrive only be sent only if it may in fact influence
whether an item will be deleted from the synced folder or not
or just discarded.

This makes an enormous performance boost, because it limits
redundant HTTP requests that ask about changed items that will
be discarded or not.

Signed-off-by: Mateusz P-K <mateusz.kaplon@gmail.com>
2020-07-21 15:19:41 +10:00
abraunegg 25fd9a1b00
Update the 'Processing XXXX' output to display the full path (#987)
* Update the 'Processing XXXX' output to display the full path, rather than just the item name from the database. In cases where you have the same file or directory name, having the full path where it is present is more informative
2020-07-07 19:51:05 +10:00
abraunegg 810c47fcfe
Increase maximum file size to 100GB (#989)
* In July 2020, Microsoft increased the maximum file size for uploads from 15GB / 20GB for Personal / Business Accounts to 100GB per file for all account types
2020-07-07 19:19:50 +10:00
abraunegg 8c0d43183d
Resolve client 'hang' when attempting to sync a Unix pipe file (#985)
* Resolve client 'hang' when attempting to sync a unix pipe file
2020-07-07 18:05:36 +10:00
abraunegg 48292a0858
Update 'skip_dir' and 'skip_file' pattern matching and handling for --monitor (#986)
* Update 'skip_dir' and 'skip_file' pattern matching and handling for --monitor
2020-07-07 17:39:09 +10:00
abraunegg e23e06305a
Update 'skip_dir' and 'skip_file' pattern matching and handling (Issue #982) (#983)
* Update 'skip_dir' and 'skip_file' pattern matching and handling
2020-07-07 05:17:03 +10:00
abraunegg 41d92ddab5
Process OneDrive Personal Shared Folders only if account type is 'personal' (#972)
* Update code to ensure that OneDrive Shared Folders are processed, only if account type is 'personal'
2020-06-28 10:57:21 +10:00
abraunegg 9cc72c2396
Implement OneDrive Business Shared Folders Support (Issue #459) (#473)
* Implement OneDrive Business Shared Folders Support
2020-06-27 19:10:37 +10:00
abraunegg 650cb97d3f
Simplify code for readability (#961)
* Remove buildNormalizedPath complexity and simplify code
2020-06-21 10:01:24 +10:00
abraunegg d8bfe846c2
Update documentation for --upload-only & --download-only to avoid ambiguity (#960)
* Update wording on --upload-only , --download-only to avoid ambiguity
* Update --upload-only usage example to include --no-remote-delete
2020-06-21 08:09:06 +10:00
abraunegg 93163051f5
Support comments in sync_list file (#958)
* If sync_list contains a comment line, exclude this from sync_list processing
2020-06-20 19:13:46 +10:00
abraunegg 1c10effb9b
Implement support for National cloud deployments (Issue #937) (#938)
* Implement support for National cloud deployments as per https://docs.microsoft.com/en-us/graph/deployments
2020-06-17 07:57:14 +10:00
Christian Ponte-Fernández 3b85d574e0
Implement recursive deletion when Retention Policy is enabled (#955)
* Implement recursive deletion when Retention Policy is enabled
2020-06-17 06:49:43 +10:00
Christian Ponte-Fernández 9e020f05cc
Fix segfault when moving folder outside the sync directory when using --monitor (#957)
Fix segfault when moving folder outside the sync directory when using --monitor on Arch Linux
2020-06-17 06:28:55 +10:00
abraunegg e321c373fd
Handle a 'race' condition to process inotify events (#948)
* Handle a 'race' condition to process inotify events generated whilst performing DB or filesystem walk
2020-06-12 06:46:59 +10:00
Liran 46c91bac6e
Added support for loading system configs if there's no user config. (#914)
* Added support for loading system configs if there's no user config file supplied. Uses application defaults if corrupt.
* Update documentation to indicate where config files can be stored & read from
2020-06-05 14:49:31 +10:00
abraunegg 203da2dfb8
Perform initial sync at startup in monitor mode (#946)
* If starting the application up, dont wait for monitor_interval to elapse before first sync attempt
2020-06-05 06:49:23 +10:00
abraunegg df361b261b
Update message output for performFullItemScan or oneDriveFullScanTrigger (#945)
* Update message output depending on if performFullItemScan or oneDriveFullScanTrigger was set
2020-06-05 06:45:19 +10:00
abraunegg b7f69e2541
Update logfile output spacing (#944)
* Update logfile output spacing
2020-06-05 06:00:42 +10:00
abraunegg 8376a360cc
Check if symbolic link is relative to location path (#942)
* If a symbolic link is 'relative', it is relative to the path where the symbolic link exists, not the current working directory. Test if the failed symbolic link read is due to the link being relative, and advise accordingly.
2020-06-02 13:46:57 +10:00
abraunegg d33443cb4f
Add inotify event debugging (#941)
* Add inotify event debugging
2020-05-29 19:30:03 +10:00
abraunegg f0c5ca95c6
Update logging output of skipped files (#932)
* Normalise output when specifying a particular file which is being skipped
2020-05-26 19:53:35 +10:00
abraunegg aee2052f1e
Strengthen data preservation checks & update how bypass preservation is set (#931)
* Strengthen bypass data preservation variable checks
* If a file is modified locally, and '--resync' is used, there is no way to tell if this file is a failed download or 'valid' thus potentially lead to a data loss scenario. In this case, and ONLY if --resync was issued, rename the local file for data preservation
2020-05-26 17:04:22 +10:00
abraunegg f9c3ccc311
Add developer option to display sync options (#924)
* It may be desirable to see what options are being passed in to performSync() without enabling the full verbose debug logging. This has been useful when tracking down 'sync_list' / sync issue & other performance related items without having to enable full verbose debugging to see what is going on
2020-05-25 11:30:04 +10:00
abraunegg 0096e7efce
Add file validation for moved / renamed files (#929)
* When renaming a file locally, ensure that the target filename is valid before attempting to upload to OneDrive
2020-05-25 10:51:57 +10:00
abraunegg b9dd8c754d
Add debugging output for retry wait time (#928)
* Add debugging output for retry wait time
2020-05-24 17:39:28 +10:00
abraunegg cd07414e7b
Change monitor interval default to 300 seconds (#923)
* Having a 45 second default between monitor sync loops is too short. If there are a large number of files on the system (30K+) local file integrity checks take longer than 1 minute to complete, thus, it will seem like the system is 'forever' processing. Changing this to 300 seconds between sync loops is a more sane default.
2020-05-21 11:08:07 +10:00
abraunegg fc90ccb425
Implement 'bypass_data_preservation' enhancement (Issue #824) (#831)
* On some Linux distributions, the file system search tool locally modifies certain files after indexing. Even though the file contents has not changed, the file itself has, as the local modified timestamp has been updated. This then causes timestamp checks to be invalid. To ignore this in cases where this is occurring, configure 'bypass_data_preservation' to 'true' in the config file and local data protection rules will be ignored.
* Add warning to application startup if 'bypass_data_preservation' has been enabled
2020-05-21 06:48:02 +10:00
abraunegg 060a42ab77
Remove double scan of OneDrive when using --monitor --resync at application startup (#920)
* Remove double scan of OneDrive when using --monitor --resync at application startup
2020-05-20 13:15:43 +10:00
abraunegg 206ab8f516
Resolve issues identified by Valgrind (#910)
* Resolve issues identified by 'valgrind' where possible
2020-05-20 11:37:11 +10:00
abraunegg 9933d459ed
Check if configuration file exists before trying to load it (#909)
* Check if configuration file exists before trying to load it
2020-05-20 11:31:30 +10:00
abraunegg 2f22d38cb0
Fix module std.digest.digest is deprecated (#916)
* Fix module std.digest.digest as this is deprecated when using DMD 2.092 and above
2020-05-12 10:50:36 +10:00
abraunegg 2529b99265
Update enforce statement for parent id database query (Issue #912) (#913)
* Update database enforce check with conditional check on parent drive ID. If the parent is a shared folder, the parent ID will never be in the database as we are never provided that parent ID.
2020-05-10 05:42:46 +10:00
abraunegg cb06395a46
Catch unhandled MonitorException when inotify throws an error (Issue #903) (#905)
* Catch uphandled MonitorException when inotify throws an error
* Change monitor loop init full scan to false at start as fullScanOverride now correctly handled, negating need to true-up at application start
* Handle '100 Continue' response during upload
* Update handling of delta link being expired
* Update progress bar handling for uploads as #888 changed bar dynamics
2020-05-06 07:20:13 +10:00
abraunegg eda3d3c4bb
Better handle out-of-space message (#907)
* Better handle out-of-space message when OneDrive is out of space
2020-05-05 15:04:59 +10:00
abraunegg dcc0322cac
Update how './' is stripped from a path before check if excluded (Issue #901) (#902)
* Update how './' is stripped from a path before check if excluded
2020-05-02 04:46:44 +10:00
abraunegg bc9f2cf893
Update handling of fullScanRequired and syncListConfiguredFullScanOverride (Issue #896) (#899)
* Change 'syncListConfigured' to 'syncListConfiguredFullScanOverride' as this is what this variable
* Update handling of fullScanRequired and syncListConfiguredFullScanOverride
* When a 429 or 504 is generated when querying for 'changes' inside a changeset bundle, dont restart scanning changes from the beginning, retry original request after a delay
2020-05-02 04:05:06 +10:00
abraunegg a61d291340
Update #658 & #865 handling as when to setOneDriveFullScanTrigger (Issue #896) (#898)
* Change output for debugging
* Update setOneDriveFullScanTrigger to only be used when sync_list or skip_dir is used
* Unset oneDriveFullScanTrigger when it is currently set and no longer needed
2020-04-28 10:56:44 +10:00
abraunegg 73f71f6d52
Fix assertion when attempting to compute complex path (Issue #890) (#891)
* Before attempting to compute the complex path, check if the parent details are in the database
* Handle --dry-run and --no-remote-delete for shared folders
2020-04-27 20:59:35 +10:00
abraunegg c05243444f
Update progress bar to be more accurate when downloading large files (#888)
* Change from round to floor, so % bar increases when downloaded data is at X% not potentially under, thus leading to under reporting
* Add debug output when each % increase when downloading a file to assist with validating progress
* Start displaying ETA starting at 5% rather than 10%
2020-04-26 06:52:29 +10:00
abraunegg 628c58ad58
Catch unhandled curl exception on operationTimeout being exceeded (#886)
* Catch unhandled curl exception on operationTimeout being exceeded
2020-04-23 10:25:41 +10:00
abraunegg ccbeae4942
Implement resync in config option (Issue #874) (#875)
* Implement the ability to set --resync as a config option, default is false
2020-04-20 13:03:36 +10:00
abraunegg 2a7e48b823
Differenciate between OneNote objects and other unsupported objects (#870)
* Differenciate between OneNote objects and other unsupported objects
2020-04-15 14:54:21 +10:00
abraunegg d3aa0032bc
Perform full scan of OneDrive when required to ensure consistent local state (Issue #865) (#867)
* Use the configured 'fullScanRequired' every 10th loop to ensure that the local repository actually is in sync with OneDrive when sync_list is not used
* Use 'oneDriveFullScanTrigger' if it is set to trigger a full scan earlier than wait for next full sync if in monitor mode
2020-04-15 14:29:50 +10:00
abraunegg 7ca1ff95a8
Update handling of folders that cannot be read if parent should be skipped (#866)
* If a directory cannot be accessed, and is in a folder that should be skipped, do not print warning
2020-04-15 14:07:58 +10:00
abraunegg 7a18393ed0
Update skip_dotfiles handling of .folders when in monitor mode (#848)
* Prevent monitoring files inside .folders when using skip_dotfiles in monitor mode
* Handle '.folder' -> 'folder' move when skip_dotfiles is enabled
2020-04-06 20:05:06 +10:00
abraunegg 31629e697f
Update error logging output to be consistent (#860)
* Update error logging to be consistent when initialising fails
* Update error logging output to handle HTML error response reasoning
2020-04-06 19:40:42 +10:00