Commit graph

194 commits

Author SHA1 Message Date
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
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 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 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 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
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 1ac5d87d98
Document risk regarding using --resync (#1816)
* Document risk regarding using --resync
* Implement --resync-auth
2022-01-28 08:58:38 +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
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
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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
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 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 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 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 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 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