Commit Graph

728 Commits

Author SHA1 Message Date
abraunegg 43b0bed4cb
Fix debugging log output when reporting file size and hash mismatch (#2473)
* Fix debug logging output with correct hash values as these were switched
* Only calculate local file size post download once and reuse value
2023-08-24 18:08:21 +10:00
abraunegg fb0a5f0796
Fix unhandled exception when authurl path is non-existent (#2456)
* Catch an unhandled exception when the user sets the authurl file to a location that cannot be accessed
2023-07-23 10:13:03 +10:00
abraunegg 268dcf9120
Fix that zero-byte files do not have a hash as reported by the OneDrive API thus should not generate an error message (#2436)
* The OneDrive API does not present a hash for all files, most notably those that are zero byte in size (this may be fixed by the OneDrive API in the future). Add a wrapper to the existing makeItem function to test the file size before working out if this is a going to be a problem and if it is, then print out an error message if the file size is greater than 0 including either the full filename path or the items id.
2023-06-21 13:21:05 +10:00
abraunegg 3340fcca6a
Update util.d (#2428)
* Remove running version obsolete flag as this causes a false flagging as obsolete
2023-06-20 11:18:20 +10:00
abraunegg dfd1d1aa4a
Implement #2414 to allow HTTP session timeout(s) tuning via config (#2425)
* Implement #2414 to allow HTTP session timeout(s) tuning via config (taken from v2.5.x)
2023-06-20 09:28:17 +10:00
abraunegg 06420c9a0a
Remove sha1 use and cleanup defunct remaining crc32 use (#2424)
* Remove sha1 from being used by the client as this is being depreciated by Microsoft in July 2023 - https://devblogs.microsoft.com/microsoft365dev/deprecation-of-sha1hash-on-onedrive-personal/
* Complete the removal of crc32 as this is also no longer present for a long time, but some code elements still existed
* Only compute quickXorHash, not quickXorHash and sha256Hash as computing sha256Hash is CPU expensive
* Update cache database stored items to only store quickXorHash and sha256Hash values (remove crc32 and sha1)
2023-06-20 06:55:00 +10:00
abraunegg 16b751971f
Fix Unable to perform a database vacuum: out of memory when exiting (#2398)
* Due to many poor Internet sources of how to use this application, may folk still do not add --synchronize or --monitor switches because their documentation source fails to detail this. When this is the case, the itemdb does not get fully initialised, but when we exit, we try and clean up, because we have partially initalised, we cannot perform a vacuum of the database which generates an error. This patch adds a flag for this specific scenario, so that if triggered, we do not try to vacuum the database and not triggering a false error.
2023-05-12 18:41:01 +10:00
abraunegg 8c6bdb984d
Fix deprecation warnings with dmd 2.103.0 (#2364)
* Update cgi.d to commit 680003a - last upstream change before requiring `core.d` dependency requirement
* Fix deprecation warnings with dmd 2.103.0 by find/replace `isVirtualFunction` with `isVirtualMethod` in cgi.d
2023-04-03 07:13:11 +10:00
abraunegg 00ce7eed0e
Fix that folders are renamed despite using --dry-run (#2343)
* Fix that folders are renamed despite using --dry-run
2023-03-27 17:22:48 +11:00
abraunegg cfb4933778
Fix that a HTTP 504 - Gateway Timeout causes local files to be deleted when using --download-only & --cleanup-local-files mode (#2342)
* Fix that a HTTP 504 - Gateway Timeout causes local files to be deleted when using --download-only & --cleanup-local-files mode
2023-03-19 09:54:58 +11:00
abraunegg 6607ba537b
Fix webhook subscription creation for SharePoint Libraries (#2339)
* Fix webhook subscription creation for SharePoint Libraries
2023-03-18 10:03:49 +11:00
NigelVanHattum 52b1276282
Fix for extra encoded quotation marks surrounding Docker environment variables (#2319)
* Fix for extra encoded quotation marks surrounding Docker environment variables

---------

Co-authored-by: Hattum van <Nigel.van.Hattum@rabobank.nl>
Co-authored-by: abraunegg <alex.braunegg@gmail.com>
2023-03-18 09:53:58 +11:00
abraunegg d043d5584f
Update handling of --source-directory and --destination-directory if empty (#2278)
* Update handling of --source-directory and --destination-directory if one is empty or missing and if used with --synchronize or --monitor
2023-01-02 09:17:39 +11:00
abraunegg 6bf0ea5deb
Update version checks (#2269)
* Update version checks to use current application version release date as part of calculating if the client is obsolete and not supported.
2022-12-20 16:48:15 +11:00
abraunegg 3bca35d345
Update version release notification handling (#2267)
* Update the GitHub version check to also utilise the date a release was done, to allow 1 month grace period before generating obsolete version message.
2022-12-17 06:56:12 +11:00
abraunegg 678add91f8
Update --get-O365-drive-id error handling (#2266)
* Ensure a 'Personal' account type is not being used
* If the /sites?search API cannot be found, display a more appropriate error message
2022-12-16 06:08:46 +11:00
abraunegg 817656ba90
Fix creation of parent empty directories when parent is excluded by sync_list (#2245)
* When a parental path is to be excluded, and it is an exact match to be excluded, but further 'included' by a wildcard path match, the parental path exclude needs to take precedence, so that empty local directories are not created when they are mean to be excluded
2022-12-06 06:08:55 +11:00
abraunegg 1d8e0204bf
Update config change detection handling (#2246)
* Update the detection handling of enabling any configuration item change for the first time that required a --resync. Previously initial config changes were being missed.
2022-12-06 06:02:41 +11:00
abraunegg 19727d9c57
Fix application crash when exiting due to failure state (#2244)
* Fix a potential crash when an unclean exit is performed and any database access cannot be cleanly shutdown
2022-12-04 20:20:55 +11:00
abraunegg 0b89a1fea0
Change order of Microsoft OneDrive restrictions and limitations check and skip_file|skip_dir (#2238)
* Perform check against Microsoft OneDrive restriction and limitations after user configured items to skip has been performed
2022-11-26 05:42:38 +11:00
abraunegg 87003c5923
Update when application exit message is printed (#2239)
* Update #2229 so that the exit message only appears when --synchronize is actually used
2022-11-25 06:57:30 +11:00
abraunegg f853b129cd
Display 'Sync with OneDrive is complete' when using --synchronize (#2229)
* When exiting the application when using --synchronize, display that the sync is complete if we are exiting cleanly and all sync operations are complete
2022-11-19 11:06:00 +11:00
abraunegg 62859609b7
Fix application crash due to access permissions on configured path for sync_dir (#2225)
* Fix application crash due to access permissions on configured path for sync_dir
2022-11-19 08:53:49 +11:00
abraunegg 5a7da61cbb
Fix issue of silent exit when unable to delete local files when using --cleanup-local-files (#2227)
* Add try blocks for performing local deletes to catch in function permission issues preventing file|folder local deletion.
2022-11-19 06:18:56 +11:00
abraunegg 12d54db1e4
Fix build error with LDC 1.28.1 on Alpine (#2220)
* Fix build error with LDC 1.28.1 on Alpine due to MUSL being used as libc, due to the update of cgi.d performed with #2219
2022-11-16 08:59:19 +11:00
abraunegg c35ff20f5b
Fix build error with dmd-2.101.0 (#2219)
* Update cgi.d with latest file from https://github.com/adamdruppe/arsd/commits/master/cgi.d
2022-11-16 05:50:07 +11:00
abraunegg 0ec1c95e4a
Only call isPathExcludedViaSyncList if 'sync_list' is enabled where possible (#2213)
* Only check 'sync_list' if this has been enabled and configured, otherwise do not undertake a check as it is computationally redundant where possible
2022-11-10 16:58:54 +11:00
abraunegg 941e1e215d
Ensure path does not start with '/' before sync_list check (#2215)
* Ensure path does not start with '/' before sync_list check due to changes from 2211 and 2212
2022-11-10 14:28:20 +11:00
abraunegg 361c3cf0a1
Update Fix 2211 and 2212 (#2214)
* Update fixes for 2211 and 2212 due to undesirable path issue and output when application processing is actually correct
2022-11-10 13:43:36 +11:00
abraunegg 4a6c78a7a6
Only calculate path with computeItemPath if path is empty (#2212)
* Only calculate path with computeItemPath if path is empty, avoiding a double calculation and DB operations
2022-11-10 07:03:58 +11:00
abraunegg c73c0aa608
Fix application crash when local file is changed to a symbolic link with non-existent target (#2211)
* Add a try & catch block for testing if the file exists locally to catch any filesystem error that may be generated
* Test path to be valid if a symbolic link
2022-11-10 06:50:37 +11:00
abraunegg 7daf8797f8
Add performance output for key functions (#2180)
* Add developer option 'display_processing_time' to control if performance timing is outputted or not
* If option is enabled, print performance data around how long key functions are taking to process data to assist with understanding any performance related questions
2022-10-12 13:34:42 +11:00
abraunegg fd0a028276
Align application logging events to actual application defaults (#2170)
* Align application logging events to actual application defaults for --monitor operations
2022-10-07 06:52:38 +11:00
abraunegg 514df625b9
Add option to create a read-write shareable link (#2154)
* Implement Feature Request 2110 to add option to create a read-write shareable link
2022-09-26 17:56:42 +10:00
abraunegg 993770f49a
Fix DMD 2.100.2 depreciation warning (#2156)
DMD 2.100.2 creates a depreciation warning:

Deprecation: `return` statements cannot be in `scope(failure)` bodies.
2022-09-26 14:44:30 +10:00
abraunegg a35c7c72f5
Update database access exclusivity test for --resync (#2155)
* Update database access exclusivity test for --resync
2022-09-26 11:49:48 +10:00
abraunegg e2ed2d2b58
Update notification handling for specific skipped scenarios (#2153)
* Update skip notification handling for the following scenarios:
  * Invalid Name (Microsoft Naming Convention)
  * Invalid Name (Contains an invalid whitespace item)
  * Invalid Name (Contains HTML ASCII Code)
  * Invalid Item (Invalid symbolic link)
2022-09-26 07:40:22 +10:00
abraunegg 738be2d150
Add option to cleanup local files regardless of sync state when using --download-only (#2113)
* Add option to cleanup local files regardless of sync state when using --download-only
2022-08-31 06:41:52 +10:00
abraunegg 5288f94ac4
Resolve segfault when running 'onedrive --display-sync-status' when run as 2nd process (#2105)
* Rather than force exit if unable to lock the database, add a function and boolean to control if the database access has been init was successful. If not, use the exit scopes to exit the application
2022-08-30 19:09:35 +10:00
abraunegg 3b7a06cdcd
Fix where --resync is enforced for non-sync operations (#2111)
* Fix that the --resync option is wrongly enforced when the OneDrive client is started with --list-shared-folders option or other non-sync options. This only happens when configuration changes are detected.
2022-08-26 09:11:10 +10:00
abraunegg 33423ee441
Fix to allow non-sync tasks while sync is running (#2112)
* Fix to allow --get-file-link and --list-shared-folders when already running
2022-08-25 20:18:53 +10:00
abraunegg d169dfc642
Improve application logging output for error messages (#2100)
* When enabling system logging to a log file, the actual ERROR line is forced to a new line in the application log. The reason for this is the \n prefix in the error message, which was in place so that when performing CLI logging or systemd logging, the error message would be displayed clearly. This change removes the \n from the actual error message, but inserts a newline before the error message is displayed (and also in some cases post error message) - thus keeping the application runtime look and feel, but improving the application log output.
2022-08-18 09:14:13 +10:00
abraunegg eba676c600
Change the exit code of the application when a --resync is required (#2096)
* Change the exit code of the application when a --resync is required from a generic exit code of 1 to exit code 126, as 126 is supposed to be used when a command invoked cannot be executed - which, in this case, when a --resync is needed - the original command cannot be executed.

* This allows|enables watching for a 126 error code in automated environments, so that when 126 as the exit code is seen, the command can be re-tried potentially automatically with the appropriate resync arguments added.
2022-08-17 13:19:51 +10:00
abraunegg 9b8a25f34c
Fix that logging output for skipped uploaded files is missing (#2094)
* Add missing logfile output when enabling logging so that when uploaded new & modified files are skipped, this is correctly reflected in logfile output
2022-08-17 05:48:11 +10:00
abraunegg f561bd79a3
Update what application options require an argument (#2082)
* Update what application options require an argument
2022-08-08 10:19:06 +10:00
abraunegg d57a695632
Add option to request readonly access in oauth authorization step (#2065)
* Add option to request readonly access in oauth authorization step
* Add application-security.md to document application security
2022-08-06 08:24:51 +10:00
abraunegg cc3b83afcb
Implement --display-running-config (#2064)
* Implement --display-running-config to display the running configuration as used at application startup
* Add ONEDRIVE_DISPLAY_CONFIG variable to control --display-running-config in Docker environments
2022-08-06 06:25:58 +10:00
abraunegg 5ee30ff623
Update --get-O365-drive-id implementation for data access (#2076)
* Update --get-O365-drive-id to avoid hitting the 'onedrive application is already running' error message
2022-08-05 09:16:54 +10:00
abraunegg aaf8505205
Update --resync handling of database file removal (#2067)
* Only safe remove the files from the local file system if these are exclusively available for this running instance to perform a delete - otherwise this allows multiple clients to perform a --resync on the same data, which, could lead to a data loss scenario
2022-08-01 07:35:19 +10:00
abraunegg b2991fded9
Fix that the download progress bar doesn't always reach 100% when rate_limit is set (#2056)
* Fix that the download progress bar doesn't always reach 100% when rate_limit is set
2022-07-29 07:07:08 +10:00