Commit graph

666 commits

Author SHA1 Message Date
abraunegg 0fffb8fbc0
Implement a check to validate local filesystem available space before attempting file download (#1971)
* Implement a check to validate local filesystem available space before attempting file download
* Implement 'space_reservation' config option with a default value of 50 MB
* Prevent the original run-away logging error message 'Failed initialization on handle XXXX' from occurring if the system is out of space
* Update documentation and man page
2022-06-01 05:57:05 +10:00
abraunegg de2bbb5564
Fix application crash if unable to read required hash files (#1963)
* Fix where if the --confdir as specified has incorrect parent permissions, the client is unable to read the required hash files, thus cause an application crash
* When opening files, we should only be opening them as read-only
* When we write out any hash files. they should only be readable|writeable by the userid that is running the application
2022-05-19 16:12:53 +10:00
abraunegg b38fd5c200
Override skip_dir|skip_file through flag to force sync (#1960)
* Force a synchronization of a specific folder, only when using --synchronize --single-directory and ignoring all non-default skip_dir and skip_file rules
2022-05-16 10:16:50 +10:00
abraunegg ee2c14c6cc
--upload-only and --download-only are mutually exclusive and cannot be used together (#1959)
* --upload-only and --download-only are mutually exclusive and cannot be used together
2022-05-13 11:06:59 +10:00
abraunegg b7aede6d30
Update output of --display-config (#1956)
* Update output of --display-config
2022-05-10 13:43:32 +10:00
abraunegg 7139578af1
Improve application runtime check (#1955)
* Improve application runtime check fixing false positive when CTRL-C is used to terminate application
2022-05-08 05:57:25 +10:00
abraunegg e08792da42
Fix --display-config being impacted by --resync approval requirement (#1950)
* When using --display-config this option should not be impacted by any --resync flag or requirement to use --resync
2022-05-06 04:48:50 +10:00
abraunegg d4b733ae89
Update when sync start and complete is written to application log file if enabled (#1947)
* When using the application with 'defaults' with logging enabled and no verbose mode, the application output that a sync process has started & finished is only written to the logfile every 5 sync times (25 mins). This change updates this so that, if defaults are being used with logging enabled and no verbose mode, the application will always, at a minimum, write out to the application log file when a sync was started and when it was completed. This provides important reference in the log as to when an activity began and was completed.
2022-05-04 06:03:45 +10:00
abraunegg 5506efb313
Detect if application is already operational (#1944)
* In some scenarios users may have a running background service syncing data (systemd or otherwise). In these events, running the application in standalone mode can create a conflict when attempting to perform database queries when there are significant changes to data structures occurring. This PR specifically checks if the database operation files are present, and, if these are present (meaning the application is most likely currently operational) fail fast and not execute the application as a second instance against the same active configuration.

Potentially also resolves RBZ2061430 and RBZ2075468
2022-05-03 15:09:08 +10:00
Philipp 446be3743c
Fix logging output when download failed (#1894)
* Fix logging output when download failed
2022-04-29 16:54:55 +10:00
abraunegg a52de36d63
Improve when the local database integrity check is performed and on what frequency (#1938)
* Improve when the local database integrity check is performed and on what frequency
2022-04-28 11:51:50 +10:00
abraunegg 834dc3fbc4
Remove ambiguity on how to access 'help' for the client (#1936)
* Remove ambiguity on how to access 'help' for the client
2022-04-27 06:04:19 +10:00
abraunegg 37bce6f82d
Update local folder creation timestamp with timestamp from OneDrive (#1934)
* When a new folder is created locally, use the lastModifiedDateTime as provided by OneDrive for the folders timestamp instead of the time when the client created the directory

Note: This only will impact new folder that are created, will not touch or modify existing folders
2022-04-26 08:23:18 +10:00
abraunegg f08039f511
Update inotify logging output (#1930)
* Update logging output when running in --monitor --verbose mode in regards to the inotify events
* Add additional logging specifically for delete event to denote in log output the source of a deletion event when running in --monitor mode
2022-04-21 08:19:24 +10:00
abraunegg 8b30c00c81
Update Internet connect disruption retry handling (#1909)
* Update Internet connect disruption retry handling and logging output
2022-04-21 08:03:22 +10:00
abraunegg 29b0ef0b98
Fix crash when trying to sync broken symbolic link (#1917)
* Check the response for directory checks as to if it generates a file exception error
2022-04-08 05:50:47 +10:00
abraunegg a5bd4e9133
Implement feature request to mark partially-downloaded files as .partial (#1868)
* Implement feature request to mark partially-downloaded files as .partial during download
2022-03-10 07:01:08 +11:00
abraunegg 3124b2dcf2
Implement feature request --modified-by (#1869)
* Implement --modified-by to display who last modified a file and when the modification was done
2022-03-10 07:00:07 +11:00
abraunegg d68c27fb4f
Add --reauth to allow easy re-authentication of the client (#1867)
* Add --reauth to allow easy re-authentication of the client
2022-03-08 05:35:00 +11:00
abraunegg 21736f4029
Enhance error handling of GitHub version check (#1866)
* Enhance error handling of GitHub version check when GitHub is unable to be reached
2022-03-08 04:55:35 +11:00
abraunegg ff78e84efd
Extend GitHub version check (#1863)
* Extend GitHub version check to be done once per day when running in --monitor
* Change notification to also notify GUI if notifications are being utilized
2022-03-07 14:02:50 +11:00
abraunegg bb889f130e
Add function to check client version vs latest GitHub release (#1862)
* Add application version check, to check GitHub latest release tag and compare to the application version being run. If the application version is older, display a warning message that the client is obsolete and unsupported and that the user needs to upgrade their client version.
2022-03-07 10:57:20 +11:00
abraunegg 76bd6e26a5
Catch errors from OneDrive when initialising subscriptions (#1846)
* Catch errors from OneDrive when initialising subscriptions
2022-03-06 10:02:14 +11:00
abraunegg c0e40e857e
Split children query into a separate function which can be self-referred (#1828)
* Split children query into a separate function which can be self-referred in case of multiple 429 or 504 responses in a row
2022-02-03 13:27:57 +11:00
jydidier 220a00bbdf
Fixes in order to compile on an Android host (#1823)
* Fixes in order to compile on an Android host

Co-authored-by: Jean-Yves Didier <jeanyves.didier@univ-evry.fr>
2022-02-01 11:39:14 +11:00
abraunegg e1faa90351
If a sync_list exclusion is matched, the item needs to be excluded when using --resync (#1820)
* If a sync_list exclusion is matched, the item needs to be excluded when using --resync
2022-01-31 10:13:19 +11:00
abraunegg 1ac5d87d98
Document risk regarding using --resync (#1816)
* Document risk regarding using --resync
* Implement --resync-auth
2022-01-28 08:58:38 +11:00
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
abraunegg 61c8652449
Update application file logging error handling (#1776)
* Update application logging configuration instructions
* Update error notification handling when unable to write to required logfile due to access permission issues
2022-01-02 10:22:23 +11:00
abraunegg 8870603939
Update fixing edge case with OneDrive Personal Shared Folders and --resync --upload-only (#1762)
* Expand on the edge case solution fix for #1586 to drop --single-directory qualifier in this very specific scenario, and add the DB tie record in all --resync --upload-only scenarios where the driveId is actually remote
2021-12-31 06:18:32 +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
abraunegg f4c0a79425
Fix unable to upload to OneDrive Business Shared Folders due to API restricting quota information (#1725)
* In fixing #1712  which was due to a OneDrive API change, the flagging that quota is being restricted was missed, thus, if this is truly being restricted may cause files to OneDrive Business Shared Folders be unable to be uploaded despite space being available.
2021-11-25 06:48:50 +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 2f47beab60
Fix overwriting local files with older versions from OneDrive when items.sqlite3 does not exist and --resync is not used (#1717)
* Resolve issue where --resync is not used and items.sqlite3 is not available at application startup, local files, whilst potentially newer, will not be preserved thus leading to a potential data loss scenario
2021-11-24 06:44:45 +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
abraunegg 2901534171
Add --disable-download-validation (#1686)
* Add --disable-download-validation to allow downloading files from OneDrive where SharePoint and the OneDrive API mis-represents the values in the API as compared to the actual HTTP server response sent to the client. In the API JSON response we get a "size" value of X, but the HTTP Server Content Length reports a size of Y. When this occurs, the download will report as failed. This was seen as part understanding the cause of https://github.com/abraunegg/onedrive/discussions/1667
2021-11-23 07:34:16 +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
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