korreckturen throughout code

This commit is contained in:
2025-04-26 00:28:34 +02:00
parent f6204c9071
commit 1a853d4ff1
6 changed files with 255 additions and 222 deletions

@ -6,13 +6,13 @@ import shutil
from pathlib import Path
from subprocess import check_call
uname = Path("/tmp/.loguser")
uname: Path = Path("/tmp/.log_user")
with open(uname, "r", encoding="utf-8") as f:
logname = f.readline()
log_name: str = f.readline()
keyfile = Path(f"/home/{logname}/.config/wire_py/pbwgk.pem")
dirname = Path("/tmp/tlecdcwg/")
keyfile: Path = Path(f"/home/{log_name}/.config/wire_py/pbwgk.pem")
folder_path: Path = Path("/tmp/tlecdcwg/")
PKEYFILE = "/usr/local/etc/ssl/pwgk.pem"
if not keyfile.is_file():
@ -20,28 +20,28 @@ if not keyfile.is_file():
check_call(["openssl", "rsa", "-in", PKEYFILE, "-out", keyfile, "-outform", "PEM", "-pubout"])
shutil.chown(keyfile, 1000, 1000)
if dirname.exists():
tl = os.listdir(f"{dirname}")
CPTH = f"{keyfile}"
CRYPTFILES = CPTH[:-9]
if folder_path.exists():
tl = os.listdir(f"{folder_path}")
CPTH: str = f"{keyfile}"
CRYPTFILES: str = CPTH[:-9]
if keyfile.exists() and len(tl) != 0:
for tunnels in tl:
sourcetl = f"{dirname}/{tunnels}"
tlname = f"{CRYPTFILES}{tunnels[:-5]}.dat"
sourcetl: str = f"{folder_path}/{tunnels}"
tlname: str = f"{CRYPTFILES}{tunnels[:-5]}.dat"
check_call(["openssl", "pkeyutl", "-encrypt", "-inkey", keyfile, "-pubin", "-in", sourcetl, "-out",
tlname,])
else:
if dirname.exists():
tl = os.listdir(f"{dirname}")
CPTH = f"{keyfile}"
CRYPTFILES = CPTH[:-9]
if folder_path.exists():
tl: list[str] = os.listdir(f"{folder_path}")
CPTH: str = f"{keyfile}"
CRYPTFILES: str = CPTH[:-9]
if keyfile.exists() and len(tl) != 0:
for tunnels in tl:
sourcetl = f"{dirname}/{tunnels}"
tlname = f"{CRYPTFILES}{tunnels[:-5]}.dat"
check_call(
["openssl", "pkeyutl", "-encrypt", "-inkey", keyfile, "-pubin", "-in", sourcetl, "-out", tlname])
sourcetl: str = f"{folder_path}/{tunnels}"
tlname: str = f"{CRYPTFILES}{tunnels[:-5]}.dat"
check_call(["openssl", "pkeyutl", "-encrypt", "-inkey", keyfile, "-pubin", "-in", sourcetl, "-out",
tlname])