-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot get this to work/run in my Docker setup #741
Comments
If your version of docker puts it's volumes in the default location, your config files will be in /var/lib/docker/volumes/icloudpd__config/_data/ on the host operating system. Alternatively, you can run
|
Thanks! I see that folder structure:
Aaannndd I see what I did wrong, doh! My volume mapping in compose is not how it should have been. This:
Should have been this:
As that maintains my folder structure as I have for all other containers. Now this line in the volumes section of the compose has me confused now that I started to cast my lazy eyes on it:
I think that should be:
What seems to be wrong there is that local relative folder Going to try it out now!
Thanks! 😁 |
Ok, all is running now as I would expect it, at least regarding logs and folders created. I did have to create a file called icloudpd.conf content which might be relevant:
compose on volumes as I now have:
So the questions I now have are "where are these downloaded files?" and "why did I have to go into the container and create a file before the downloads started to happen?" |
This is a pretty much how I define my containers in my docker-compose file (I've a removed a few bits for clarity and changed names to protect the guilty).
All the config directories are mapped to docker volumes, but the data directories are absolute paths. That way I can move this compose file anywhere on my system and it will still map the directories where I want them to be (I'm not a fan of using relative directories starting ./) |
To elaborate... the volume mappings are "directory on the host server:directory in the container" so:
maps the /home/user4/iCloud/ directory on the host computer to /home/user4/iCloud inside the container (in this instance, you want also want your download_path variable set to /home/user4/iCloud Some people like to have the download path inside the container set to /downloads/ or maybe /icloud/. In that case your compose file volume mapping would be:
and you'd have you download_path=/downloads/ (or maybe without the trailing slash on the variable, I don't remember it if handles that or not lol) |
You should not be creating that from inside the container. This must be created from outside the container. It's how the container knows the volume is correctly mounted. It's to avoid this scenario...
You set user=user2 and download_path=/home/user2/iCloud in your icloudpd.conf file. Also, if you create it in the correct location inside the container, but with an incorrect volume mapping in your docker compose file, then correct the docker compose file, the .mounted file will seem to have disappeared (it's actually underneath the volume mapping). Then say your mapped volume dismounts, because there is a disk fault. The original .mounted file will now be exposed, but the container will not find any downloaded photos, so will go and download 50GB of photos again... this could potentially fill your server's boot directory and crash the whole system. |
Got it and thanks for the explanation. I kinda knew this (the folder part that is) but it is good to be reminded. I kept the config to what I pasted above but I had to adjust compose config like so:
This way the container keeps using the user Files are downloading as we type! I was wondering, is there a reset you can do, to start the downloading all over? Where does it register what was downloaded or does it do a compare of the files? Curious minds... Are there functions to control icloudpd, something like that |
Yeah, I have user=ipad in my icloudpd.conf so that I can map to
There's no database, it just looks at what's in icloud and then copies it to the local filesystem. When I first started using it, I had folder structure set to 'none' as I liked them all in a flat file structure so it matched the photo library on my phone. After a while I realised that there's a limit of 10k pictures per directory, so setting it to 'none' limited me to 10k photos in total. Setting it to 'Year' allowed 10k photos per year... so now I set it to Year/Month so I can have 10k photos per month. Having Year/Month/Day allows 10k photos per day lol
The sync-icloud.sh script does all the heavy lifting. It supports a few command line options to upload your library to a nextcloud server, also for HEIC to JPEG conversion. Telegram integration is the only bit of it that I use frequently. I have a chat bot set up in Telegram and that's how I get the notifications about what has been sync'd/deleted, but I can also message that bot with "ipad" and the ipad container will spot that message and trigger a download run. Messaging it with "user1" and the "user1" container spots it and triggers a download run. I can also message with "user2 auth" and it will start the MFA re-authentication process. It will then message back with the MFA options... Apple MFA code, SMS to main number, or SMS to trusted number and I message it back with the option I want. Once I get the MFA code on my phone, I'll send "user 123654" or whatever, and the container will pick that up and use it to authenticate. Saves me having to faff about with the laptop to re-confirm MFA. I can remotely control all 5 (soon to be 6) containers this way. |
Thanks for the extensive explanation! And good luck managing even more containers in the future 😄 So I guess restarting the container will trigger a sync and download action. And a big Thanks for creating this valuable tool! |
Yeah, or it will download as per the configured sync interval... plus the manual syncs which can be forced via Telegram. If you want the container to be switched off all the time, you can set single_pass=true and the container will exit after it is run. If you have That way you can use the host's cron jobs to launch the container as per your desired schedule. |
One more question (starting to sound like Columbo...) I do not use telegram but I am interested in automating the MFA part of it all. I do use Signal and Whatsapp though. Say I am able to create a REST API endpoint that I could call remotely. And you can assume that the endpoint is able to connect to the icloudpd container and start a script of some sort. What would I need to do to get the MFA generated on the container? Or if I can create that authentication somewhere else and copy the cookie/etc to the icloudpd container, would that work? Any insight you have or can point me to will help! |
The .exp file is where all the magic happens. It's an Expect script which interacts with the icloudpd download utility. The icoudpd utility is what performs the MFA authentication, so that is what you need to interact with. Basically the expect script scrapes the output of icloudpd and looks for text patterns. It will then do different things based on those patterns, such as send the message listing the mobile numbers available, or to let the user know that the process failed/was successful. You'll need to write something similar, either using expect, or something else which can do the same... I can't comment on whether cookie copying will work or not. I do believe that I've seen someone say that they've had success with this before, but I've not attempted it myself, so cannot confirm. |
I'd not heard his name in a decade, but now it's twice in one week... We were talking about him at work, but then had to explain to the new kids who he was coz they are too young to have a clue! |
Thanks for the explanation! And yeah, I have to explain Columbo to people as well. Brilliant show. |
Hi
Trying to setup icloudpd on docker at home and I fail, horribly.
I tried to follow the guidelines but I must have missed some crucial part of instructions or I'm an idiot for not seeing the obvious.
I understand the env variables moved from compose file to that new conf file
icloudpd.conf
but it is unclear if this needs to be prepared up front or is created by icloudpd itself.The user running all commands is "steven" with ID 1000 and I make sure all folders and files have this set as the user with rw attributes.
I run several containers in this Docker setup so I know at it's core my Docker setup seems to be fine.
I created the docker compose file as per the example given and I get these issues:
No configuration files are created. I created the folders
icloudpd_steven_config
andicloudpd_esther_config
under theiCloud
folder. I restarted the containers, no config files are to be seen.I expected the file
icloudpd.conf
to be present in both users folders but perhaps that is part of my misunderstanding?Looking at the logs after startup I see:
docker exec -it icloudpd_steven sync-icloud.sh --Initialise
I get:/home/steven/iCloud
and created the file.mounted
in it, did not seem to helpMy compose file loks like this:
Any ideas what could be wrong? Again, I must have missed something simple because it should not be this problematic I think. Many people run this so I do seem to be missing some info or insight here.
The text was updated successfully, but these errors were encountered: