diff --git a/PKG-INFO b/PKG-INFO index cd665c4f..28ed04af 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: WebScripts -Version: 3.0.36 +Version: 3.0.38 Summary: This tool runs CLI scripts and displays output in a Web Interface. Home-page: https://github.com/mauricelambert/WebScripts Author: Maurice Lambert diff --git a/WebScripts.egg-info/PKG-INFO b/WebScripts.egg-info/PKG-INFO index cd665c4f..28ed04af 100644 --- a/WebScripts.egg-info/PKG-INFO +++ b/WebScripts.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: WebScripts -Version: 3.0.36 +Version: 3.0.38 Summary: This tool runs CLI scripts and displays output in a Web Interface. Home-page: https://github.com/mauricelambert/WebScripts Author: Maurice Lambert diff --git a/WebScripts/__init__.py b/WebScripts/__init__.py index 6585204b..0962225e 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.36" +__version__ = "3.0.38" __author__ = "Maurice Lambert" __author_email__ = "mauricelambert434@gmail.com" __maintainer__ = "Maurice Lambert" diff --git a/WebScripts/__main__.py b/WebScripts/__main__.py index 8f84aba8..de4c53e5 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.36" +__version__ = "3.0.38" __author__ = "Maurice Lambert" __author_email__ = "mauricelambert434@gmail.com" __maintainer__ = "Maurice Lambert" diff --git a/WebScripts/harden.py b/WebScripts/harden.py index 73f3d2bd..552617f7 100644 --- a/WebScripts/harden.py +++ b/WebScripts/harden.py @@ -3,7 +3,7 @@ ################### # This tool runs CLI scripts and displays output in a Web Interface. -# Copyright (C) 2021, 2022, 2023 Maurice Lambert +# Copyright (C) 2021, 2022, 2023, 2024 Maurice Lambert # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ This file hardens the WebScripts installation and configuration. """ -__version__ = "0.0.8" +__version__ = "0.0.9" __author__ = "Maurice Lambert" __author_email__ = "mauricelambert434@gmail.com" __maintainer__ = "Maurice Lambert" @@ -39,7 +39,7 @@ __url__ = "https://github.com/mauricelambert/WebScripts" copyright = """ -WebScripts Copyright (C) 2021, 2022, 2023 Maurice Lambert +WebScripts Copyright (C) 2021, 2022, 2023, 2024 Maurice Lambert This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. @@ -71,6 +71,7 @@ abspath, basename, exists, + normpath, ) from importlib.util import spec_from_loader, module_from_spec from logging import FileHandler, Formatter, getLogger, Logger @@ -207,6 +208,7 @@ def __init__( directory: str = None, ): self.admin_password = admin_password + self.documentation_paths = [] self.json_only = json_only self.owner = owner or getuser() self.directory = directory or getcwd() @@ -293,7 +295,11 @@ def harden_server(self, section: dict, directory: str) -> None: if self.is_windows: path_.insert(1, "..") - section["modules_path"] = abspath(join(*path_, "modules")) + self.documentation_paths = section["documentations_path"] = [ + normpath(abspath(join(self.directory, x))) + for x in section["documentations_path"] + ] + section["modules_path"] = [normpath(abspath(join(*path_, "modules")))] section["data_dir"] = abspath(join(self.directory, "data")) section["json_scripts_config"] = self.get_files_from_glob_path( path_, section["json_scripts_config"] @@ -369,6 +375,12 @@ def linux_hardening_file_permissions(self) -> None: chmod(logs, 0o700) # nosec chown(logs, pw_uid, pw_gid) + for documentation_path in self.documentation_paths: + documentation_directory = dirname(documentation_path) + makedirs(documentation_directory, exist_ok=True) + chmod(documentation_directory, 0o700) # nosec + chown(documentation_directory, pw_uid, pw_gid) + def linux_file_permissions(self, filename: str) -> None: """ This method changes files permissions on Linux. diff --git a/WebScripts/static/html/index.html b/WebScripts/static/html/index.html index 1500b713..233b61de 100644 --- a/WebScripts/static/html/index.html +++ b/WebScripts/static/html/index.html @@ -6,7 +6,7 @@  
__init__ (version 3.0.38)
 
- 
__init__ (version 3.0.36)
index
__init__.py

This tool runs CLI scripts and displays output in a Web Interface.