Zebradil / Gimme-iPhotos

Download media files from iCloud.
MIT License
119 stars 4 forks source link

Docker - MFA token persistant #27

Open SelfSufficient08 opened 3 years ago

SelfSufficient08 commented 3 years ago

Sorry if this was covered but is there a directory that i can make persistent so that MFA doesn't need entered at each run/container cycle? Would be cool if the tool had the ability to also grab the picture/video details like date taken and location.
Great work on this. Thanks for sharing.

Zebradil commented 3 years ago
  1. How do you run gimme-iphotos? I might need to add support for cookies directory (at least for docker).
  2. Did you check if this is in EXIF data on photos?
SelfSufficient08 commented 3 years ago
  1. I initially create the container with Portainer and use the console connection to run the first sync. This way I can plug in the MFA code. After that I want to edit the container start command to run the sync at startup but in order to add that startup command it basically creates a new container which doesn't have the authentication tokens and needs MFA done again but I cannot directly interacts with that run because it is running as a service. If I just reboot the original container and use a console connection, I can run the sync without it asking for MFA again because they must be cached somewhere. Do I just need to make the /app directory persistent?
  2. I apologize, it is under the advanced properties. I chose a couple older photos that did not have the info on the first look. I can see the info on all others. Thanks for all your work on this. Awesome tool!
Zebradil commented 3 years ago
  1. I did some research and seems to be possible to replicate the effect of "remember me" checkbox you have when visiting icloud.com in a browser. Will try to implement during this week.
  2. Great, thanks for checking :+1:
SelfSufficient08 commented 3 years ago

Thank you! A project that leverages MFA without needing to interact with the console is https://github.com/mrlt8/docker-wyze-bridge


Multi-Factor Authentication Two-factor authentication ("Two-Step Verification" in the wyze app) is supported and will automatically be detected, however additional steps are required to enter your verification code.

Echo the verification code directly to /tokens/mfa_token by opening a second terminal window and using:

docker exec -it wyze-bridge sh -c 'echo "123456" > /tokens/mfa_token' Mount /tokens/ locally and add your verification code to a file named mfa_token:

volumes:

It would be neat to use the same process for MFA where you update the file with the MFA token while the container is running and the script waits for the value to update. Once it grabs the token, it clears the file so that it is empty for the next time it needs it. Also, I still think with the remember me option that it will lose its keys when creating with the Remove container process in docker. I know I am doing a terrible job describing this. Sorry