Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Support] mandarons - icloud

Featured Replies

Support for icloud template

Application Name: icloud
Application: https://github.com/mandarons/icloud-docker

Documentation: https://github.com/mandarons/icloud-docker/blob/main/README.md

Overview : Dockerized iCloud Client - make a local copy of your iCloud documents and photos, and keep it automatically up-to-date.

 

Make sure to look at the complete documentation

 

Please post any questions/issues relating to this docker template you have in this thread.

Edited by mandarons

  • ich777 changed the title to [Support] mandarons - icloud
  • 2 months later...

I didnt see how we are to use 2fa, i get sent a code to enter. is that supported?

  • Author

Yes it is supported. from README:
 

# Login manually if ENV_ICLOUD_PASSWORD is not specified and/or 2FA is required

 

docker exec -it --user=abc icloud /bin/sh -c "icloud --username=<icloud-username> --session-directory=/config/session_data"

Edited by mandarons

  • 1 month later...

Maybe I'm missing something, but how do you control the sync frequency? Looking at the logs, there hadn't been a sync in days and I had to restart the container to initiate a sync again.

On 9/7/2024 at 1:38 PM, mandarons said:

Yes it is supported. from README:
 

# Login manually if ENV_ICLOUD_PASSWORD is not specified and/or 2FA is required

 

docker exec -it --user=abc icloud /bin/sh -c "icloud --username=<icloud-username> --session-directory=/config/session_data"

 

For me, I updated the above command to automatically determine the icloud container id (instead of hardcoding 'icloud' as the container id) as such:

 

docker exec -it --user=abc $(docker ps --filter "ancestor=mandarons/icloud-drive" -q) /bin/sh -c "icloud --username=<icloud-username> --session-directory=/config/session_data"

 

I seem to be having some problems since I didn't save the password in the 'keyring' when I first logged in successfully.

 

My first login had some problems (due to a misconfiguration in my config.yaml file, i believe).  The error I got after providing my password was such (NOTE: not my real username):

 

==============================================================

COMMAND:

=========

# docker exec -it --user=abc $(docker ps --filter "ancestor=mandarons/icloud-drive" -q) /bin/sh -c "icloud [email protected] --session-directory=/config/session_data"

 

OUTPUT:

========

Enter iCloud password for [email protected]

Save password in keyring? [y/N]: N

