Standarized the iptables parsed log

This commit is contained in:
infidel 2023-10-30 23:10:03 +07:00
parent 5eeba7e06f
commit 11f5cb853d
7 changed files with 313 additions and 1 deletions

View File

@ -1,37 +1,324 @@
alabaster==0.7.12
ansi2html==1.8.0
ansible-base==2.10.8
apache-libcloud==3.2.0
appdirs==1.4.4
apsw==3.36.0.post1
argcomplete==1.8.1
argon2-cffi==21.1.0
asgiref==3.5.2
astroid==2.12.11
async-timeout==4.0.2
atomicwrites==1.4.0
attrs==21.2.0
Automat==20.2.0
Babel==2.8.0
backcall==0.2.0
bcc==0.18.0
bcrypt==3.2.0
beautifulsoup4==4.11.1
beniget==0.4.1
bibtexparser==1.2.0
bleach==4.1.0
blinker==1.4
bottle==0.12.19
brial==1.0.2
Brlapi==0.8.3
Brotli==1.0.9
cached-property==1.5.2
certifi==2023.7.22
chardet==4.0.0
charset-normalizer==3.3.1
chrome-gnome-shell==0.0.0
click==8.1.7
colorama==0.4.4
command-not-found==0.3
configobj==5.0.6
constantly==15.1.0
cryptography==3.4.8
css-parser==1.0.7
cssselect==1.1.0
cssutils==1.0.2
cupshelpers==1.0
cycler==0.11.0
cypari2==2.1.2
Cython==0.29.28
dash==2.14.0
dash-bootstrap-components==1.5.0
dash-core-components==2.0.0
dash-cytoscape==0.3.0
dash-html-components==2.0.0
dash-table==5.0.0
dbus-python==1.2.18
decorator==4.4.2
defer==1.0.6
defusedxml==0.7.1
deluge==2.0.3
dill==0.3.5.1
distlib==0.3.4
distro==1.7.0
distro-info==1.1+ubuntu0.1
Django==4.1.2
django-cors-headers==3.13.0
django-stubs==4.2.3
django-stubs-ext==4.2.2
djangorestframework==3.14.0
dnspython==2.1.0
docker==5.0.3
docker-compose==1.29.2
dockerpty==0.4.1
docopt==0.6.2
docutils==0.17.1
entrypoints==0.4
evdev==1.4.0
feedparser==6.0.8
filelock==3.6.0
flake8==5.0.4
Flask==2.2.5
fonttools==4.29.1
fpylll==0.5.2.dev0
fs==2.4.12
future==0.18.2
gast==0.5.2
GeoIP==1.3.2
Glances==3.2.4.2
gmpy2==2.1.2
gpg==1.16.0
greenlet==1.1.2
gscholar==2.0.0
hidpidaemon==18.4.6
html2text==2020.1.16
html5-parser==0.4.10
html5lib==1.1
httplib2==0.20.2
hyperlink==21.0.0
idna==3.4
ifaddr==0.1.7
imagesize==1.3.0
imaplib2==3.5
importlib-metadata==6.8.0
incremental==21.3.0
influxdb==5.3.1
ipykernel==6.7.0
ipython==7.31.1
ipython_genutils==0.2.0
ipywidgets==6.0.0
isort==5.10.1
itsdangerous==2.1.2
jedi==0.18.0
jeepney==0.7.1
Jinja2==3.1.2
jmespath==0.10.0
jsonschema==3.2.0
jupyter-client==7.1.2
jupyter-console==6.4.0
jupyter-core==4.9.1
jupyterlab-pygments==0.1.2
kernelstub==3.1.4
keyring==23.5.0
khard==0.17.0
kiwisolver==1.3.2
language-selector==0.1
launchpadlib==1.10.16
lazr.restfulclient==0.14.4
lazr.uri==1.0.6
lazy-object-proxy==1.7.1
libtorrent===2.0.5-build-libtorrent-rasterbar-qrM5vM-libtorrent-rasterbar-2.0.5-bindings-python
libvirt-python==8.0.0
lockfile==0.12.2
louis==3.20.0
lxml==4.9.1
lz4==3.1.3+dfsg
macaroonbakery==1.3.1
Mako==1.1.3
Markdown==3.3.6
MarkupSafe==2.1.3
matplotlib==3.5.1
matplotlib-inline==0.1.3
mccabe==0.7.0
mechanize==0.4.7
memory-allocator==0.1.2
mercurial==6.1.1
meson==0.61.2
mkchromecast==0.3.9
mock==4.0.3
more-itertools==8.10.0
mpmath==0.0.0
msgpack==1.0.3
mypy==1.4.1
mypy-extensions==1.0.0
nbclient==0.5.6
nbconvert==6.4.0
nbformat==5.1.3
nest-asyncio==1.5.8
netaddr==0.8.0
netifaces==0.11.0
networkx==3.2
notebook==6.4.8
ntlm-auth==1.4.0
numpy==1.26.1
oauthlib==3.2.0
olefile==0.46
ovs==2.17.7
packaging==23.2
paho-mqtt==1.6.1
pandocfilters==1.5.0
parso==0.8.1
pbr==5.8.0
pexpect==4.8.0
pickleshare==0.7.5
Pillow==9.0.1
pkgconfig==1.5.5
platformdirs==2.5.2
plotly==5.18.0
pluggy==0.13.0
ply==3.11
pop-transition==1.1.2
pplpy==0.8.7
primecountpy==0.1.0
prometheus-client==0.9.0
prompt-toolkit==3.0.28
protobuf==3.12.4
proton-client==0.7.1
protonvpn-cli==3.13.0
protonvpn-gui==1.12.0
protonvpn-nm-lib==3.16.0
psutil==5.9.0
ptyprocess==0.7.0
py==1.10.0
py7zr==0.11.3+dfsg
pyasn1==0.4.8
pyasn1-modules==0.2.1
pycairo==1.20.1
pychm==0.8.6
PyChromecast==9.4.0
pycodestyle==2.9.1
pycryptodomex==3.11.0
pycups==2.0.1
pydbus==0.6.0
pyflakes==2.5.0
pygame==2.1.2
Pygments==2.11.2
PyGObject==3.42.1
PyHamcrest==2.0.2
pyinotify==0.9.6
PyJWT==2.3.0
pykerberos==1.1.14
pylint==2.15.4
pymacaroons==0.13.0
PyNaCl==1.5.0
pynvim==0.4.2
pyOpenSSL==21.0.0
pyparsing==2.4.7
PyQt5==5.15.6
PyQt5-sip==12.9.1
PyQtWebEngine==5.15.5
pyRFC3339==1.1
pyrsistent==0.18.1
pyscard==2.0.2
pysmi==0.3.2
pysnmp==4.4.12
PySocks==1.7.1
pystache==0.6.0
python-apt==2.4.0+ubuntu2
python-dateutil==2.8.1
python-debian==0.1.43+ubuntu1.1
python-dotenv==0.19.2
python-gnupg==0.4.8
python-magic==0.4.24
python-xlib==0.29
pythondialog==3.5.1
pythran==0.10.0
pytz==2022.4
pyusb==1.2.1.post1
pywinrm==0.3.0
pyxattr==0.7.2
pyxdg==0.27
PyYAML==5.4.1
pyzmq==22.3.0
QtPy==2.0.0
ranger==0.10
ranger-fm==1.9.3
redis==4.6.0
regex==2021.11.10
rencode==1.0.6
repolib==2.2.1
repoman==1.4.0
repoze.lru==0.7
requests==2.31.0
requests-kerberos==0.12.0
requests-ntlm==1.1.0
requests-toolbelt==0.9.1
retrying==1.3.4
roman==3.3
Routes==2.5.1
rpy2==3.4.5
ruamel.yaml==0.17.16
ruamel.yaml.clib==0.2.6
sagemath-standard==9.5
sagenb-export==3.2
scipy==1.8.0
scour==0.38.2
screen-resolution-extra==0.0.0
SecretStorage==3.3.1
selinux==3.3
Send2Trash==1.8.1b0
service-identity==18.1.0
sessioninstaller==0.0.0
setproctitle==1.2.2
sgmllib3k==1.0.0
simplejson==3.17.6
six==1.16.0
snowballstemmer==2.2.0
sortedcontainers==2.1.0
soupsieve==2.3.2.post1
Sphinx==4.3.2
sqlparse==0.4.3
ssh-import-id==5.11
sympy==1.9
systemd-python==234
tabulate==0.9.0
tenacity==8.2.3
terminado==0.13.1
testpath==0.5.0
texttable==1.6.4
toml==0.10.2
tomli==2.0.1
tomlkit==0.11.0
torbrowser-launcher==0.3.3
tornado==6.1
tox==3.21.4
traitlets==5.1.1
Twisted==22.1.0
types-pytz==2023.3.0.0
types-PyYAML==6.0.12.11
typing_extensions==4.8.0
tzlocal==2.1
ubuntu-advantage-tools==8001
ubuntu-drivers-common==0.0.0
ueberzug==18.1.9
ufoLib2==0.13.1
ufw==0.36.1
unattended-upgrades==0.1
unicodedata2==14.0.0
Unidecode==1.3.3
urllib3==2.0.7
vboxapi==1.0
virtualenv==20.13.0+ds
vobject==0.9.6.1
wadllib==1.3.6
wcwidth==0.2.5
webencodings==0.5.1
WebOb==1.8.6
websocket-client==1.2.3
Werkzeug==2.2.3
widgetsnbextension==2.0.0
wrapt==1.14.1
xdg==5
xkit==0.0.0
xlrd==1.2.0
xmltodict==0.12.0
youtube-dl==2021.12.17
zeroconf==0.38.3
zipp==3.17.0
zope.interface==5.4.0

