1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-13 03:19:47 +03:00

pmb.config: Print ssh keys filenames that will be copied during init (MR 2251)

Make it clear to the user which SSH keys get copied to the device, and
also link to the wiki page that tells the user how to change
ssh_key_glob.
This commit is contained in:
Luca Weiss 2024-02-07 11:59:58 +01:00 committed by Oliver Smith
parent 49fd496c94
commit 26f9d56b20
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -646,10 +646,17 @@ def ask_for_hostname(default: str | None, device: str) -> str:
def ask_for_ssh_keys(ssh_key_glob: str, default: bool) -> bool:
if not len(glob.glob(os.path.expanduser(ssh_key_glob))):
keys = glob.glob(os.path.expanduser(ssh_key_glob))
if not keys:
logging.info("NOTE: No SSH public keys found to copy to the device.")
logging.info("See https://postmarketos.org/ssh-key-glob for more information.")
return False
logging.info(f"SSH public keys found ({len(keys)}):")
for key in keys:
logging.info(f"* {key}")
logging.info("See https://postmarketos.org/ssh-key-glob for more information.")
return pmb.helpers.cli.confirm(
"Would you like to copy your SSH public keys to the device?", default=default
"Would you like to copy these public keys to the device?", default=default
)