Traceback (most recent call last):

  File "/lsiopy/bin/icloud", line 8, in <module>

    sys.exit(main())

             ^^^^^^

  File "/lsiopy/lib/python3.11/site-packages/icloudpy/cmdline.py", line 295, in main

    for dev in api.devices:

               ^^^^^^^^^^^

  File "/lsiopy/lib/python3.11/site-packages/icloudpy/base.py", line 556, in devices

    return FindMyiPhoneServiceManager(

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/lsiopy/lib/python3.11/site-packages/icloudpy/services/findmyiphone.py", line 28, in __init__

    self.refresh_client()

  File "/lsiopy/lib/python3.11/site-packages/icloudpy/services/findmyiphone.py", line 36, in refresh_client

    req = self.session.post(

          ^^^^^^^^^^^^^^^^^^

  File "/lsiopy/lib/python3.11/site-packages/requests/sessions.py", line 635, in post

    return self.request("POST", url, data=data, json=json, **kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/lsiopy/lib/python3.11/site-packages/icloudpy/base.py", line 129, in request

    return self.request(method, url, **kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/lsiopy/lib/python3.11/site-packages/icloudpy/base.py", line 131, in request

    self._raise_error(response.status_code, response.reason)

  File "/lsiopy/lib/python3.11/site-packages/icloudpy/base.py", line 187, in _raise_error

    raise api_error

icloudpy.exceptions.ICloudPyAPIResponseException: Authentication required for Account. (450)

 

======================================================================

 

After I fixed the config.yaml file, I tried re-running the above and then I got:

Enter iCloud password for [email protected]
Bad username or password for [email protected]

 

======================================================================

 

Then, I tried uninstalling the app and deleting/re-creating the /mnt/.../appdata/icloud directory & config.yaml file. 

 

I also tried with and without setting the ENV_ICLOUD_PASSWORD environment variable in the docker settings without success.

 

After re-installing without the password, I get the following message:

===================================================================

2024-10-21 15:26:00,119 :: ERROR :: root :: sync.py :: 116 :: Password is not stored in keyring. Please save the password in keyring.
2024-10-21 15:26:00,120 :: INFO :: root :: config_parser.py :: 69 :: Retrying login every 600 seconds.
2024-10-21 15:26:00,120 :: INFO :: root :: sync.py :: 126 :: Retrying login at Mon Oct 21 15:36:00 2024 ...

 

===================================================================

 

At this point, I thought by uninstalling the application, I would be able to start over, but it seems like something is still referencing my original authentication & 2FA confirmation (which I did originally see the prompt on my iPhone).

 

Is there some way I can force the 2FA authentication again and/or redo the authentication such that I can store the password in the 'keyring' (although I don't really want to do it...but if storing in the keyring is required, then I guess I have no other choice).

 

Sorry for the lengthy post.

 

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

UPDATED 10/21/24 16:20PM EST

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I restored a previous version of my /config/session_data directory and tried responding with 'y' to save the password in the 'keyring', but I got the following error:
 

===================================

COMMAND (from inside the container):

===================================

$ icloud [email protected] --session-directory=/config/session_data

 

OUTPUT:

========
Enter iCloud password for [email protected]
Save password in keyring? [y/N]: y
Traceback (most recent call last):
  File "/lsiopy/bin/icloud", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/icloudpy/cmdline.py", line 295, in main
    for dev in api.devices:
               ^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/icloudpy/base.py", line 556, in devices
    return FindMyiPhoneServiceManager(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/icloudpy/services/findmyiphone.py", line 28, in __init__
    self.refresh_client()
  File "/lsiopy/lib/python3.11/site-packages/icloudpy/services/findmyiphone.py", line 36, in refresh_client
    req = self.session.post(
          ^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/requests/sessions.py", line 635, in post
    return self.request("POST", url, data=data, json=json, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/icloudpy/base.py", line 129, in request
    return self.request(method, url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/icloudpy/base.py", line 131, in request
    self._raise_error(response.status_code, response.reason)
  File "/lsiopy/lib/python3.11/site-packages/icloudpy/base.py", line 187, in _raise_error
    raise api_error
icloudpy.exceptions.ICloudPyAPIResponseException: Authentication required for Account. (450)

 

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 

UPDATED (again) 10/21/24 16:25 --

 

Apparently, it is beginning to sync in spite of the above errors.  I can see the following messages in the log file:

2024-10-21 16:14:29,566 :: WARNING :: root :: config_parser.py :: 164 :: Warning: password is not found in app > smtp > password
2024-10-21 16:14:29,566 :: WARNING :: root :: notify.py :: 131 :: Not sending 2FA notification because SMTP is not configured
2024-10-21 16:24:30,204 :: INFO :: root :: sync.py :: 82 :: Syncing drive...
2024-10-21 16:24:34,396 :: INFO :: root :: sync_drive.py :: 203 :: Downloading /icloud/drive/Documents/....xlsx ...
2024-10-21 16:24:39,491 :: INFO :: root :: sync_drive.py :: 203 :: Downloading /icloud/drive/Documents/....pdf ...
2024-10-21 16:24:40,723 :: INFO :: root :: sync_drive.py :: 203 :: Downloading /icloud/drive/Documents/...e.pdf ...
etc...

 

NEVERMIND ... please feel free to ignore this post (or retain it for others).

 

If this continues to work like this, I think you have earned a coffee or two !!   Thank you!
 

Edited by myuseridbws

On 10/15/2024 at 11:01 AM, manHands said:

Maybe I'm missing something, but how do you control the sync frequency? Looking at the logs, there hadn't been a sync in days and I had to restart the container to initiate a sync again.

 

After my initial sync, I performed a test where I added a new (file), renamed a file and deleted a directory (from the iCloud side of things).  I have waited almost 24 hours and I don't see the new or renamed files in my local directory.  The directory also continues to exist in my local directory; however, I'm not entirely sure if I should expect it to be deleted considering I have 'remove_obsolete: false'.

 

Docker version:

# docker inspect mandarons/icloud-drive
[
    {
        "Id": "sha256:0d650efec70df99f1fc94027e60234eba13c76c00c57a87721b32596de89e62f",
        "RepoTags": [
            "mandarons/icloud-drive:latest"
        ],
        "RepoDigests": [
            "mandarons/icloud-drive@sha256:5cb57c084f6fa66a78f5f7fe19b7e95bfa4b217085831d2ab4d98836ecf503ba"
        ],
        "Parent": "",
        "Comment": "buildkit.dockerfile.v0",
        "Created": "2024-08-09T14:05:43.656611499Z",

 

 

config.yaml snippet:

drive:
  destination: "drive"
  remove_obsolete: false
  sync_interval: 300
  filters:
    folders:
      - "Documents"
    file_extensions:
      # File extensions to be included
      - "xlsx"
      - "XLSX"
      - "pdf"

 

20 hours ago, myuseridbws said:

After my initial sync, I performed a test where I added a new (file), renamed a file and deleted a directory (from the iCloud side of things).  I have waited almost 24 hours and I don't see the new or renamed files in my local directory.  The directory also continues to exist in my local directory; however, I'm not entirely sure if I should expect it to be deleted considering I have 'remove_obsolete: false'.

After restarting the service and changing 'drive.remove_obsolete' to 'true', the renamed/moved files files were sync-d properly and the deleted directory also was removed locally.  

 

In conclusion, the synchronization seems to be working properly after restart (including local file removal of deleted cloud files/directories).

 

However, I haven't observed the synchronization working without restarting the container.

49 minutes ago, myuseridbws said:

In conclusion, the synchronization seems to be working properly after restart (including local file removal of deleted cloud files/directories).

 

However, I haven't observed the synchronization working without restarting the container.

This is my experience as well... unfortunate.

Hi, I'm having "icloudpy.base :: base.py :: 186 :: Service Temporarily Unavailable (503)" errors in authentication. This happens either by providing ENV_ICLOUD_PASSWORD in .env.icloud and by entering icloud password with command "icloud --username=<icloud-username> --session-directory=/config/session_data".

 

A similar service is having similar issues in the last few days (https://github.com/boredazfcuk/docker-icloudpd/issues/670); wondering is there's something similar - apparently related to an ongoing protocol change by apple - going on here.

 

21 hours ago, fabio.barbon said:

Hi, I'm having "icloudpy.base :: base.py :: 186 :: Service Temporarily Unavailable (503)" errors in authentication. This happens either by providing ENV_ICLOUD_PASSWORD in .env.icloud and by entering icloud password with command "icloud --username=<icloud-username> --session-directory=/config/session_data".

 

UPDATE. Manually patching icloudpy from the following PR solved the issue: https://github.com/mandarons/icloudpy/pull/49

  • 2 weeks later...
On 10/29/2024 at 6:50 AM, fabio.barbon said:

UPDATE. Manually patching icloudpy from the following PR solved the issue: https://github.com/mandarons/icloudpy/pull/49

I reached the same conclusion (that this patch is needed), but am a little confused on exactly which file to patch, as the two projects don't have the exact same file structure. The one patched is base.py. I am thinking some parts would be applied to this container's sync.py? Would you mind either sharing a copy of the updated file or more details of which file and lines you changed? Thanks!

  • 3 weeks later...
On 10/29/2024 at 5:50 AM, fabio.barbon said:

UPDATE. Manually patching icloudpy from the following PR solved the issue: https://github.com/mandarons/icloudpy/pull/49

Can you provided details on how you did this while we wait for the dev to implement the changes? Thanks!

  • 3 weeks later...

Can someone please explain the settings to me in more detail?

I've got everything working so far but I don't understand some of the settings.

 

The iCloud Drive is not synchronized. It doesn't give any error messages, it just says that everything is OK. Unfortunately the folder is empty. If I enter the individual folders then it is synchronized but only the folders are created... no content.

Can't all the folders and files in it just be synchronized? Do I have to enter each folder individually? And why do the folders remain empty?

 

It's different with photos... everything is synchronized there as soon as I enter the folders. Can I also set it so that everything in it is automatically synchronized?

 

Thank you very much for your help.

  • 1 month later...

@mandarons, I just started to use the app/docker and I have everything running fine, with no apparent issues, however I do have question regarding the config.yaml.  I would like to receive an email notification whenever iCloud requires re-authentication.  My question is: does the email password in config.yaml go inside of quotes?  The template does not indicate that it does, but I would like to make sure this is correct.  Thanks for your help.

  • 4 weeks later...

Hi everyone,

can someone help me please to understand what is the problem ?

 

2025-03-10 12:15:56,857 :: INFO :: root :: sync.py :: 75 :: Syncing drive...
2025-03-10 12:15:57,212 :: INFO :: root :: sync.py :: 77 :: Drive synced
2025-03-10 12:15:57,212 :: INFO :: root :: config_parser.py :: 83 :: Syncing drive every 300 seconds.
2025-03-10 12:15:57,212 :: INFO :: root :: sync.py :: 80 :: Syncing photos...
2025-03-10 12:15:57,469 :: ERROR :: icloudpy.base :: base.py :: 168 :: Zone does not exist. Please log into https://icloud.com/ to manually finish setting up your iCloud service (ZONE_NOT_FOUND)

 

Even if im in zone global and the yaml is ok. Im in Italy and my account is configured.

thank you very much

  • 3 weeks later...
On 3/10/2025 at 12:35 PM, 1HP said:

Hi everyone,

can someone help me please to understand what is the problem ?

 

2025-03-10 12:15:56,857 :: INFO :: root :: sync.py :: 75 :: Syncing drive...
2025-03-10 12:15:57,212 :: INFO :: root :: sync.py :: 77 :: Drive synced
2025-03-10 12:15:57,212 :: INFO :: root :: config_parser.py :: 83 :: Syncing drive every 300 seconds.
2025-03-10 12:15:57,212 :: INFO :: root :: sync.py :: 80 :: Syncing photos...
2025-03-10 12:15:57,469 :: ERROR :: icloudpy.base :: base.py :: 168 :: Zone does not exist. Please log into https://icloud.com/ to manually finish setting up your iCloud service (ZONE_NOT_FOUND)

 

Even if im in zone global and the yaml is ok. Im in Italy and my account is configured.

thank you very much

help someone please ?

  • 4 months later...

Hi

Two questions:

  1. I get missing apple_id all the time. Anyone knows how to fix this?

  1. Does this docker also upload new files that I put in the iCloud folder?

Thanks.

  • 2 months later...

I dont understand how to use this, everytime I set it up before I even have time to run the docker exec command the container has crashed because it cant find the session file. How do I prevent this from happening?

  • 2 months later...

I just tried running this and ran into the issue that I couldn't do my 2FA authentification command because the container would always stop before I could access it from the Unraid console.

To get it running, I

  1. added "sleep infinity" as a post argument in the advanced view when configuring the container from the Unraid UI, so the container wouldn't automatically stop

  2. opened the container console

  3. ran

    chown -R abc:abc /config
    icloud --username=<my-icloud-email> --session-directory=/config/session_data
  4. signed in using 2FA

  5. stopped the container

  6. right-clicked "edit" on the container setup in Unraid UI

  7. removed the "sleep infinity" post argument in the advanced view and finished my edit

Only then did my container restart correctly backing up my files.

Edited by maria02
accidentaly added quote instead of code block

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.