Skip to content

Commit f774433

Browse files
Merge pull request #20 from mauricelambert/dev
Dev
2 parents dd54989 + 02fd4bd commit f774433

File tree

6 files changed

+21
-9
lines changed

6 files changed

+21
-9
lines changed

PKG-INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: WebScripts
3-
Version: 3.0.36
3+
Version: 3.0.38
44
Summary: This tool runs CLI scripts and displays output in a Web Interface.
55
Home-page: https://github.com/mauricelambert/WebScripts
66
Author: Maurice Lambert

WebScripts.egg-info/PKG-INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: WebScripts
3-
Version: 3.0.36
3+
Version: 3.0.38
44
Summary: This tool runs CLI scripts and displays output in a Web Interface.
55
Home-page: https://github.com/mauricelambert/WebScripts
66
Author: Maurice Lambert

WebScripts/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
This tool runs CLI scripts and displays output in a Web Interface.
2424
"""
2525

26-
__version__ = "3.0.36"
26+
__version__ = "3.0.38"
2727
__author__ = "Maurice Lambert"
2828
__author_email__ = "[email protected]"
2929
__maintainer__ = "Maurice Lambert"

WebScripts/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
This tool runs CLI scripts and displays output in a Web Interface.
2424
"""
2525

26-
__version__ = "3.0.36"
26+
__version__ = "3.0.38"
2727
__author__ = "Maurice Lambert"
2828
__author_email__ = "[email protected]"
2929
__maintainer__ = "Maurice Lambert"

WebScripts/harden.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
###################
55
# This tool runs CLI scripts and displays output in a Web Interface.
6-
# Copyright (C) 2021, 2022, 2023 Maurice Lambert
6+
# Copyright (C) 2021, 2022, 2023, 2024 Maurice Lambert
77

88
# This program is free software: you can redistribute it and/or modify
99
# it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
2525
This file hardens the WebScripts installation and configuration.
2626
"""
2727

28-
__version__ = "0.0.8"
28+
__version__ = "0.0.9"
2929
__author__ = "Maurice Lambert"
3030
__author_email__ = "[email protected]"
3131
__maintainer__ = "Maurice Lambert"
@@ -39,7 +39,7 @@
3939
__url__ = "https://github.com/mauricelambert/WebScripts"
4040

4141
copyright = """
42-
WebScripts Copyright (C) 2021, 2022, 2023 Maurice Lambert
42+
WebScripts Copyright (C) 2021, 2022, 2023, 2024 Maurice Lambert
4343
This program comes with ABSOLUTELY NO WARRANTY.
4444
This is free software, and you are welcome to redistribute it
4545
under certain conditions.
@@ -71,6 +71,7 @@
7171
abspath,
7272
basename,
7373
exists,
74+
normpath,
7475
)
7576
from importlib.util import spec_from_loader, module_from_spec
7677
from logging import FileHandler, Formatter, getLogger, Logger
@@ -207,6 +208,7 @@ def __init__(
207208
directory: str = None,
208209
):
209210
self.admin_password = admin_password
211+
self.documentation_paths = []
210212
self.json_only = json_only
211213
self.owner = owner or getuser()
212214
self.directory = directory or getcwd()
@@ -293,7 +295,11 @@ def harden_server(self, section: dict, directory: str) -> None:
293295
if self.is_windows:
294296
path_.insert(1, "..")
295297

296-
section["modules_path"] = abspath(join(*path_, "modules"))
298+
self.documentation_paths = section["documentations_path"] = [
299+
normpath(abspath(join(self.directory, x)))
300+
for x in section["documentations_path"]
301+
]
302+
section["modules_path"] = [normpath(abspath(join(*path_, "modules")))]
297303
section["data_dir"] = abspath(join(self.directory, "data"))
298304
section["json_scripts_config"] = self.get_files_from_glob_path(
299305
path_, section["json_scripts_config"]
@@ -369,6 +375,12 @@ def linux_hardening_file_permissions(self) -> None:
369375
chmod(logs, 0o700) # nosec
370376
chown(logs, pw_uid, pw_gid)
371377

378+
for documentation_path in self.documentation_paths:
379+
documentation_directory = dirname(documentation_path)
380+
makedirs(documentation_directory, exist_ok=True)
381+
chmod(documentation_directory, 0o700) # nosec
382+
chown(documentation_directory, pw_uid, pw_gid)
383+
372384
def linux_file_permissions(self, filename: str) -> None:
373385
"""
374386
This method changes files permissions on Linux.

WebScripts/static/html/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
77
<tr bgcolor="#9286C2">
88
<td valign=bottom>&nbsp;<br>
9-
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>__init__</strong></big></big> (version 3.0.36)</font></td
9+
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>__init__</strong></big></big> (version 3.0.38)</font></td
1010
><td align=right valign=bottom
1111
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="__init__.py">__init__.py</a></font></td></tr></table>
1212
<p><tt>This&nbsp;tool&nbsp;runs&nbsp;CLI&nbsp;scripts&nbsp;and&nbsp;displays&nbsp;output&nbsp;in&nbsp;a&nbsp;Web&nbsp;Interface.</tt></p>

0 commit comments

Comments
 (0)