feat: optionally use standalone mode for syncing using Docker container (#3018)

* feat: optionally use standalone mode for syncing using Docker container

* Update podman.md
* Update podman.md

---------

Co-authored-by: abraunegg <alex.braunegg@gmail.com>
This commit is contained in:
Pieter Scheffers 2024-11-28 20:29:30 +01:00 committed by GitHub
commit c7f1b7f407
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 1 deletions

View file

@ -34,9 +34,20 @@ else
fi
# Default parameters
ARGS=(--monitor --confdir /onedrive/conf --syncdir /onedrive/data)
ARGS=(--confdir /onedrive/conf --syncdir /onedrive/data)
echo "# Base Args: ${ARGS}"
# Tell client to use Standalone Mode, based on an environment variable. Otherwise Monitor Mode is used.
if [ "${ONEDRIVE_SYNC_ONCE:=0}" == "1" ]; then
echo "# We run in Standalone Mode"
echo "# Adding --sync"
ARGS=(--sync ${ARGS[@]})
else
echo "# We run in Monitor Mode"
echo "# Adding --monitor"
ARGS=(--monitor ${ARGS[@]})
fi
# Make Verbose output optional, based on an environment variable
if [ "${ONEDRIVE_VERBOSE:=0}" == "1" ]; then
echo "# We are being verbose"

View file

@ -287,6 +287,7 @@ docker run $firstRun --restart unless-stopped --name onedrive -v onedrive_conf:/
| <B>ONEDRIVE_DISABLE_UPLOAD_VALIDATION</B> | Controls "--disable-upload-validation" option. Default is 0 | 1 |
| <B>ONEDRIVE_SYNC_SHARED_FILES</B> | Controls "--sync-shared-files" option. Default is 0 | 1 |
| <B>ONEDRIVE_RUNAS_ROOT</B> | Controls if the Docker container should be run as the 'root' user instead of 'onedrive' user. Default is 0 | 1 |
| <B>ONEDRIVE_SYNC_ONCE</B> | Controls if the Docker container should be run in Standalone Mode. It will use Monitor Mode otherwise. Default is 0 | 1 |
### Environment Variables Usage Examples
**Verbose Output:**

View file

@ -304,6 +304,7 @@ podman run -it --name onedrive_work --user "${ONEDRIVE_UID}:${ONEDRIVE_GID}" \
| <B>ONEDRIVE_DISABLE_UPLOAD_VALIDATION</B> | Controls "--disable-upload-validation" option. Default is 0 | 1 |
| <B>ONEDRIVE_SYNC_SHARED_FILES</B> | Controls "--sync-shared-files" option. Default is 0 | 1 |
| <B>ONEDRIVE_RUNAS_ROOT</B> | Controls if the Docker container should be run as the 'root' user instead of 'onedrive' user. Default is 0 | 1 |
| <B>ONEDRIVE_SYNC_ONCE</B> | Controls if the Docker container should be run in Standalone Mode. It will use Monitor Mode otherwise. Default is 0 | 1 |
### Environment Variables Usage Examples
**Verbose Output:**