From 1744e3bbdf9a3f87e897ad25ae47b18d04703f97 Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Sat, 20 Jul 2024 20:49:44 +0200 Subject: [PATCH] Store cookie outside of /tmp --- config.example.ini | 1 + icloud_to_nextcloud.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config.example.ini b/config.example.ini index 0521698..f23c82a 100644 --- a/config.example.ini +++ b/config.example.ini @@ -1,6 +1,7 @@ [apple] email = apple_icloud_email password = apple_icloud_password +cookie_directory = COOKIE_DIRECTORY [nextcloud] server = https://cloud.example.com diff --git a/icloud_to_nextcloud.py b/icloud_to_nextcloud.py index a0654a4..4ea94cf 100644 --- a/icloud_to_nextcloud.py +++ b/icloud_to_nextcloud.py @@ -99,12 +99,12 @@ def get_icloud_location(config): global code_2fa email = config['apple']['email'] password = config['apple']['password'] - api = PyiCloudService(email, password) + api = PyiCloudService(email, password=password, cookie_directory=config['apple']['cookie_directory']) if api.requires_2fa: print( "Two-factor authentication required. " - "Head over to http://localhost:8080 and fill-in the 2FA code." + f"Head over to http://{config['webserver']['host']}:{config['webserver']['port']} and fill-in the 2FA code." ) server = StoppableCherootServer( host=config['webserver']['host'],