Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1169

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176
8000 Add Apple iCloud Private Cloud Storage (PCS) - Advance Data Protection (ADP) by samuelexferri · Pull Request #8742 · rclone/rclone · GitHub
Nothing Special   »   [go: up one dir, main page]

Skip to content

Conversation

samuelexferri
Copy link
@samuelexferri samuelexferri commented Aug 11, 2025

Add Apple iCloud Private Cloud Storage (PCS) - Advance Data Protection (ADP)

What is the purpose of this change?

This PR makes rclone’s iCloud Drive backend work when Advanced Data Protection (ADP) is enabled on an Apple ID.

Was the change discussed in an issue or in the forum before?

ADP has been a frequent ask from users because iCloud Drive fails once ADP is turned on. This PR ports the working approach used in the Python pyicloud project (ADP PR) into rclone’s Go backend.

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

@samuelexferri
Copy link
Author
samuelexferri commented Aug 11, 2025

Could you please review this PR? Feel free to push improvements directly if you see a cleaner approach.

Open questions:

  • Confirm that the backend still works as expected with ADP disabled (baseline behavior)?
  • How often do devices prompt “Allow access” with ADP enabled? Does consent persist across runs, and what events reset it (e.g., password change, signing out, cookie expiry)? It seems after a while it needed a new Allow access.

Update the iCloud Drive backend docs (Markdown only?):

  • Remove the “ADP not supported” section and the related troubleshooting note.
  • Add a note that, with ADP enabled, the first run (and occasionally later, e.g., after token/cookie expiry) may require approving access on an Apple device signed in to the same Apple ID.
  • Mention that Access iCloud Data on the Web must be enabled on the device.

@ncw
Copy link
Member
ncw commented Aug 13, 2025

@lostb1t have you got time to take a look at this?

@samuelexferri
Copy link
Author

Is anyone available to review and improve the code?

@ncw
Copy link
Member
ncw commented Aug 24, 2025

@samuelexferri unfortunately I know very little about iCloud. @lostb1t wrote the backend.

Can you confirm the integration tests work your new code, with and without PCS?

We can try to get some testers from the issue - perhaps post there and ask for testers? Or on the forum?

@samuelexferri
Copy link
Author

I’ve updated the docs and done some minor cleanups. Unfortunately I wasn’t able to run full tests without ADP, since I’d prefer not to risk my main Apple account. If anyone can help with testing (with and without PCS), that would be really useful.

Yes it would also be great if @lostb1t could review the changes, since he wrote most of the backend originally.
Regarding performance: I’ve noticed the slowness too – it looks that is something related to API rate limits, pacer logic, or lack of upload batching in iclouddrive.go are the main reasons. That’s something we should probably address separately, since other backends (e.g. Dropbox) are much faster.

@bushvin
Copy link
bushvin commented Sep 7, 2025

Hello,
I use ADP, and have tested your remote WITH adp. TL;DR: it doesn't work for me.

./rclone --verbose config

Current remotes:

Name                 Type
====                 ====

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> n

Enter name for new remote.
name> iclouddrive

Option Storage.
Type of storage to configure.
Choose a number from below, or type in your own value.
...
Storage> iclouddrive

Option apple_id.
Apple ID.
Enter a value.
apple_id> ***redacted***

Option password.
Password.
Choose an alternative below.
y) Yes, type in my own password
g) Generate random password
y/g> y
Enter the password:
password:
Confirm the password:
password:

Edit advanced config?
y) Yes
n) No (default)
y/n> n

This is when my iphone asks for confirmations:
when configuring

  • shows "your account is being used", I click allow
  • shows web sign in-code (6 digits)
Option config_2fa.
Two-factor authentication: please enter your 2FA code
Enter a value.
config_2fa> ***redacted***

Configuration complete.
Options:
- type: iclouddrive
- apple_id: ***redacted***
- password: *** ENCRYPTED ***
- cookies: ***redacted***
- trust_token: ***redacted***
Keep this "iclouddrive" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y

But this is where it shows the 2fa code again on my iphone:
At this time the remote configurator is complete

  • shows "your account is being used", I click allow
  • shows web sign in-code (6 digits)

And obviously, there's no field where I need to fill it in...

Current remotes:

Name                 Type
====                 ====
iclouddrive          iclouddrive

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q

and then I try to read the root using
./rclone --verbose lsd iclouddrive:/:
It asks to confirom on my iphone, which I do

./rclone --verbose lsd iclouddrive:/
2025/09/07 09:17:05 INFO  : icloud: [PCS] Advanced Data Protection is active. Attempting to obtain consent from your trusted device.
2025/09/07 09:17:05 INFO  : icloud: [PCS] A request has been sent to your trusted Apple device(s). Please approve the request for web access to proceed.
2025/09/07 09:17:12 INFO  : icloud: [PCS] Still waiting for approval on your trusted device...
2025/09/07 09:17:17 INFO  : icloud: [PCS] Still waiting for approval on your trusted device...
2025/09/07 09:17:22 INFO  : icloud: [PCS] Approval received from trusted device.
2025/09/07 09:22:22 CRITICAL: Failed to create file system for "iclouddrive:/": icloud: ADP/PCS consent for iCloud Drive failed: timed out while waiting to obtain service cookies for iclouddrive

@jkulhanek
Copy link

Hi, I have the exact same issues as @bushvin

2025/10/14 12:55:00 INFO  : icloud: [PCS] Advanced Data Protection is active. Attempting to obtain consent from your trusted device.
2025/10/14 12:55:00 INFO  : icloud: [PCS] A request has been sent to your trusted Apple device(s). Please approve the request for web access to proceed.
2025/10/14 12:55:07 INFO  : icloud: [PCS] Still waiting for approval on your trusted device...
2025/10/14 12:55:12 INFO  : icloud: [PCS] Still waiting for approval on your trusted device...
2025/10/14 12:55:17 INFO  : icloud: [PCS] Approval received from trusted device.
2025/10/14 13:00:17 CRITICAL: Failed to create file system for "icloud:/": icloud: ADP/PCS consent for iCloud Drive failed: timed out while waiting to obtain service cookies for iclouddrive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

0