View File

@ -18,6 +18,7 @@ from .utils.statistics import count_clients, count_traffic, count_connection, co
from .utils.reqs_handler import req_edit_state, req_edit_user, req_apply_sys, req_ip_recommendation, reg_bulk, req_del_user, req_get_client
from django.middleware.csrf import get_token
from django.views.decorators.csrf import csrf_exempt
from .iptable_parser.wrapper import line_process
class wgLogin(APIView):
authentication_classes = [SessionAuthentication, BasicAuthentication]
@ -571,3 +572,26 @@ def wg_GetClient(request):
req_commit = req_get_client(id)
return HttpResponse(json.dumps(req_commit['Client']), content_type='application')
@csrf_exempt
@api_view(["GET"])
#@permission_classes([IsAuthenticated])
def wg_GetGraphData(request):
if request.method == "GET":
print(request)
print("-> Bulk Registration")
print(request.body)
print("-"*20)
nodes, edges = line_process()
final_data = {"nodes": nodes, "edges": edges}
#id = request.body.decode('utf-8')
#id = request.GET.get("id")
#id = json.loads(id)
#req_commit = req_get_client(id)
return HttpResponse(json.dumps(final_data), content_type='json')

View File

@ -34,5 +34,6 @@ urlpatterns = [
path('api2/wgCheckAuth', views.wgCheckAuth),
path('api2/wgEditClient', views.get_EditClient),
path('api2/wgDelClient', views.wg_DelClient),
path('api2/wgGetClient', views.wg_GetClient)
path('api2/wgGetClient', views.wg_GetClient),
path('api2/wgGetGraphData', views.wg_GetGraphData)
]