part two more optimization with app_config file

This commit is contained in:
2025-05-03 17:58:19 +02:00
parent 2cdc40f414
commit 0cdad100b6
10 changed files with 493 additions and 432 deletions

@ -5,23 +5,22 @@ import os
import shutil
from pathlib import Path
from subprocess import check_call
from cls_mth_fc import LxTools
from wp_app_config import AppConfig
uname: Path = Path("/tmp/.log_user")
#uname: Path = Path("/tmp/.log_user")
log_name = Path(uname).read_text(encoding="utf-8")
#log_name = AppConfig.USER_FILE.read_text(encoding="utf-8")
keyfile: Path = Path(f"/home/{log_name}/.config/wire_py/pbwgk.pem")
PKEYFILE = "/usr/local/etc/ssl/pwgk.pem"
keyfile: Path = Path(f"/home/{AppConfig.USER_FILE.read_text(encoding="utf-8")}/.config/wire_py/pbwgk.pem")
if not keyfile.is_file():
check_call(["openssl", "rsa", "-in", PKEYFILE, "-out", keyfile, "-outform", "PEM", "-pubout"])
check_call(["openssl", "rsa", "-in", AppConfig.SYSTEM_PATHS["pkey_path"], "-out", keyfile, "-outform", "PEM", "-pubout"])
shutil.chown(keyfile, 1000, 1000)
if AppConfig.TEMP_DIR.exists():
tl = os.listdir(f"{AppConfig.TEMP_DIR}")
tl = LxTools.get_file_name(AppConfig.TEMP_DIR)
CPTH: str = f"{keyfile}"
CRYPTFILES: str = CPTH[:-9]