Debug and Formatting

This commit is contained in:
CooperWang0912 2026-07-28 14:00:02 +08:00
parent 5178fa54c1
commit ebdc3f1a7a
2 changed files with 7 additions and 5 deletions

View File

@ -8,14 +8,15 @@ from archinstall.lib.translationhandler import tr
from archinstall.tui.menu_item import MenuItem, MenuItemGroup
from archinstall.tui.result import ResultType
async def confirm_ufw(config: ArchConfig) -> bool:
firewall_config = config.app_config.firewall_config
is_ufw = firewall_config and firewall_config.firewall and firewall_config.firewall.value == 'ufw'
has_openssh = "openssh" in config.packages
has_openssh = 'openssh' in config.packages
if not (is_ufw and has_openssh):
return True
else:
header = f'{tr("You have both ufw and OpenSSH in your packages")}. '
header += tr('Would you like to allow incoming SSH connections through the firewall?') + '\n'
@ -27,12 +28,13 @@ async def confirm_ufw(config: ArchConfig) -> bool:
allow_skip=False,
preset=True,
).show()
if result and result.get_value():
config.custom_commands.append("ufw allow OpenSSH")
config.custom_commands.append('ufw allow SSH')
return True
async def confirm_config(config: ArchConfig) -> bool:
header = f'{tr("The specified configuration will be applied")}. '
header += tr('Would you like to continue?') + '\n'

View File

@ -6,7 +6,7 @@ from archinstall.lib.applications.application_handler import ApplicationHandler
from archinstall.lib.args import ArchConfig, ArchConfigHandler
from archinstall.lib.authentication.authentication_handler import AuthenticationHandler
from archinstall.lib.bootloader.utils import validate_bootloader_layout
from archinstall.lib.configuration import confirm_ufw, confirm_config
from archinstall.lib.configuration import confirm_config, confirm_ufw
from archinstall.lib.disk.filesystem import FilesystemHandler
from archinstall.lib.disk.utils import disk_layouts
from archinstall.lib.general.general_menu import PostInstallationAction, select_post_installation