Merge pull request '04-06-2025_large_update' (#38) from 04-06-2025_large_update into main

Reviewed-on: #38
This commit is contained in:
2025-06-24 15:06:11 +02:00
4 changed files with 28 additions and 79 deletions

View File

@ -9,6 +9,11 @@ My standard System: Linux Mint 22 Cinnamon
- Tunnel in tk.canvas for modern look
- Replace Download Button with Lx Tools installer
### Added
23-06-2025
- all msg_window with MassageDialog replaced
### Added
14-06-2025

View File

@ -6,7 +6,6 @@ import pwd
import shutil
from subprocess import CompletedProcess, run
from shared_libs.wp_app_config import AppConfig
from shared_libs.common_tools import LxTools
from shared_libs.message import MessageDialog
@ -21,8 +20,9 @@ try:
uid = user_info.pw_uid # User ID (e.g., 1000)
gid = user_info.pw_gid # Group ID (e.g., 1000)
except KeyError:
MessageDialog("error", _(f"User '{args.user}' not found."), title="Error decrypt")
MessageDialog(
"error", _(f"User '{args.user}' not found."), title="Error decrypt"
).show()
exit(1)
crypted_tunnel: Path = Path(f"/home/{args.user}/.config/wire_py")
@ -30,9 +30,9 @@ crypted_tunnel: Path = Path(f"/home/{args.user}/.config/wire_py")
if len([str(file) for file in crypted_tunnel.glob("*.dat")]) == 0:
pass
else:
crypted__tunnel = [str(file) for file in crypted_tunnel.glob("*.dat")]
crypted_tunnel = [str(file) for file in crypted_tunnel.glob("*.dat")]
for tunnel_path in crypted__tunnel:
for tunnel_path in crypted_tunnel:
base_name = Path(tunnel_path).stem
@ -50,16 +50,16 @@ else:
],
capture_output=True,
text=True,
check=False,
check=True,
)
shutil.chown(f"{AppConfig.TEMP_DIR}/{base_name}.conf", uid, gid)
# Output from Openssl Error
if process.stderr:
MessageDialog(
"erro",
"error",
_(
f"{process.stderr} Error by [{tunnel_path}] Code: {process.returncode}"
),
title="Error decrypt",
)
).show()

View File

@ -636,21 +636,15 @@ class FrameWidgets(ttk.Frame):
data_import, key_name = Tunnel.parse_files_to_dictionary(filepath=filepath)
if CryptoUtil.find_key(f"{data_import[key_name]["PrivateKey"]}="):
LxTools.msg_window(
AppConfig.IMAGE_PATHS["icon_error"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["imp_err"],
Msg.STR["tl_exist"],
)
MessageDialog("error", Msg.STR["tl_exist"], title=Msg.STR["imp_err"])
elif not CryptoUtil.is_valid_base64(
f"{data_import[key_name]["PrivateKey"]}="
): # 2. Second check: Is it valid Base64?
LxTools.msg_window(
AppConfig.IMAGE_PATHS["icon_error"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["imp_err"],
MessageDialog(
"error",
Msg.STR["invalid_base64"],
title=Msg.STR["imp_err"],
)
else:
filepath = Path(filepath)
@ -743,12 +737,7 @@ class FrameWidgets(ttk.Frame):
print(f">> {import_file.stem} << autostart is disabled by default")
except UnboundLocalError:
LxTools.msg_window(
AppConfig.IMAGE_PATHS["icon_error"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["imp_err"],
Msg.STR["no_valid_file"],
)
MessageDialog("error", Msg.STR["no_valid_file"], title=Msg.STR["imp_err"])
except (IsADirectoryError, TypeError, FileNotFoundError):
print("File import: abort by user...")
except EOFError as e:
@ -811,21 +800,11 @@ class FrameWidgets(ttk.Frame):
if self.l_box.size() != 0:
LxTools.msg_window(
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["sel_tl"],
Msg.STR["sel_list"],
)
MessageDialog("info", Msg.STR["sel_list"], title=Msg.STR["sel_tl"])
else:
LxTools.msg_window(
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["sel_tl"],
Msg.STR["tl_first"],
)
MessageDialog("info", Msg.STR["tl_first"], title=Msg.STR["sel_tl"])
def enable_check_box(self, _) -> None:
"""
@ -908,41 +887,21 @@ class FrameWidgets(ttk.Frame):
if len(self.lb_rename.get()) > 12:
LxTools.msg_window(
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["ren_err"],
Msg.STR["sign_len"],
)
MessageDialog("info", Msg.STR["sign_len"], title=Msg.STR["ren_err"])
elif len(self.lb_rename.get()) == 0:
LxTools.msg_window(
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["ren_err"],
Msg.STR["zero_signs"],
)
MessageDialog("info", Msg.STR["zero_signs"], title=Msg.STR["ren_err"])
elif any(ch in special_characters for ch in self.lb_rename.get()):
LxTools.msg_window(
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["ren_err"],
Msg.STR["false_signs"],
)
MessageDialog("info", Msg.STR["false_signs"], title=Msg.STR["ren_err"])
elif self.lb_rename.get() in [
file.stem for file in AppConfig.CONFIG_DIR.glob("*.dat")
]:
LxTools.msg_window(
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["ren_err"],
Msg.STR["is_in_use"],
)
MessageDialog("info", Msg.STR["is_in_use"], title=Msg.STR["ren_err"])
else:
@ -984,12 +943,7 @@ class FrameWidgets(ttk.Frame):
except IndexError:
LxTools.msg_window(
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["ren_err"],
Msg.STR["sel_list"],
)
MessageDialog("info", Msg.STR["sel_list"], title=Msg.STR["ren_err"])
except EOFError as e:
logging.error(e, exc_info=True)
@ -1062,21 +1016,11 @@ class FrameWidgets(ttk.Frame):
if self.l_box.size() != 0:
LxTools.msg_window(
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["sel_tl"],
Msg.STR["sel_list"],
)
MessageDialog("info", Msg.STR["sel_list"], title=Msg.STR["sel_tl"])
else:
LxTools.msg_window(
AppConfig.IMAGE_PATHS["icon_info"],
AppConfig.IMAGE_PATHS["icon_msg"],
Msg.STR["sel_tl"],
Msg.STR["tl_first"],
)
MessageDialog("info", Msg.STR["tl_first"], title=Msg.STR["sel_tl"])
def handle_connection_state(self, action: str, tunnel_name: str = None) -> None:
"""

View File

@ -57,7 +57,7 @@ class AppConfig:
# Updates
# 1 = 1. Year, 09 = Month of the Year, 2924 = Day and Year of the Year
VERSION: str = "v. 2.06.0725"
VERSION: str = "v. 2.06.2425"
UPDATE_URL: str = "https://git.ilunix.de/api/v1/repos/punix/Wire-Py/releases"
DOWNLOAD_URL: str = "https://git.ilunix.de/punix/Wire-Py/archive"