Make host/port configurable

This commit is contained in:
Lucas Verney 2024-04-19 16:27:54 +02:00
parent 29fa0ea435
commit 256625219e
2 changed files with 7 additions and 1 deletions

View File

@ -7,3 +7,6 @@ server = https://cloud.example.com
user = nextcloud_user user = nextcloud_user
password = nextcloud_password password = nextcloud_password
[webserver]
host = 'localhost"
port = 8081

View File

@ -106,7 +106,10 @@ def get_icloud_location(config):
"Two-factor authentication required. " "Two-factor authentication required. "
"Head over to http://localhost:8080 and fill-in the 2FA code." "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) app.run(server=server)
result = api.validate_2fa_code(code_2fa) result = api.validate_2fa_code(code_2fa)
print("Code validation result: %s" % result) print("Code validation result: %s" % result)