Make verbose logging output optional on Docker (#638)

* Make "--verbose" optional based on ONEDRIVE_VERBOSE environment variable. Verbose will continue to be the default if ONEDRIVE_VERBOSE is set to *anything* other than 0 (zero), or if it's not set at all.
This commit is contained in:
TheFlyingBadger 2019-09-04 14:44:12 +08:00 committed by abraunegg
parent 8ca71142df
commit e8c3c236ef
2 changed files with 17 additions and 1 deletions

View file

@ -26,7 +26,15 @@ fi
chown "${oduser}:${odgroup}" /onedrive/ /onedrive/conf
# Default parameters
ARGS=(--monitor --verbose --confdir /onedrive/conf --syncdir /onedrive/data)
ARGS=(--monitor --confdir /onedrive/conf --syncdir /onedrive/data)
#Make Verbose output optional, based on an environment variable
# default behaviour is verbose (to continue to behave as before)
if ! [ "${ONEDRIVE_VERBOSE:=1}" == "0" ]; then
echo "# We are being verbose"
echo "# set ONEDRIVE_VERBOSE environment to 0 (Zero) to be less chatty"
ARGS=(--verbose ${ARGS})
fi
if [ ${#} -gt 0 ]; then
ARGS=("${@}")

View file

@ -101,6 +101,14 @@ Or you can map your own config folder to config volume (copy stuffs from docker
The detailed document for the config can be found here: [additional-configuration](https://github.com/abraunegg/onedrive#additional-configuration)
## Environment Variables
| Variable | Purpose | Sample Value |
| ---------------- | --------------------------------------------------- |:-------------:|
| **ONEDRIVE_UID** | UserID (UID) to run as | 1000 |
| **ONEDRIVE_GID** | GroupID (GID) to run as | 1000 |
| **ONEDRIVE_VERBOSE** | Controls "verbose" switch on onedrive sync. Default (i.e. not set or non-zero value) behaviour is to continue to be verbose as before | 0 |
## Run or update with one script
If you are experienced with docker and onedrive, you can use the following script: