Add Docker environment variable to allow --logout for re-authentication (#1187)

* Add Docker environment variable to allow --logout for re-authentication
This commit is contained in:
abraunegg 2020-12-21 07:06:18 +11:00 committed by GitHub
parent ba94b92d8a
commit 3341e30ffa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -58,6 +58,13 @@ if [ "${ONEDRIVE_DOWNLOADONLY:=0}" == "1" ]; then
ARGS=(--download-only ${ARGS[@]})
fi
# Tell client to logout based on environment variable
if [ "${ONEDRIVE_LOGOUT:=0}" == "1" ]; then
echo "# We are logging out to perform a reauthentication"
ARGS=(--logout ${ARGS[@]})
fi
if [ ${#} -gt 0 ]; then
ARGS=("${@}")
fi

View file

@ -155,6 +155,7 @@ docker run $firstRun --restart unless-stopped --name onedrive -v onedrive_conf:/
| <B>ONEDRIVE_DEBUG_HTTPS</B> | Controls "--debug-https" switch on onedrive sync. Default is 0 | 1 |
| <B>ONEDRIVE_RESYNC</B> | Controls "--resync" switch on onedrive sync. Default is 0 | 1 |
| <B>ONEDRIVE_DOWNLOADONLY</B> | Controls "--download-only" switch on onedrive sync. Default is 0 | 1 |
| <B>ONEDRIVE_LOGOUT</B> | Controls "--logout" switch. Default is 0 | 1 |
### Usage Examples
**Verbose Output:**
@ -174,6 +175,11 @@ docker container run -e ONEDRIVE_RESYNC=1 -v onedrive_conf:/onedrive/conf -v "${
docker container run -e ONEDRIVE_RESYNC=1 -e ONEDRIVE_VERBOSE=1 -v onedrive_conf:/onedrive/conf -v "${onedriveDir}:/onedrive/data" driveone/onedrive:latest
```
**Perform a --logout and re-authenticate:**
```bash
docker container run -e ONEDRIVE_LOGOUT=1 -v onedrive_conf:/onedrive/conf -v "${onedriveDir}:/onedrive/data" driveone/onedrive:latest
```
## Build instructions
### Build Environment Requirements
* Build environment must have at least 1GB of memory & 2GB swap space