Skip to content

Commit

Permalink
feat: optionally use standalone mode for syncing using Docker contain…
Browse files Browse the repository at this point in the history
…er (#3018)

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

* Update podman.md
* Update podman.md

---------

Co-authored-by: abraunegg <[email protected]>
  • Loading branch information
PieterScheffers and abraunegg authored Nov 28, 2024
1 parent 44d639c commit c7f1b7f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
13 changes: 12 additions & 1 deletion contrib/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:**
Expand Down
1 change: 1 addition & 0 deletions docs/podman.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:**
Expand Down

0 comments on commit c7f1b7f

Please sign in to comment.