Skip to content

Commit

Permalink
[Fix] v1.18.1 binary path + login doesn't persist (#207) (#208)
Browse files Browse the repository at this point in the history
* Added /venv/bin to PATH and /app to PYTHONPATH;

* Updated docs to specify --user=icd;
  • Loading branch information
mandarons committed May 15, 2024
1 parent 1083624 commit 1c9c4f0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ COPY --from=build /venv /venv
RUN apk update && apk add sudo libmagic shadow dumb-init
COPY . /app/
WORKDIR /app
ENV PATH="/venv/bin/:$PATH"
ENV PYTHONPATH="/app:${PYTHONPATH}"
ENTRYPOINT ["dumb-init", "--"]
CMD ["/app/init.sh"]
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,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=<icloud-username> --session-directory=/app/session_data"
docker exec -it --user=icd icloud /bin/sh -c "icloud --username=<icloud-username> --session-directory=/app/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=<icloud-username> --region=china --session-directory=/app/session_data"
docker exec -it --user=icd icloud /bin/sh -c "icloud --username=<icloud-username> --region=china --session-directory=/app/session_data"
```

Follow the steps to authenticate.
Expand Down Expand Up @@ -164,4 +164,3 @@ As mentioned in [USAGE.md](https://github.com/mandarons/icloud-drive-docker/blob
[github-sponsors-badge]: https://img.shields.io/github/sponsors/mandarons
[discord]: https://discord.gg/33TuzKFE
[discord-badge]: https://img.shields.io/discord/871555550444408883

5 changes: 3 additions & 2 deletions src/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

MESSAGE_BODY = """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 "icloud --username=<icloud-username>
`docker exec -it --user=icd icloud /bin/sh -c "icloud --username=<icloud-username>
--session-directory=/app/session_data"`."""


Expand Down Expand Up @@ -137,6 +137,7 @@ def build_message(email, to_email):
message.subject = "icloud-docker: Two step authentication required"
message.body = """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 "icloud --username=<icloud-username> --session-directory=/app/session_data"`."""
`docker exec -it --user=icd icloud /bin/sh -c "icloud --username=<icloud-username>
--session-directory=/app/session_data"`."""

return message

0 comments on commit 1c9c4f0

Please sign in to comment.