Open brunoamaral opened 10 months ago
Experiencing this issue as well. Pretty odd. Also testing with mailgun.
Experimenting with this compose file:
services:
icloudpd:
stdin_open: true
tty: true
container_name: icloudpd
volumes:
- /data:/data
environment:
- TZ=America/New_York
image: icloudpd/icloudpd:latest
command: >
icloudpd
--directory /data
--username [ . . . ]
--watch-with-interval 3600
--auto-delete
--smtp-username [ . . . ]
--smtp-password [ . . . ]
--smtp-port 587
--smtp-host smtp.mailgun.org
--notification-email [ . . . ]
--notification-email-from [ . . . ]
Same issue here on Docker.
This worked well without notification :
docker run -it --rm --name icloudpd -v /_redacted_/Photos:/data -e TZ=America/Toronto icloudpd/icloudpd:latest icloudpd --directory /data --username _redacted_ --watch-with-interval 86400 --log-level info
iCloud Password:
2024-02-01 22:47:29 INFO Two-step/two-factor authentication is required (2fa)
Please enter two-factor authentication code: _redacted_
2024-02-01 22:47:48 WARNING Failed to parse response with JSON mimetype
2024-02-01 22:47:50 INFO Great, you're all set up. The script can now be run without user interaction until 2SA expires.
You can set up email notifications for when the two-step authentication expires.
(Use --help to view information about SMTP options.)
2024-02-01 22:47:53 INFO Downloading 7656 original photos and videos to /data ...
2024-02-01 22:51:12 INFO All photos have been downloaded
2024-02-01 22:51:12 INFO Waiting for 86400 sec...
This one did not worked with notification :
docker run -it --rm --name icloudpd -v /_redacted_/Photos:/data -e TZ=America/Toronto icloudpd/icloudpd:latest icloudpd --directory /data --username _redacted_ --watch-with-interval 86400 --smtp-username _redacted_ --smtp-password _redacted_ --smtp-host smtp.sendgrid.net --notification-email _redacted_ --notification-email-from _redacted_
2024-02-01 22:45:50 DEBUG Authenticating...
iCloud Password:
2024-02-01 22:46:03 INFO Sending 'two-step expired' notification via email...
Also, is there any way in Docker to save password and MFA when the container is restarted?
Thank you!
The behavior to exit if notification is requested, has been in the code base for some time (==not a recent change).
What is the use case for email notification? If 2fa is required, then Apple is showing alert on a relevant device without extra action from icloudpd
, so user is notified. I assume that 2fa request has some expiration, so if user has not responded to alert, authentication needs to start all over. From that perspective, makes sense to exit when sending notification with expected long response time (email response is presumably slower than alert on a device). I do not know if Apple behavior for 2fa alerts were different when email notification for icloudpd
was implemented.
Overview
Adding notifications with smtp stops the script after entering a password and before we have time to enter de 2FA.
Steps to Reproduce
Expected Behavior
Wait for the user to input the 2FA before proceeding
Actual Behavior
Context