clan: clan ssh fix for new installer image #1243

Merged
clan-bot merged 1 commits from a-kenji-clan/fix-ssh into main 2024-04-17 16:25:38 +00:00

View File

@ -80,15 +80,15 @@ def is_reachable(host: str) -> bool:
def connect_ssh_from_json(ssh_data: dict[str, str]) -> None:
for address in ssh_data["local_addresses"]:
for address in ssh_data["addrs"]:
log.debug(f"Trying to reach host on: {address}")
if is_reachable(address):
ssh(host=address, password=ssh_data["password"])
ssh(host=address, password=ssh_data["pass"])
exit(0)
else:
log.debug(f"Could not reach host on {address}")
log.debug(f'Trying to reach host via torify on {ssh_data["onion_address"]}')
ssh(host=ssh_data["onion_address"], password=ssh_data["password"], torify=True)
log.debug(f'Trying to reach host via torify on {ssh_data["tor"]}')
ssh(host=ssh_data["tor"], password=ssh_data["pass"], torify=True)
def main(args: argparse.Namespace) -> None: