From 256625219e616def02927a0e2f965cea742bf7c5 Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Fri, 19 Apr 2024 16:27:54 +0200 Subject: [PATCH] Make host/port configurable --- config.example.ini | 3 +++ icloud_to_nextcloud.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config.example.ini b/config.example.ini index 1cede7c..d91c068 100644 --- a/config.example.ini +++ b/config.example.ini @@ -7,3 +7,6 @@ server = https://cloud.example.com user = nextcloud_user password = nextcloud_password +[webserver] +host = 'localhost" +port = 8081 diff --git a/icloud_to_nextcloud.py b/icloud_to_nextcloud.py index 1d54ee4..3848dd5 100644 --- a/icloud_to_nextcloud.py +++ b/icloud_to_nextcloud.py @@ -106,7 +106,10 @@ def get_icloud_location(config): "Two-factor authentication required. " "Head over to http://localhost:8080 and fill-in the 2FA code." ) - server = StoppableCherootServer(port=8080) + server = StoppableCherootServer( + host=config['webserver']['host'], + port=config['webserver']['port'] + ) app.run(server=server) result = api.validate_2fa_code(code_2fa) print("Code validation result: %s" % result)