From c8e2f6cef7be37b896a50343b456f83d560984f1 Mon Sep 17 00:00:00 2001 From: NWuensche Date: Thu, 20 Aug 2026 15:00:52 +0200 Subject: [PATCH] fix: only prompt for credentials encryption when creds will be saved The encryption prompt for user_credentials.json was shown unconditionally in save_config, even when the user selected 'Save user configuration'. That option only writes user_configuration.json, so the credentials file was never created despite the misleading prompt. Gate the encryption prompt behind 'user_creds' and 'all' save options. --- archinstall/lib/configuration.py | 34 +++++++++++++++++--------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/archinstall/lib/configuration.py b/archinstall/lib/configuration.py index cb6844c3cd..6bf4d4fc5e 100644 --- a/archinstall/lib/configuration.py +++ b/archinstall/lib/configuration.py @@ -109,24 +109,26 @@ def preview(item: MenuItem) -> str | None: debug(f'Saving configuration files to {dest_path.absolute()}') - header = tr('Do you want to encrypt the user_credentials.json file?') + enc_password: str | None = None - enc_result = await Confirmation( - header=header, - allow_skip=False, - preset=False, - ).show() + if save_option in ('user_creds', 'all'): + header = tr('Do you want to encrypt the user_credentials.json file?') - enc_password: str | None = None - if enc_result.type_ == ResultType.Selection: - if enc_result.get_value(): - password = await get_password( - header=tr('Credentials file encryption password'), - allow_skip=True, - ) - - if password: - enc_password = password.plaintext + enc_result = await Confirmation( + header=header, + allow_skip=False, + preset=False, + ).show() + + if enc_result.type_ == ResultType.Selection: + if enc_result.get_value(): + password = await get_password( + header=tr('Credentials file encryption password'), + allow_skip=True, + ) + + if password: + enc_password = password.plaintext match save_option: case 'user_config':