From 4959b92178c178b09aa61cf5f40bfe0abe47f2ba Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Fri, 19 Apr 2024 16:34:52 +0200 Subject: [PATCH] Documentation --- README.md | 14 ++++++++++---- config.example.ini | 4 ++-- icloud_to_nextcloud.py | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5331d4d..3d76803 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,10 @@ Beware that your credentials will be stored in plaintext. You might want to enable 2FA everywhere and only run it on a trusted machine/environment (disk encryption, etc.). `cat`ing config in the following commands is here to help you add an extra layer of security at rest (symmetric GPG, etc.) on your -config file. For the Nextcloud part, you might want to use a dedicated access +config file (beware, secret data will still be available to anyone having +access to your files when your system is up). + +For the Nextcloud part, you might want to use a dedicated access token. @@ -39,9 +42,12 @@ Run `icloud` program a first time to ensure everything is running smooth: ./.venv/bin/icloud --username apple_username ``` -_Note:_ If you enabled 2FA on your Apple iCloud account, this first run will -be interactive and requires you explicitly trusting the session from one of -your device. +### Using 2FA + +If you enabled 2FA on your Apple iCloud account, the script will run a simple +webserver and point you to the URL on localhost to pass it the 2FA code you +will get from one of your iDevices. This makes the script trustable for some +time and this operation is only required once in a while (every month or so). ## Usage diff --git a/config.example.ini b/config.example.ini index d91c068..0521698 100644 --- a/config.example.ini +++ b/config.example.ini @@ -8,5 +8,5 @@ user = nextcloud_user password = nextcloud_password [webserver] -host = 'localhost" -port = 8081 +host = localhost +port = 8080 diff --git a/icloud_to_nextcloud.py b/icloud_to_nextcloud.py index 3848dd5..a0654a4 100644 --- a/icloud_to_nextcloud.py +++ b/icloud_to_nextcloud.py @@ -108,7 +108,7 @@ def get_icloud_location(config): ) server = StoppableCherootServer( host=config['webserver']['host'], - port=config['webserver']['port'] + port=int(config['webserver']['port']) ) app.run(server=server) result = api.validate_2fa_code(code_2fa)