Commit graph

165 commits

Author SHA1 Message Date
abraunegg f72f6c9262
Explicitly set libcurl options (#1789)
* Explicitly set libcurl options to ignore SIGPIPE, use TCP NAGLE and ensure we are re-using connections. These should be 'enabled by default' by libcurl, but we need to ensure we are setting them to their supposed default

Potentially resolves the following issues: #494, #753, #792, #884, #1162, #1408, #1520, #1526 + others.
2022-01-12 09:14:04 +11:00
Kleckkinator 58d40c5174
Add --operation-timeout argument (#1759)
* This change is to create an argument version of the config operation_timeout.

There are many times where one may need to temporarily increase the timeout for an operation of a single large file that takes longer than the configured timeout. The command line argument is an excellent way to override the default or 'config' set option if required.
2021-12-30 11:19:55 +11:00
Yuan Liu 1e2827ad1c
Add Real-Time syncing of remote updates via webhooks (#1718)
* Add Real-Time syncing of remote updates via webhooks

Co-authored-by: abraunegg <alex.braunegg@gmail.com>
2021-11-24 06:54:28 +11:00
abraunegg ac2e07526a
Revert PR #1626 (#1716)
Revert PR #1626 due to deprecation function that needs to be resolved before PR can be merged again
2021-11-23 11:14:29 +11:00
Winston R. Milling 5d7e4532ef
Add --auth-response option and expose through entrypoint.sh (#1628)
* This allows for the use of the `--auth-files` switch in the docker environment.

Co-authored-by: abraunegg <alex.braunegg@gmail.com>
2021-11-23 07:08:04 +11:00
Yuan Liu bfeeae91de
Add Real-Time syncing of remote updates via webhooks (#1626)
* Add Real-Time syncing of remote updates via webhooks

Co-authored-by: abraunegg <alex.braunegg@gmail.com>
2021-11-23 07:06:13 +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 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
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 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 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 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 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 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 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 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
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
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
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 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 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 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 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 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 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 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
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 206ab8f516
Resolve issues identified by Valgrind (#910)
* Resolve issues identified by 'valgrind' where possible
2020-05-20 11:37:11 +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 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 feb3d96a7e
Release files for 2.4.0 (#833)
* Release files for 2.4.0
2020-03-23 09:18:06 +11:00
abraunegg 6f85d539da
Update client identifier and auth scopes (Issue #769) (#770)
* Update the client identifier to 'd50ca740-c83f-4d1b-b616-12c519384f0c'
* Update User Agent identifier to comply with OneDrive traffic decoration requirements
* Provide 'config' file option to modify / update client identifier to override application default
2020-03-23 07:01:51 +11:00
abraunegg 896a4676f5
Update regex parsing of response URI (#830)
* Update regex that extracts the response code from the response URI to avoid potentially generating a bad request to OneDrive, leading to a 'AADSTS9002313: Invalid request. Request is malformed or invalid.' response. With thanks to @zfil for fix.
2020-03-21 07:20:19 +11:00
abraunegg edd365d21b
Update error response handling for catching HTTP 429 responses - activityLimitReached (Issue #815) (#816)
* Overhaul OneDrive error response handling for 429 errors by utilising the HTTP response header Retry-After to configure the correct 'retry' window. If no retry window is set, defaults to 120 seconds.
* Update error response messaging when a 429 response is received
* Update how the original OneDrive query is retried when a 429 response is received
* Update the User Agent string to be more compliant with OneDrive decoration requirements to assist in avoiding 429 responses due to incorrect User Agent string being used. Updated to: ISV|abraunegg|OneDrive_Client_for_Linux/v%version_tag%
2020-03-20 06:12:47 +11:00
abraunegg b1fcb814c3
Update application output when just authorising application (Issue #820) (#821)
* Update application output to be clearer when just authorising the application and --synchronize or --monitor not passed in
* Update usage.md with updated authorize details and example
2020-03-15 06:29:44 +11:00
abraunegg a4d72fc73c
Catch when OneDrive throws an error response on initialising (Issue #802) (#804)
* Catch when OneDrive throws an error response (40x, 50x) on initialising
2020-03-02 12:54:56 +11:00
Norbert Preining 133c45e545 Catch DNS resolution error (#730)
* Catch the DNS error the same way we catch the timeout error
2019-11-23 06:43:28 +11:00
abraunegg 0445ae03d3
Update Microsoft restriction and limitations (#725)
* Update Microsoft restriction and limitations about windows naming files to include '~' for folder names
2019-11-14 11:53:07 +11:00
abraunegg cfdb295823
Fix typo - retrySucess -> retrySuccess
* Fix typo - retrySucess -> retrySuccess
2019-10-21 18:53:00 +11:00
Rob A 44576ea4ca Handle curl exceptions and timeouts better with backoff/retry logic (Issue #693) (#695)
* Handle curl exceptions and timeouts better with backoff/retry logic
2019-10-21 18:04:08 +11:00
abraunegg ca9a6b6ac0
Make user-agent string a configuration option (#673)
* Make user-agent string a configuration option
* Set default User-Agent to OneDrive Client for Linux v{version}
* Add 'user_agent' to default config file
2019-09-24 16:42:40 +10:00