fix(webclients): default to port 80 if none/invalid configured in kiauh.cfg

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
dw-0
2024-03-02 21:25:17 +01:00
parent 1620efe56c
commit 5c37b68463
2 changed files with 2 additions and 2 deletions

View File

@@ -71,7 +71,6 @@ def print_client_port_select_dialog(name: str, port: str, ports_in_use: List[str
| {line2:<54}| | {line2:<54}|
| port, you can set it now. Make sure the port is not | | port, you can set it now. Make sure the port is not |
| used by any other application on your system! | | used by any other application on your system! |
\\=======================================================/
""" """
)[1:] )[1:]

View File

@@ -107,7 +107,8 @@ def install_client(client_name: ClientName) -> None:
install_client_cfg = get_confirm(question, allow_go_back=False) install_client_cfg = get_confirm(question, allow_go_back=False)
cm = ConfigManager(cfg_file=KIAUH_CFG) cm = ConfigManager(cfg_file=KIAUH_CFG)
client_port = cm.get_value(client.get("name"), "port") default_port = cm.get_value(client.get("name"), "port")
client_port = default_port if default_port and default_port.isdigit() else "80"
ports_in_use = read_ports_from_nginx_configs() ports_in_use = read_ports_from_nginx_configs()
# check if configured port is a valid number and not in use already # check if configured port is a valid number and not in use already