* By moving the UploadSession creation from the constructor to the init function we guarantee that a re-initialization also starts a new UploadSession.
* Add additional Docker container builds utilising a smaller OS footprint
* Resolve compiling with LDC on Alpine as musl lacks some standard interfaces
* Re-order handling of response JSON to ensure that 'id' key element is always checked for.
* Print errors when there is an issue with saveItem & articulate why
If the dbus server cannot be started or is not available, calling a notification
would result in an exception. During initialization check that we can get the
server information, and disable notifications if this is not possible.
Note: we change dnotify.d from the originally distributed version to include
a check for availability function.
* When notifications are enabled, display the number of OneDrive changes to process if any are found
* Add 'config' option 'min_notif_changes' for minimum number of changes to notify on, default = 5
* Update readme, manual page for new option
* Update handling of --get-O365-drive-id to print out all 'site names' that match the explicit search entry rather than just the last match
* Add webUrl for site to output so that the 'right' site drive_id can be identified
* Update O365 readme with updated output
* Support install on CentOS / RHEL 6.x
* Support uninstall on CentOS / RHEL 6.x
* Add /usr/local/bin/ to search path when starting init.d service
* Fix dmd-2.084.0 deprecation warning: loop index implicitly converted from size_t to int
* Update readme based on CentOS 6 / RHEL 6 additional dependencies
* Resolve warnings about "bashisms" in init.d script (Issue #349) - fixed here as we are updating the init file already, rather than have multiple PR's
* When OneDrive Business is configured with Retention Policies, attempts to delete a 'non empty' folder results in an an error response. Correctly handle the error response to print a warning message that OneDrive content must be manually deleted.
**Note:** A future version of this client will handle the removal of 'non empty' folders when Retention Policies are enabled.
* Add a 404 error handler when OneDrive cannot query what changes are available for a particular 'root' folder id
* Add additional verbose debug logging to assist in the future
* Change to not throw an exception when OneDrive cannot query what changes are available for a particular 'root' folder - rather display some meaningful details instead of crashing the application
* As we know the actual 'items.sqlite3' location, display that as the file to remove rather than a 'generic' message as this is more helpful
* Fix remote deletes the fix for #323, #324 & #331 introduced a bug where an item when remote deleted, would actually be re-inserted to the database & eventually cause a database assertion
* Add --force-http-1.1 flag to downgrade any HTTP/2 curl operations to HTTP 1.1 protocol
* Explicitly set all bool items to false at initialisation
* Update --display-config to display sync_list if configured
* Add debug handling to display when sync_list is loaded
* Add debug handling to output the handling of OneDrive changes
* Update HTTP 412 error notifications to better identify where 412 error is occuring
* Add a check for 'id' key on metadata update to prevent 'std.json.JSONException@std/json.d(494): Key not found: id' (Issue #325)
Add a signal handler and shutdown database connection on SIGINT and SIGTERM
to make sure that .waf files are properly incorportated into the sqlite database.
If an sqlite statement is prepared and reused by using reset again and again, the connection
keeps a lock on the database, and checkpointing cannot ensure that transaction from the
wal file are carried over into the main database.
By preparing the statement every time it is used, the destructor calls finalize and thus
the lock is released.
Possible impacts during high frequency changes via monitor mode etc might arise.
* Fix logic for sync_dir handling on headless systems
* Fix logic where potentially a 'default' ~/OneDrive sync_dir could be set despite 'config' file configured for an alternate
* Add debug handling for sync_dir operations
* Add debug handling for homePath calculation
* Add debug handling for configDirBase calculation
* Reorder main() so that log.vdebug works where required
* Rework configDirName as this had the same issue as syncDir
* Update configDirName & syncDir '~' handling & replacement to be more robust and only replace if '~' is first char in string
* Add additional debug logging if syncDir is created
* check config file keys for validity, use setValue instead of direct access
* Update config.d
Add 'drive_id' to be initialised, set to an empty string
* exit application if there is a configuration file error
* Issue #293 was caused by a spelling error in the configuration file.
If the configuration file has errors, we should not load it or run
using the application defaults as this may have undesirable consequences
for users data
* missed returning false on key issue
* Missed this edit of the file
* In testing, 'description' and 'displayName' were the same, but in reality we are checking against the 'displayName' value as this is what we are asking the user to input, thus we need to check against displayName
* After extended suspend, or bad connection, the connection to OD might
go stale - thus no network connection to Microsoft OneDrive Service, skipping sync
and this continues ad infinitum. Change the last action to re-initialize the sync engine.
if the move target has been deleted before the monitor action completes,
the monitor action throws an exception when stat-ing the target for
mtime. Do not do anything in case the move target has disappeared
* add external sources for (d)notify with README and license statements
* add new logAndNotify function, make building a compile time option
* use logAndNotify and main.d, make timeout message silent
* update documentation for notification support
* add command line switch --disable-notifications
* add build-deps for libnotify in README.md
* SyncEngine: allow for multiple calls to init by saving the state
* Factor out syncengine initialization code so that it can be reused
* Don't exit in monitor when started offline
* Always call initSyncEngine during regular syncs, this will call the SyncEngine init routine which caches the state, thus a quasi no-op.
* Add forgotten http.shutdown
This change adjusts the two core timeout parameters of libcurl operation
- dataTimeout: changed from 3600sec to 300sec
this timeout controls the max time when there is no data incoming
(actually below CURLOPT_LOW_SPEED_LIMIT)
- operationTimeout: added 3600sec
this timeout controls the maximally allowed connection timeout
* Change '--download' to '--download-only' to align with '--upload-only'
* Enable logging to a separate file only if the '--enable-logging' flag is passed through at client run time
* Implement configuration option for logfile location, if logging is enabled
* Refactor PR104 for latest code base to enable client use with SharePoint libraries
* Implement '--disable-upload-validation' as SharePoint modifies files when uploaded
* Enable '--disable-upload-validation' by default if account type is documentLibrary - as most likely this is a SharePoint repository
* Remove HTTP 1.1 downgrade for session uploads
* Handle HTTP/2 0 (zero) response code for successful session data upload
* Add debugging for actual server response, not curl interpreted response when using --debug-https
* Update initial Curl 7.62.0 fix with a better solution which handles the redirect's given by HTTP/2 connections (credit @Popa21)
* Use HTTP/1.1 for session uploads otherwise the response when using HTTP/2 generates a 'JSONValue is not an object' error
* Handle HTTP request returned status code 412 (Precondition Failed) for session uploads to OneDrive Personal Accounts
* Fix Failed to remove file /root/.config/onedrive/resume_upload: No such file or directory if there is a session upload error and the resume file does not get created
* Handle response codes when using 2 different systems using --upload-only but the same OneDrive account and uploading the same filename to the same location
* Add a check to validate if the parentReference object has a path object
* Fix spelling error - trough -> through
* Only upload changes on remote folder if the item is in the database - dont assert if false
* Update handling of shared folders and items which was previously broken to a OneDrive API change
* Extract syncFolderName from either local or remote folder - not just local folder.
* Add try & catch in the case of a 504 error being generated to upload the file. Currently, if a 504 is generated, it is handled gracefully, but further files to upload are stopped
* Update where ever there is a 404 try block, add a if statement to capture if a 5xx error is returned as well
* Resolve 'The parent item is not in the local database' where data cannot be uploaded / saved to the local database because there are folders in the same path with the same name due to case sensitivity issues
* Original implementation of --no-remote-delete used a cfg value, however this introduced 2 issues - value could be set via a config parameter which was not the intention, but also could be set to a non true value causing application issues. This patch resolves how --no-remote-delete should have originally been implemented
* Implement better handling of database exit scenarios when there is zero disk space left on drive where the items database resides (Issue #77)
* Implement better handling of incorrect database permissions
* Implement better handling of different database versions to automatically re-create tables if version mis-match (RHBZ #1598934)
* Update 'HTTP 412 - Precondition Failed' error handling based on local testing to ensure a http 412 response is gracefully handled & the modified file is subsequently uploaded to OneDrive successfully.
* item.name is not available, so we get a bunch of meaningless log output when deleting items. This will get fixed when wider logging changes are synced in
* 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.
* Implement an invalid whitespace filename check which currently checks for a 'new line' whitespace entry in a filename. Regex can be expanded if other files with similar characteristics are found.
* 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
* Provide a new switch 'check-mount' which will check for the presence of a hidden file '.nosync' file. If this file is found in the sync dir, then the sync process will shutdown. Refer to #8 for further details.
* 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
* Add an additional check for 409 (Conflict) being returned when creating directories even when the directory is only attempted to be created when it cannot be found.
* Resolve std.file.FileException@std/file.d(2954): /var/log/onedrive/: Permission denied when there is no permission to create the directory on application startup
* Clean up --single-directory logging as we should not be spilling out the actual item details
* Fix some spelling errors
* Fix another core.exception.AssertError@src/itemdb.d(307): Assertion failure when attempting to compute the path
* Fix logging when items are being filtered out as non relevant
* Add upload validation that file uploaded equals the size of the file locally as this is a contributing factor to 412 errors
* Update long path handling to account for differences between OneDrive Personal and OneDrive Business Accounts
* Update logging to be cleaner on fragment uploads
* Update logging of 500 & 504 errors. For 504 errors this was 'breaking the formatting of the log line. For 500 errors - this needs to be logged regardless of verbosity.
* When completing some operations on OneDrive, a 504 error can be returned when Microsoft Graph times out when communicating with internal resources. Rather than failing, handle the 504 and retry the request.
* When performing numerous changes via OneDrive online, Microsoft Graph has an issue in interpreting the the response, thus generates a 500 internal server error. As this is something we cannot fix, handle the 500 error by gracefully exiting.
* 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
* Resolve where '--single-directory' is used to sync a single directory,
but a file / folder is 'moved' on OneDrive to outside the scope of the
focus of the '--single-directory' path. Before this change, the file
would remain in the local path (original location) whilst it would
reside in the new OneDrive path. This patch looks for this mis match and
deletes the local file / folder to reflect it is no longer in the same
OneDrive path.
* In some cases OneDrive does not send all delete changes or changes are
out of order. When deleting local files, this can lead to a 'Directory
not empty' error. This change adds to check for any remaining children
of a directory that is to be deleted and delete them before
* Resolve: std.exception.ErrnoException@std/stdio.d(423): Cannot open
file `/var/log/onedrive/xxxxx.onedrive.log' in mode `a' (Permission
denied). This issue occurs if the user running 'onedrive' is not part of
the standard 'users' group (GID 100)
* Prior to all the changes in #314, the client would sync regardless of
options. #314 introduced a flag that must be included if you want to
sync, however there was no feedback if '--synchronize' was not included
and the sync was not occuring. This patch provides that notification &
feedback.
* 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
* 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()
* Original patch (77c0cdbe24) whilst it
resolved the issue of a OneDrive API change, when a file was deleted on
OneDrive, it was not actually deleted on the local file system. This
patch re-implements the fix for 'Key not found: lastModifiedDateTime' by
taking into account the deleted state of the item and correctly removes
the local file that is now in the deleted state.