syncthing-monitor/syncthing_monitor/__main__.py

20 lines
538 B
Python

from syncthing_monitor.config_xml import parse_api_key, set_listen_ip_to_any
from syncthing_monitor.etcd_cluster_info import append_device_id
from syncthing_monitor.syncthing_rest import get_device_id
def loop(gui_port="8384", host="sync"):
api_key = parse_api_key()
print("Found API Key: {0}".format(api_key))
set_listen_ip_to_any()
device_id = get_device_id(host, gui_port, api_key)
print("Found Device ID: {0}".format(device_id))
append_device_id(device_id, 'etcd')
if __name__ == "__main__":
loop()