Store cookie outside of /tmp

This commit is contained in:
Lucas Verney 2024-07-20 20:49:44 +02:00
parent 4959b92178
commit 1744e3bbdf
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
[apple]
email = apple_icloud_email
password = apple_icloud_password
cookie_directory = COOKIE_DIRECTORY
[nextcloud]
server = https://cloud.example.com

View File

@ -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'],