From e3e214d0ebd20425c9d8c123e06c09d0636a6962 Mon Sep 17 00:00:00 2001 From: Mandar Patil Date: Wed, 7 Aug 2024 17:35:30 +0000 Subject: [PATCH] Updated docs for optional ENV_ICLOUD_PASSWORD --- README.md | 9 ++++----- src/notify.py | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3be41713..fd703128 100644 --- a/README.md +++ b/README.md @@ -22,13 +22,12 @@ Primary use case of iCloud-docker is to periodically sync wanted or all of your ### Installation using Docker Hub ``` -docker run --name icloud -v ${PWD}/icloud:/icloud -v ${PWD}/config:/config -e ENV_ICLOUD_PASSWORD= ENV_CONFIG_FILE_PATH=/config/config.yaml mandarons/icloud-drive +docker run --name icloud -v ${PWD}/icloud:/icloud -v ${PWD}/config:/config -e ENV_CONFIG_FILE_PATH=/config/config.yaml mandarons/icloud-drive ``` ### Installation using docker-compose ```yaml -version: "3.4" services: icloud: image: mandarons/icloud-drive @@ -36,7 +35,7 @@ services: - PUID= - PGID= env_file: - - .env.icloud # Must contain ENV_ICLOUD_PASSWORD= and ENV_CONFIG_FILE_PATH=/config/config.yaml + - .env.icloud # Must contain ENV_CONFIG_FILE_PATH=/config/config.yaml and optionally, ENV_ICLOUD_PASSWORD= container_name: icloud restart: unless-stopped volumes: @@ -50,14 +49,14 @@ services: ``` # Login manually if ENV_ICLOUD_PASSWORD is not specified and/or 2FA is required -docker exec -it icloud /bin/sh -c "icloud --username= --session-directory=/config/session_data" +docker exec -it --user=abc icloud /bin/sh -c "icloud --username= --session-directory=/config/session_data" ``` For China server users, Please add `--region=china` as follows: ``` # Login manually if ENV_ICLOUD_PASSWORD is not specified and/or 2FA is required -docker exec -it icloud /bin/sh -c "icloud --username= --region=china --session-directory=/config/session_data" +docker exec -it --user=abc icloud /bin/sh -c "icloud --username= --region=china --session-directory=/config/session_data" ``` Follow the steps to authenticate. diff --git a/src/notify.py b/src/notify.py index 026c7de8..71dd8f82 100644 --- a/src/notify.py +++ b/src/notify.py @@ -86,7 +86,7 @@ def send(config, username, last_send=None, dry_run=False): sent_on = None message = f"""Two-step authentication for iCloud Drive, Photos (Docker) is required. Please login to your server and authenticate. Please run - - `docker exec -it icloud /bin/sh -c + `docker exec -it --user=abc icloud /bin/sh -c "icloud --session-directory=/config/session_data --username={username}"`.""" subject = f"icloud-docker: Two step authentication is required for {username}" notify_telegram(