From 99271a45dea0d04e80799486fab7bc0821da5d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Martins?= <45715331+thegoncalomartins@users.noreply.github.com> Date: Mon, 24 Jul 2023 01:41:06 +0100 Subject: [PATCH] Add --no-remote-delete flag to docker entrypoint (#2453) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add --no-remote-delete flag to docker entrypoint --------- Co-authored-by: Gonçalo Martins Co-authored-by: abraunegg --- contrib/docker/entrypoint.sh | 7 +++++++ docs/Docker.md | 1 + docs/Podman.md | 1 + 3 files changed, 9 insertions(+) diff --git a/contrib/docker/entrypoint.sh b/contrib/docker/entrypoint.sh index 3e1da8fd..8eb52948 100755 --- a/contrib/docker/entrypoint.sh +++ b/contrib/docker/entrypoint.sh @@ -69,6 +69,13 @@ if [ "${ONEDRIVE_UPLOADONLY:=0}" == "1" ]; then ARGS=(--upload-only ${ARGS[@]}) fi +# Tell client to sync in no-remote-delete mode based on environment variable +if [ "${ONEDRIVE_NOREMOTEDELETE:=0}" == "1" ]; then + echo "# We are synchronizing in no-remote-delete mode" + echo "# Adding --no-remote-delete" + ARGS=(--no-remote-delete ${ARGS[@]}) +fi + # Tell client to logout based on environment variable if [ "${ONEDRIVE_LOGOUT:=0}" == "1" ]; then echo "# We are logging out" diff --git a/docs/Docker.md b/docs/Docker.md index 6c555f83..41899082 100644 --- a/docs/Docker.md +++ b/docs/Docker.md @@ -207,6 +207,7 @@ docker run $firstRun --restart unless-stopped --name onedrive -v onedrive_conf:/ | ONEDRIVE_RESYNC | Controls "--resync" switch on onedrive sync. Default is 0 | 1 | | ONEDRIVE_DOWNLOADONLY | Controls "--download-only" switch on onedrive sync. Default is 0 | 1 | | ONEDRIVE_UPLOADONLY | Controls "--upload-only" switch on onedrive sync. Default is 0 | 1 | +| ONEDRIVE_NOREMOTEDELETE | Controls "--no-remote-delete" switch on onedrive sync. Default is 0 | 1 | | ONEDRIVE_LOGOUT | Controls "--logout" switch. Default is 0 | 1 | | ONEDRIVE_REAUTH | Controls "--reauth" switch. Default is 0 | 1 | | ONEDRIVE_AUTHFILES | Controls "--auth-files" option. Default is "" | "authUrl:responseUrl" | diff --git a/docs/Podman.md b/docs/Podman.md index c17c5411..7f3a79d1 100644 --- a/docs/Podman.md +++ b/docs/Podman.md @@ -215,6 +215,7 @@ podman run -it --restart unless-stopped --name onedrive_work \ | ONEDRIVE_RESYNC | Controls "--resync" switch on onedrive sync. Default is 0 | 1 | | ONEDRIVE_DOWNLOADONLY | Controls "--download-only" switch on onedrive sync. Default is 0 | 1 | | ONEDRIVE_UPLOADONLY | Controls "--upload-only" switch on onedrive sync. Default is 0 | 1 | +| ONEDRIVE_NOREMOTEDELETE | Controls "--no-remote-delete" switch on onedrive sync. Default is 0 | 1 | | ONEDRIVE_LOGOUT | Controls "--logout" switch. Default is 0 | 1 | | ONEDRIVE_REAUTH | Controls "--reauth" switch. Default is 0 | 1 | | ONEDRIVE_AUTHFILES | Controls "--auth-files" option. Default is "" | "authUrl:responseUrl" |