Initial Testing

This commit is contained in:
CooperWang0912 2026-07-28 13:04:13 +08:00
parent 88e524231b
commit 113988a6aa
2 changed files with 19 additions and 1 deletions

View File

@ -8,6 +8,23 @@ 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) -> None:
firewall_config = ArchConfig.app_config.firewall_config
is_ufw = firewall_config and firewall_config.firewall and firewall_config.firewall.value == 'ufw'
if is_ufw and "openssh" in ArchConfig.packages:
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'
group = MenuItemGroup.yes_no()
result = await Confirmation(
group=group,
header=header,
allow_skip=False,
preset=True,
).show()
if result:
ArchConfig.custom_commands.append("ufw allow OpenSSH")
async def confirm_config(config: ArchConfig) -> bool:
header = f'{tr("The specified configuration will be applied")}. '

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_config
from archinstall.lib.configuration import confirm_ufw, confirm_config
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
@ -230,6 +230,7 @@ def main(arch_config_handler: ArchConfigHandler | None = None) -> None:
if not arch_config_handler.args.silent:
aborted = False
tui.run(lambda: confirm_ufw(arch_config_handler.config))
res: bool = tui.run(lambda: confirm_config(arch_config_handler.config))
if not res: