diff --git a/WebScripts/__init__.py b/WebScripts/__init__.py index 0962225e..5a5677cf 100644 --- a/WebScripts/__init__.py +++ b/WebScripts/__init__.py @@ -23,7 +23,7 @@ This tool runs CLI scripts and displays output in a Web Interface. """ -__version__ = "3.0.38" +__version__ = "3.0.39" __author__ = "Maurice Lambert" __author_email__ = "mauricelambert434@gmail.com" __maintainer__ = "Maurice Lambert" diff --git a/WebScripts/__main__.py b/WebScripts/__main__.py index de4c53e5..3aac887a 100644 --- a/WebScripts/__main__.py +++ b/WebScripts/__main__.py @@ -23,7 +23,7 @@ This tool runs CLI scripts and displays output in a Web Interface. """ -__version__ = "3.0.38" +__version__ = "3.0.39" __author__ = "Maurice Lambert" __author_email__ = "mauricelambert434@gmail.com" __maintainer__ = "Maurice Lambert" diff --git a/WebScripts/harden.py b/WebScripts/harden.py index 552617f7..89948ba9 100644 --- a/WebScripts/harden.py +++ b/WebScripts/harden.py @@ -25,7 +25,7 @@ This file hardens the WebScripts installation and configuration. """ -__version__ = "0.0.9" +__version__ = "0.0.10" __author__ = "Maurice Lambert" __author_email__ = "mauricelambert434@gmail.com" __maintainer__ = "Maurice Lambert" @@ -323,7 +323,7 @@ def harden_script(self, section: dict, filename: str) -> None: """ logger_info("Hardens script " + repr(filename)) - logger_debug("Add the launcher") + logger_debug(f"Add launcher {executable!r} for {filename!r}") section["launcher"] = executable specific_config_file = section.get("configuration_file") @@ -331,18 +331,28 @@ def harden_script(self, section: dict, filename: str) -> None: specific_config_file = basename(specific_config_file) script_name, _ = splitext(basename(filename)) - logger_info(f"Configure script named: {script_name}") + logger_info("Configure script named: " + repr(script_name)) for config_file in self.json_config_files: if config_file.endswith(specific_config_file): section["configuration_file"] = config_file self.get_configurations(config_file, filename) break + else: + logger_error( + "Configuration file not found for " + repr(filename) + ) for py_filename in self.py_scripts_files: - if py_filename.endswith(filename): - logger_debug("Add the script absolute path.") + py_basename = basename(py_filename) + if py_basename == filename: + logger_debug( + "Add the script absolute path" + f" {py_filename!r} for {filename!r}." + ) section["path"] = py_filename break + else: + logger_error("Script file not found for " + repr(filename)) def linux_hardening_file_permissions(self) -> None: """