tox_wrapper

This commit is contained in:
emdee@spm.plastiras.org 2024-02-13 18:21:08 +00:00
parent 510e790155
commit 8bf481e6fc
11 changed files with 1501 additions and 4 deletions

1
.gitignore vendored
View File

@ -7,7 +7,6 @@ libs/
*.egg-info
*.log
*.out
*.bak
.idea
*~

0
__init__.py Normal file
View File

View File

@ -26,7 +26,6 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
]
dynamic = ["version", "readme", "dependencies"] # cannot be dynamic ['license']
[project.scripts]
@ -44,3 +43,6 @@ build-backend = "setuptools.build_meta"
version = {attr = "tox_profile.__version__"}
readme = {file = ["README.md"]}
dependencies = {file = ["requirements.txt"]}
#[tool.setuptools.packages.find]
#where = "src"

View File

@ -1,6 +1,6 @@
# the versions are the current ones tested - may work with earlier versions
ruamel.yaml >= 0.18.5
msgpack >= 1.0.7
xmsgpack >= 1.0.7
coloredlogs >= 15.0.1
# optional
# nmap

View File

@ -19,6 +19,12 @@ keywords='ctypes Tox'
[options]
zip_safe = false
python_requires = >=3.7
include_package_data =
"*" = ["*.txt", "*.bash"]
[options.entry_points]
console_scripts =
tox_profile = tox_profile.tox_profile:iMain
[easy_install]
zip_ok = false

0
src/__init__.py Normal file
View File

View File

@ -0,0 +1,2 @@
__version__ = "1.0.0"

View File

@ -0,0 +1,5 @@
import sys
from tox_profile.tox_profile import iMain
if __name__ == '__main__':
sys.exit(iMain(sys.argv[1:]))

File diff suppressed because it is too large Load Diff

View File

@ -939,16 +939,19 @@ def lNodesCheckNodes(json_nodes, oArgs, bClean=False):
# fixme look for /etc/tor/torrc but it may not be readable
if bHAVE_TOR and os.path.exists('/etc/tor/torrc'):
# get from torrc
address_range = '172.16.1' # 127.192.0
# print(sBLURB)
LOG.info("Add this section to your /etc/tor/torrc")
for line in lONION_CONFIG['vadr']:
print(line)
if lOnions:
LOG.info("Add this section to your /etc/tor/torrc")
print('VirtualAddrNetwork {address_range}.0/10')
i = 1
for line in lOnions:
hosts = line.split(':')
print(f"MapAddress {hosts[0]} 172.16.1.{i}")
print(f"MapAddress {hosts[0]} {address_range}.{i}")
i += 1
if bClean:

View File

@ -216,6 +216,7 @@ for the_json in $json ; do
done
i=4
##
[ $# -ne 0 -a "$1" -ne $i ] || \
[ "$HAVE_TOR" = 0 ] || \
[ ! -f /etc/tor/torrc ] || \
@ -250,6 +251,7 @@ for the_tox in /etc/tor/torrc ; do
ip route | grep ^def || exit 0
i=5
##
the_tox=$tox
[ $# -ne 0 -a "$1" != "$i" ] || \
[ "$HAVE_JQ" = 0 ] || \
@ -283,6 +285,7 @@ for the_tox in $tox $OUT.save ; do
done
i=6
##
[ $# -ne 0 -a "$1" != "$i" ] || \
[ "$HAVE_JQ" = 0 ] || \
! INFO $i Eating dogfood || \