mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-28 18:30:09 +02:00
Merge branch 'master' into fix-issue-966
This commit is contained in:
commit
7538ea115a
23
CHANGELOG.md
23
CHANGELOG.md
|
@ -2,6 +2,29 @@
|
|||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
## 2.4.3 - 2020-06-29
|
||||
### Fixed
|
||||
* Check if symbolic link is relative to location path
|
||||
* When using output logfile, fix inconsistent output spacing
|
||||
* Perform initial sync at startup in monitor mode
|
||||
* Handle a 'race' condition to process inotify events generated whilst performing DB or filesystem walk
|
||||
* Fix segfault when moving folder outside the sync directory when using --monitor on Arch Linux
|
||||
|
||||
### Added
|
||||
* Added additional inotify event debugging
|
||||
* Added support for loading system configs if there's no user config
|
||||
* Added Ubuntu installation details to include installing the client from a PPA
|
||||
* Added openSUSE installation details to include installing the client from a package
|
||||
* Added support for comments in sync_list file
|
||||
* Implement recursive deletion when Retention Policy is enabled on OneDrive Business Accounts
|
||||
* Implement support for National cloud deployments
|
||||
* Implement OneDrive Business Shared Folders Support
|
||||
|
||||
### Updated
|
||||
* Updated documentation files (various)
|
||||
* Updated log output messaging when a full scan has been set or triggered
|
||||
* Updated buildNormalizedPath complexity to simplify code
|
||||
* Updated to only process OneDrive Personal Shared Folders only if account type is 'personal'
|
||||
|
||||
## 2.4.2 - 2020-05-27
|
||||
### Fixed
|
||||
|
|
20
configure
vendored
20
configure
vendored
|
@ -1,6 +1,6 @@
|
|||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.69 for onedrive v2.4.3-dev.
|
||||
# Generated by GNU Autoconf 2.69 for onedrive v2.4.4-dev.
|
||||
#
|
||||
# Report bugs to <https://github.com/abraunegg/onedrive>.
|
||||
#
|
||||
|
@ -579,8 +579,8 @@ MAKEFLAGS=
|
|||
# Identity of this package.
|
||||
PACKAGE_NAME='onedrive'
|
||||
PACKAGE_TARNAME='onedrive'
|
||||
PACKAGE_VERSION='v2.4.3-dev'
|
||||
PACKAGE_STRING='onedrive v2.4.3-dev'
|
||||
PACKAGE_VERSION='v2.4.4-dev'
|
||||
PACKAGE_STRING='onedrive v2.4.4-dev'
|
||||
PACKAGE_BUGREPORT='https://github.com/abraunegg/onedrive'
|
||||
PACKAGE_URL=''
|
||||
|
||||
|
@ -1217,7 +1217,7 @@ if test "$ac_init_help" = "long"; then
|
|||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures onedrive v2.4.3-dev to adapt to many kinds of systems.
|
||||
\`configure' configures onedrive v2.4.4-dev to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
|
@ -1278,7 +1278,7 @@ fi
|
|||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of onedrive v2.4.3-dev:";;
|
||||
short | recursive ) echo "Configuration of onedrive v2.4.4-dev:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
|
@ -1389,7 +1389,7 @@ fi
|
|||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
onedrive configure v2.4.3-dev
|
||||
onedrive configure v2.4.4-dev
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
|
@ -1406,7 +1406,7 @@ cat >config.log <<_ACEOF
|
|||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by onedrive $as_me v2.4.3-dev, which was
|
||||
It was created by onedrive $as_me v2.4.4-dev, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
|
@ -2158,7 +2158,7 @@ fi
|
|||
|
||||
|
||||
|
||||
PACKAGE_DATE="May 2020"
|
||||
PACKAGE_DATE="June 2020"
|
||||
|
||||
|
||||
|
||||
|
@ -3138,7 +3138,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
|||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by onedrive $as_me v2.4.3-dev, which was
|
||||
This file was extended by onedrive $as_me v2.4.4-dev, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
|
@ -3191,7 +3191,7 @@ _ACEOF
|
|||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
onedrive config.status v2.4.3-dev
|
||||
onedrive config.status v2.4.4-dev
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ dnl - commit the changed files (configure.ac, configure)
|
|||
dnl - tag the release
|
||||
|
||||
AC_PREREQ([2.69])
|
||||
AC_INIT([onedrive],[v2.4.3-dev], [https://github.com/abraunegg/onedrive], [onedrive])
|
||||
AC_INIT([onedrive],[v2.4.4-dev], [https://github.com/abraunegg/onedrive], [onedrive])
|
||||
AC_CONFIG_SRCDIR([src/main.d])
|
||||
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
%endif
|
||||
|
||||
Name: onedrive
|
||||
Version: 2.4.2
|
||||
Version: 2.4.3
|
||||
Release: 1%{?dist}
|
||||
Summary: Microsoft OneDrive Client
|
||||
Group: System Environment/Network
|
||||
|
|
|
@ -150,6 +150,27 @@ docker container run -e ONEDRIVE_RESYNC=1 -e ONEDRIVE_VERBOSE=1 -v onedrive_conf
|
|||
```
|
||||
|
||||
## Build instructions
|
||||
### Build Environment Requirements
|
||||
* Build environment must have at least 1GB of memory & 2GB swap space
|
||||
|
||||
There are 2 ways to validate this requirement:
|
||||
* Modify the file `/etc/dphys-swapfile` and edit the `CONF_SWAPSIZE`, for example: `CONF_SWAPSIZE=2024`. A reboot is required to make this change effective.
|
||||
* Dynamically allocate a swapfile for building:
|
||||
```bash
|
||||
cd /var
|
||||
sudo fallocate -l 1.5G swapfile
|
||||
sudo chmod 600 swapfile
|
||||
sudo mkswap swapfile
|
||||
sudo swapon swapfile
|
||||
# make swap permanent
|
||||
sudo nano /etc/fstab
|
||||
# add "/swapfile swap swap defaults 0 0" at the end of file
|
||||
# check it has been assigned
|
||||
swapon -s
|
||||
free -h
|
||||
```
|
||||
|
||||
### Building the Docker image
|
||||
You can also build your own image instead of pulling the one from dockerhub:
|
||||
```bash
|
||||
git clone https://github.com/abraunegg/onedrive
|
||||
|
|
|
@ -7,10 +7,10 @@ This project has been packaged for the following Linux distributions:
|
|||
* Debian, available from the package repository as [onedrive](https://packages.debian.org/sid/net/onedrive)
|
||||
* Fedora, available via package repositories as [onedrive](https://koji.fedoraproject.org/koji/packageinfo?packageID=26044)
|
||||
* NixOS, available on unstable channel (and stable since 20.03). Use package `onedrive` either by adding it to `configuration.nix` or by using the command `nix-env -iA <channel name>.onedrive`. This does not install a service. There is a [PR](https://github.com/NixOS/nixpkgs/pull/77734) (which needs work) which has code which can be used to install a service. See documentation in the same PR.
|
||||
* openSUSE, available for Tumbleweed as [onedrive](https://software.opensuse.org/package/onedrive) - just install using: `zypper in onedrive`
|
||||
* Slackware, available from the slackbuilds.org repository as [onedrive](https://slackbuilds.org/repository/14.2/network/onedrive/)
|
||||
* Solus, available from the package repository as [onedrive](https://dev.getsol.us/search/query/FB7PIf1jG9Z9/#R)
|
||||
* Ubuntu, available as a package from the following PPA [onedrive](https://launchpad.net/~yann1ck/+archive/ubuntu/onedrive)
|
||||
* openSUSE, available for Tumbleweed. Just install using: `zypper in onedrive`
|
||||
|
||||
#### Important Note:
|
||||
Distribution packages may be of an older release when compared to the latest release that is [available](https://github.com/abraunegg/onedrive/releases). If a package is out of date, please contact the package maintainer for resolution.
|
||||
|
|
|
@ -297,6 +297,8 @@ The default configuration file is listed below:
|
|||
# application_id = ""
|
||||
# resync = "false"
|
||||
# bypass_data_preservation = "false"
|
||||
# azure_ad_endpoint = ""
|
||||
# sync_business_shared_folders = "false"
|
||||
```
|
||||
|
||||
|
||||
|
@ -418,11 +420,16 @@ To enable selective sync create a file named `sync_list` in `~/.config/onedrive`
|
|||
Each line of the file represents a relative path from your `sync_dir`. All files and directories not matching any line of the file will be skipped during all operations.
|
||||
Here is an example of `sync_list`:
|
||||
```text
|
||||
# sync_list supports comments
|
||||
# Exclude my Backup folder
|
||||
Backup
|
||||
# Exclude this single document
|
||||
Documents/latest_report.docx
|
||||
Work/ProjectX
|
||||
# Exclude all Work/Project directories
|
||||
Work/Project*
|
||||
notes.txt
|
||||
Blender
|
||||
# Exclude /Blender in the ~OneDrive root but not if elsewhere
|
||||
/Blender
|
||||
Cinema Soc
|
||||
Codes
|
||||
Textbooks
|
||||
|
@ -452,7 +459,7 @@ check_nosync = "true"
|
|||
Folders shared with you can be synced by adding them to your OneDrive. To do that open your Onedrive, go to the Shared files list, right click on the folder you want to sync and then click on "Add to my OneDrive".
|
||||
|
||||
### Shared folders (OneDrive Business or Office 365)
|
||||
Currently not supported.
|
||||
Refer to [./BusinessSharedFolders.md](BusinessSharedFolders.md) for configuration assistance.
|
||||
|
||||
### SharePoint / Office 365 Shared Libraries
|
||||
Refer to [./Office365.md](Office365.md) for configuration assistance.
|
||||
|
@ -505,27 +512,29 @@ To change what 'user' the client runs under (by default root), manually edit the
|
|||
systemctl --user enable onedrive
|
||||
systemctl --user start onedrive
|
||||
```
|
||||
**Note:** `systemctl --user` directive is not applicable for Red Hat Enterprise Linux (RHEL) or CentOS Linux platforms - see below.
|
||||
|
||||
**Note:** This will run the 'onedrive' process with a UID/GID of '0', thus, any files or folders that are created will be owned by 'root'
|
||||
|
||||
To see the logs run:
|
||||
```text
|
||||
journalctl --user-unit onedrive -f
|
||||
journalctl --user-unit=onedrive -f
|
||||
```
|
||||
|
||||
### OneDrive service running as root user via systemd (Red Hat Enterprise Linux, CentOS Linux)
|
||||
|
||||
```text
|
||||
systemctl enable onedrive
|
||||
systemctl start onedrive
|
||||
```
|
||||
**Note:** This will run the 'onedrive' process with a UID/GID of '0', thus, any files or folders that are created will be owned by 'root'
|
||||
|
||||
To see the logs run:
|
||||
```text
|
||||
journalctl onedrive -f
|
||||
journalctl --unit=onedrive -f
|
||||
```
|
||||
|
||||
### OneDrive service running as a non-root user via systemd (without notifications or GUI)
|
||||
|
||||
In some cases it is desirable to run the OneDrive client as a service, but not running as the 'root' user. In this case, follow the directions below to configure the service for a non-root user.
|
||||
### OneDrive service running as a non-root user via systemd (All Linux Distributions)
|
||||
In some cases it is desirable to run the OneDrive client as a service, but not running as the 'root' user. In this case, follow the directions below to configure the service for your normal user login.
|
||||
|
||||
1. As the user, who will be running the service, run the application in standalone mode, authorize the application for use & validate that the synchronization is working as expected:
|
||||
```text
|
||||
|
@ -541,8 +550,12 @@ systemctl start onedrive@<username>.service
|
|||
systemctl status onedrive@<username>.service
|
||||
```
|
||||
|
||||
### OneDrive service running as a non-root user via systemd (with notifications enabled) (Arch, Ubuntu, Debian, OpenSuSE, Fedora)
|
||||
To see the logs run:
|
||||
```text
|
||||
journalctl --unit=onedrive@<username> -f
|
||||
```
|
||||
|
||||
### OneDrive service running as a non-root user via systemd (with notifications enabled) (Arch, Ubuntu, Debian, OpenSuSE, Fedora)
|
||||
In some cases you may wish to receive GUI notifications when using the client when logged in as a non-root user. In this case, follow the directions below:
|
||||
|
||||
1. Login via graphical UI as user you wish to enable the service for
|
||||
|
@ -559,10 +572,10 @@ systemctl --user start onedrive
|
|||
|
||||
To see the logs run:
|
||||
```text
|
||||
journalctl --user-unit onedrive -f
|
||||
journalctl --user-unit=onedrive -f
|
||||
```
|
||||
|
||||
**Note:** `systemctl --user` is not applicable for Red Hat Enterprise Linux (RHEL) or CentOS Linux platforms
|
||||
**Note:** `systemctl --user` directive is not applicable for Red Hat Enterprise Linux (RHEL) or CentOS Linux platforms
|
||||
|
||||
## Additional Configuration
|
||||
### Using multiple OneDrive accounts
|
||||
|
@ -583,8 +596,10 @@ onedrive --monitor --verbose --confdir="~/.config/onedriveWork" &
|
|||
* `&` puts the application in background and leaves the terminal interactive
|
||||
|
||||
### Automatic syncing of both OneDrive accounts
|
||||
In order to automatically start syncing your OneDrive accounts, you will need to create a service file for each account. From the applicable 'user systemd folder':
|
||||
* RHEL / CentOS: `/usr/lib/systemd/system`
|
||||
* Others: `/usr/lib/systemd/user`
|
||||
|
||||
In order to automatically start syncing your OneDrive accounts, you will need to create a service file for each account. From the `/usr/lib/systemd/user` folder:
|
||||
```text
|
||||
cp onedrive.service onedrive-work.service
|
||||
```
|
||||
|
@ -659,8 +674,8 @@ Options:
|
|||
|
||||
--auth-files ARG
|
||||
Perform authorization via two files passed in as ARG in the format `authUrl:responseUrl`
|
||||
The authorization URL is written to the `authUrl`, then onedrive waits for the file `responseUrl`
|
||||
to be present, and reads the response from that file.
|
||||
The authorization URL is written to the `authUrl`, then onedrive waits for the file `responseUrl`
|
||||
to be present, and reads the response from that file.
|
||||
--check-for-nomount
|
||||
Check for the presence of .nosync in the syncdir root. If found, do not perform sync.
|
||||
--check-for-nosync
|
||||
|
@ -701,6 +716,8 @@ Options:
|
|||
Display the file link of a synced file
|
||||
--help -h
|
||||
This help information.
|
||||
--list-shared-folders
|
||||
List OneDrive Business Shared Folders
|
||||
--local-first
|
||||
Synchronize from the local directory source first, before downloading changes from OneDrive.
|
||||
--log-dir ARG
|
||||
|
@ -737,7 +754,7 @@ Options:
|
|||
Skip dot files and folders from syncing
|
||||
--skip-file ARG
|
||||
Skip any files that match this pattern from syncing
|
||||
--skip-size
|
||||
--skip-size ARG
|
||||
Skip new files larger than this size (in MB)
|
||||
--skip-symlinks
|
||||
Skip syncing of symlinks
|
||||
|
@ -745,6 +762,8 @@ Options:
|
|||
Source directory to rename or move on OneDrive - no sync will be performed.
|
||||
--sync-root-files
|
||||
Sync all files in sync_dir root when using sync_list.
|
||||
--sync-shared-folders
|
||||
Sync OneDrive Business Shared Folders
|
||||
--syncdir ARG
|
||||
Specify the local directory used for synchronization to OneDrive
|
||||
--synchronize
|
||||
|
|
|
@ -44,14 +44,14 @@ Set the directory used to store the configuration files
|
|||
\fB\-\-create\-directory\fP ARG
|
||||
Create a directory on OneDrive \- no sync will be performed.
|
||||
.TP
|
||||
\fB\-\-destination\-directory\fP ARG
|
||||
Destination directory for renamed or move on OneDrive \- no sync will be performed.
|
||||
.TP
|
||||
\fB\-\-debug\-https\fP
|
||||
Debug OneDrive HTTPS communication.
|
||||
.br
|
||||
Configuration file key: \fBdebug_https\fP (default: \fBfalse\fP)
|
||||
.TP
|
||||
\fB\-\-destination\-directory\fP ARG
|
||||
Destination directory for renamed or move on OneDrive \- no sync will be performed.
|
||||
.TP
|
||||
\fB\-\-disable\-notifications\fP
|
||||
Do not use desktop notifications in monitor mode
|
||||
.br
|
||||
|
@ -83,6 +83,9 @@ Enable client activity to a separate log file
|
|||
.br
|
||||
Configuration file key: \fBenable_logging\fP (default: \fBfalse\fP)
|
||||
.TP
|
||||
\fB\-\-force\fP
|
||||
Force the deletion of data when a 'big delete' is detected
|
||||
.TP
|
||||
\fB\-\-force\-http\-1.1\fP
|
||||
Force the use of HTTP 1.1 for all operations (DEPRECIATED)
|
||||
.br
|
||||
|
@ -99,6 +102,9 @@ Query and return the Office 365 Drive ID for a given Office 365 SharePoint Share
|
|||
\fB\-\-get\-file\-link\fP ARG
|
||||
Display the file link of a synced file
|
||||
.TP
|
||||
\fB\-\-list\-shared\-folders\fP
|
||||
List OneDrive Business Shared Folders
|
||||
.TP
|
||||
\fB\-\-local\-first\fP
|
||||
Synchronize from the local directory source first, before downloading changes from OneDrive.
|
||||
.br
|
||||
|
@ -125,13 +131,18 @@ Keep monitoring for local and remote changes
|
|||
The number of seconds by which each sync operation is undertaken when
|
||||
idle under monitor mode
|
||||
.br
|
||||
Configuration file key: \fBmonitor_interval\fP (default: \fB45\fP)
|
||||
Configuration file key: \fBmonitor_interval\fP (default: \fB300\fP)
|
||||
.TP
|
||||
\fB\-\-monitor\-fullscan-frequency\fP ARG
|
||||
Number of sync runs before performing a full local scan of the synced directory
|
||||
.br
|
||||
Configuration file key: \fBmonitor_fullscan_frequency\fP (default: \fB10\fP)
|
||||
.TP
|
||||
\fB\-\-monitor\-log\-frequency\fP ARG
|
||||
Frequency of logging in monitor mode
|
||||
.br
|
||||
Configuration file key: \fBmonitor_log_frequency\fP (default: \fB5\fP)
|
||||
.TP
|
||||
\fB\-\-no\-remote\-delete\fP
|
||||
Do not delete local file 'deletes' from OneDrive when using \fB\-\-upload\-only\fR
|
||||
.br
|
||||
|
@ -172,6 +183,9 @@ Skip any files that match this pattern from syncing
|
|||
.br
|
||||
Configuration file key: \fBskip_file\fP (default: \fB~*|.~*|*.tmp\fP)
|
||||
.TP
|
||||
\fB\-\-skip\-size\fP ARG
|
||||
Skip new files larger than this size (in MB)
|
||||
.TP
|
||||
\fB\-\-skip\-symlinks\fP
|
||||
Skip syncing of symlinks
|
||||
.br
|
||||
|
@ -182,6 +196,12 @@ Source directory to rename or move on OneDrive \- no sync will be performed.
|
|||
.TP
|
||||
\fB\-\-sync\-root\-files\fP
|
||||
Sync all files in sync_dir root when using sync_list.
|
||||
|
||||
.TP
|
||||
\fB\-\-sync\-shared\-folders\fP
|
||||
Sync OneDrive Business Shared Folders
|
||||
.br
|
||||
Configuration file key: \fBsync_business_shared_folders\fP (default: \fBfalse\fP)
|
||||
.TP
|
||||
\fB\-\-syncdir\fP ARG
|
||||
Set the directory used to sync the files that are synced
|
||||
|
|
20
src/sync.d
20
src/sync.d
|
@ -539,14 +539,18 @@ final class SyncEngine
|
|||
applyDifferences(driveId, rootId, performFullItemScan);
|
||||
|
||||
// Check OneDrive Personal Shared Folders
|
||||
// https://github.com/OneDrive/onedrive-api-docs/issues/764
|
||||
Item[] items = itemdb.selectRemoteItems();
|
||||
foreach (item; items) {
|
||||
log.vdebug("------------------------------------------------------------------");
|
||||
if (!cfg.getValueBool("monitor")) {
|
||||
log.log("Syncing this OneDrive Personal Shared Folder: ", item.name);
|
||||
} else {
|
||||
log.vlog("Syncing this OneDrive Personal Shared Folder: ", item.name);
|
||||
if (accountType == "personal"){
|
||||
// https://github.com/OneDrive/onedrive-api-docs/issues/764
|
||||
Item[] items = itemdb.selectRemoteItems();
|
||||
foreach (item; items) {
|
||||
log.vdebug("------------------------------------------------------------------");
|
||||
if (!cfg.getValueBool("monitor")) {
|
||||
log.log("Syncing this OneDrive Personal Shared Folder: ", item.name);
|
||||
} else {
|
||||
log.vlog("Syncing this OneDrive Personal Shared Folder: ", item.name);
|
||||
}
|
||||
// Check OneDrive Personal Folders
|
||||
applyDifferences(item.remoteDriveId, item.remoteId, performFullItemScan);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue