From 59671130cb4722fd9808bd54a5abe019a1ac47f2 Mon Sep 17 00:00:00 2001 From: infidel Date: Wed, 14 Dec 2022 00:05:05 +0700 Subject: [PATCH] CSV Parser added, interactive table with bind utilization --- db.sqlite3 | Bin 135168 -> 147456 bytes wg_api/__pycache__/views.cpython-310.pyc | Bin 6452 -> 8854 bytes wg_api/__pycache__/views.cpython-311.pyc | Bin 13522 -> 19802 bytes .../__pycache__/reqs_handler.cpython-310.pyc | Bin 1262 -> 1771 bytes .../__pycache__/reqs_handler.cpython-311.pyc | Bin 1654 -> 2953 bytes wg_api/utils/reqs_handler.py | 28 +++ wg_api/views.py | 184 ++++++++++++++++-- wgweb/__pycache__/settings.cpython-310.pyc | Bin 2673 -> 2816 bytes wgweb/__pycache__/settings.cpython-311.pyc | Bin 3033 -> 3190 bytes wgweb/__pycache__/urls.cpython-310.pyc | Bin 1395 -> 1599 bytes wgweb/__pycache__/urls.cpython-311.pyc | Bin 1890 -> 2257 bytes wgweb/settings.py | 10 + wgweb/urls.py | 4 + 13 files changed, 215 insertions(+), 11 deletions(-) diff --git a/db.sqlite3 b/db.sqlite3 index 51f6569d161e456b70b9c004d66e564596aae4e0..9d3de9e84d282ee5623ca9b946ca7158e05b94ca 100644 GIT binary patch delta 2074 zcma)7OKcNY6rJa>W6uQVnGli|NId>TAu@L6&BvZ`q15@14~dh2L)1!<8PA6}wc{jA z5OpUvC!;TQMm>2b~0PAyLy_)zsTEUwwM>m zjYzu^<;G(#aiN;6Ru4v9z*SpN8aBk`qO ziA>U<$t4*Yg^jdu5=FSkQweBR6cE>D5TNc|3@DjiOzUYW^RzU9V_6oJIuB;sfWPoo z-v}TI_xb|++exEb0*+wtU-%vT1%3%7I8t)a91Ol-b$dXqw#Q`=`>gJchJd56di)*S zPhKzBUlCo+?=~+rk2fD_Cdfa?GI_n2?zNq8$nhdK?AyT?(}QbAN?m=vW?PoA>key6u! zpAucp&zv7R-*&#?oOez+1*f-||8dX8ek%xo#x3-BSV13na?gBKf4w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>9;mN1j_yj<*91I+c984VS96~&N0Jx110{{R3 diff --git a/wg_api/utils/__pycache__/reqs_handler.cpython-311.pyc b/wg_api/utils/__pycache__/reqs_handler.cpython-311.pyc index 8768bb90e459cfa95f4ab2b18f0fd487f5580e52..34175a5ea58f93ec98a068a2d1c27b680a8f192a 100644 GIT binary patch delta 1282 zcmb7EOKTHR6u$FHrb#Ak#XjtFY!REryxJ;l5T(@8T4+mAs0cNLOq!0QO*%8BHcZGA zx=2f~EhFecunWGOSxARB^mVj0)FqX-y84-hDU?f{eHhMoD^Xs<6EB1m?x50 zTNYzd7o6v!Bo1B@{t&6PLfG-V2g4-*8RyLNyySql!Aa5eP`?=|ByY*mWgy+y>n6ZC z5lZ@N#ywcFJGB|f30pNv&_I|KBzO~+80QOP@K$(^<+R&YBt)lw%WbA&Ujv%h%KLPIJ5j%hk~O=Zp!s0m+J zE5)j7bcg0h6Oq#x+X|1*u^Tln+Wc30V=j2GQn2?P+k5kLuX$NOF;hyc zMMd5YJi|X6^TJ6U{WsHL^T8U|K#uFYB^Y!Ntz}e&E*sHUMpfwPAowz>2lKo?0Hhk# delta 117 zcmeAa|Hi|&oR^o20SNd?T9T`oC-O-!YD`quU}X$u&}7}1aD|1jYO*P71f$&KK2~wI z2Ydnz?hhufW_4xKWSxAGOB5*nkxPn80cZdt5EuJR7Ui~*;bRp0z<@~<@d1?p0C)8o ADgXcg diff --git a/wg_api/utils/reqs_handler.py b/wg_api/utils/reqs_handler.py index 5c028baa..f66403d9 100644 --- a/wg_api/utils/reqs_handler.py +++ b/wg_api/utils/reqs_handler.py @@ -54,3 +54,31 @@ def req_apply_sys(): # # http://10.30.1.138:5000/api/client/caivc1vekn84im2m6ec0?_=1669623393468 + +def req_ip_recommendation(): + # Write your own ip recommendation next time + # http://10.30.1.138:5000/api/suggest-client-ips + + inf_s = get_session() + req_url = 'http://10.30.1.138:5000/api/suggest-client-ips' + + req = inf_s.get(req_url) + req = req.json() + + req_dump = {} + req_dump["allocated_ips"] = {} + req_dump["allowed_ips"] = {"OAM":"10.30.1.0/24", "NEW_OAM":"192.168.200.0/24", "WG Nodes":"192.168.100.0/24"} + + i = 0 + + tmp_array = [] + for x in req: + print(x) + tmp_array.append(x) + i = i+1 + + req_dump["allocated_ips"] = tmp_array + print(req) + print(req_dump) + + return json.dumps(req_dump) diff --git a/wg_api/views.py b/wg_api/views.py index 66a5a692..5e123559 100644 --- a/wg_api/views.py +++ b/wg_api/views.py @@ -1,18 +1,21 @@ from django.shortcuts import render from django.http import HttpResponse +from django.contrib.auth import authenticate # from django.core import serializer from rest_framework import viewsets +from rest_framework.decorators import api_view, permission_classes from rest_framework.views import APIView from rest_framework.authentication import SessionAuthentication, BasicAuthentication from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response +from rest_framework.authtoken.models import Token from rest_framework.permissions import IsAdminUser from .serializers import wgSerializer from .models import user_model from .utils.html_parser import get_logs, get_profiles import json from .utils.statistics import count_clients, count_traffic, count_connection, count_percentage, count_broken -from .utils.reqs_handler import req_edit_state, req_edit_user, req_apply_sys +from .utils.reqs_handler import req_edit_state, req_edit_user, req_apply_sys, req_ip_recommendation from django.middleware.csrf import get_token from django.views.decorators.csrf import csrf_exempt @@ -21,11 +24,40 @@ class wgLogin(APIView): permission_classes = [IsAuthenticated] def get(self, request, format=None): + + # serializer = self.get_serializer(data=request.data) + # serializer.is_valid(raise_exception=True) + # user = serializer.validated_data['user'] + user = request.GET.get('username') + password = request.GET.get('password') + content = { 'user': str(request.user), # `django.contrib.auth.User` instance. 'auth': str(request.auth), # None } - return Response(content) + + # user = content['user'] + print(request.META['HTTP_AUTHORIZATION']) + + print(user) + print(password) + + user = authenticate(username=user, password=password) + + print("****-> ",user.id) + + token, _ = Token.objects.get_or_create(user=user) + + response = Response(content) + + response.set_cookie('Token', token.key) + + # print(response) + + return response + # return response + + # return Response(content) # Create your views here. class wgView(viewsets.ModelViewSet): @@ -44,6 +76,16 @@ class wgView(viewsets.ModelViewSet): # serializer = wgSerializer # permission_classes = [IsAdminUser] +@csrf_exempt +@api_view(["GET"]) +@permission_classes([IsAuthenticated]) +def wgCheckAuth(request): + + return HttpResponse(json.dumps({"Auth":True})) + +@csrf_exempt +@api_view(["GET"]) +@permission_classes([IsAuthenticated]) def wgViewLogs(request): param = request.GET.get('param', '') @@ -134,6 +176,9 @@ def wgViewLogs(request): return HttpResponse(final_data, content_type='application') +@csrf_exempt +@api_view(["GET"]) +@permission_classes([IsAuthenticated]) def wgViewClients(request): param = request.GET.get('param', '') @@ -145,6 +190,7 @@ def wgViewClients(request): final_data = [] + # if request.user.is_authenticated: if filter : filter = str(filter).split(" ") for x in filter: @@ -229,11 +275,15 @@ def wgViewClients(request): tmp_val = x["email"] tmp_val = str(tmp_val).split("@")[1] tmp_val = tmp_val.lower() - if {"email": tmp_val} not in groups: - # print("-> ",tmp_val) - groups.append({"email": tmp_val}) - final_data = json.dumps(groups) + if tmp_val not in groups: + groups.append(tmp_val) + + # if {"email": tmp_val} not in groups: + # # print("-> ",tmp_val) + # groups.append({"email": tmp_val}) + + final_data = json.dumps({"email":groups}) if param == "orgs": groups = [] @@ -242,12 +292,15 @@ def wgViewClients(request): tmp_val = x["name"] tmp_val = str(tmp_val).split("-")[0] tmp_val = tmp_val.upper() + + if tmp_val not in groups: + groups.append(tmp_val) - if {"orgs": tmp_val} not in groups: - # print("-> ",tmp_val) - groups.append({"orgs": tmp_val}) + # if {"orgs": tmp_val} not in groups: + # # print("-> ",tmp_val) + # groups.append({"orgs": tmp_val}) - final_data = json.dumps(groups) + final_data = json.dumps({"orgs": groups}) if param == "stats": data_logs = get_logs() @@ -278,11 +331,16 @@ def wgViewClients(request): else : final_data = json.dumps(data) + # else: + # final_data = {"Not Logged In"} # print(request.GET.get('param', '')) return HttpResponse(final_data, content_type='application') +@csrf_exempt +@api_view(["GET"]) +@permission_classes([IsAuthenticated]) def get_ApplyConfig(request): # id = request.GET.get('id', '') @@ -293,6 +351,9 @@ def get_ApplyConfig(request): return HttpResponse(req_response) +@csrf_exempt +@api_view(["GET", "POST"]) +@permission_classes([IsAuthenticated]) def get_EditState(request): id = request.GET.get('id', '') @@ -325,6 +386,9 @@ def get_EditState(request): # return get_token() # @csrf_exempt +@csrf_exempt +@api_view(["GET"]) +@permission_classes([IsAuthenticated]) def get_EditClient(request): my_token = get_token() @@ -353,6 +417,104 @@ def get_EditClient(request): return HttpResponse(ret_val, content_type='application') - +@csrf_exempt +@api_view(["GET"]) +@permission_classes([IsAuthenticated]) +def get_user_param_recommendation(request): + ret_val = req_ip_recommendation() + + return HttpResponse(ret_val, content_type='application') + +@csrf_exempt +@api_view(["GET"]) +@permission_classes([IsAuthenticated]) + +def wgFilterClients(request): + + param = request.GET.get('param', '') + filter = request.GET.get('filter', '') + name = request.GET.get('names', '') + orgs = request.GET.get('orgs', '') + emails = request.GET.get('emails', '') + state = request.GET.get('state', '') + + print("param ",param) + print("filter ",filter) + print("name ",name) + print("orgs ",orgs) + print("emails ",emails) + print("state ",state) + + data = get_profiles() + data = json.loads(data) + + final_data = [] + + if orgs: + orgs = str(orgs).split(", ") + tmp_data = [] + for x in orgs: + print(x) + f_orgs = x + i = 0 + for x in data: + if str(f_orgs).lower() in str(x["name"]).lower(): + x["data_id"]=i + tmp_data.append(x) + i = i+1 + + print(tmp_data) + + if len(final_data) < 1: + final_data = tmp_data + else: + for x in tmp_data: + final_data.append(x) + + if emails: + emails = str(emails).split(", ") + tmp_data = [] + for x in emails: + print(x) + f_emails = x + i = 0 + for x in data: + if str(f_emails).lower() in str(x["email"]).lower(): + x["data_id"]=i + tmp_data.append(x) + i = i+1 + + if len(final_data) < 1: + final_data = tmp_data + else: + for x in tmp_data: + final_data.append(x) + + if not (orgs or filter or name or emails): + final_data = data + + # SANITY Starts here ------------------------------- + + no_duplicate = [] + for x in final_data: + if x not in no_duplicate: + no_duplicate.append(x) + + ret_val = json.dumps(no_duplicate) + + return HttpResponse(ret_val, content_type='application') + +@csrf_exempt +@api_view(["POST"]) +@permission_classes([IsAuthenticated]) +def wgBulkReg(request): + + print("-> Bulk Registration") + RegData = json.loads(request.body) + + for x in RegData: + print(x) + + return HttpResponse({"success"}, content_type='application') diff --git a/wgweb/__pycache__/settings.cpython-310.pyc b/wgweb/__pycache__/settings.cpython-310.pyc index c9f8117e4de39586be3cfb730ed3251f91acc816..6d50c353b7377cfebe476e8693fa67b10feb6249 100644 GIT binary patch delta 373 zcmew;(jdl{&&$ij00hg0yOM+XC-TWK9-F8gUZ299&X~y<#h=0xC6L0K&XB^A!UrVz z7Xd|61m>`$Ge!xf2u2B|2&D+8vZaVfGo*;lVFKz9P7zBH2dWWEkpPpDU{WfRF`Xq! zBt<$(G({##EQKXX9Ec@SWTPZg#XI{r1_!$aR~cf_pPE;anVeXXnV+W@0y4@GXeL5z^IXg;ZejM9_y zIQH=K1-S-?#JdGK`nrbu2YFA{Ocn+n9sy<+b{1w1CJt5( cJ`Qd+4i-ix7A8if|1AGm*d|+YnKQBj0RM7ijsO4v delta 239 zcmZn=`zXSf&&$ij00ch;+mlQACi2NJ?wP0^ULVDu!kx~L!ji%RBzYGxW-_Mm&0$Gr zj1oxUj}lA~ND)kBOA(T0ND-dHl*t$+lp>NM3REMKA_gYK!K6ecV>(NeaEfGIp?uy0v%qYIXRTeUnT&^WMSap5nyIv bXJO`G;$Y?A<=|%HU}0oontX!GoRJj(Pi!{i diff --git a/wgweb/__pycache__/settings.cpython-311.pyc b/wgweb/__pycache__/settings.cpython-311.pyc index d8eb1972cb4b4802b3c536a1bbf54dc7ac83bcbf..dd1c287d553e78e22f400971e632bcb5bb9db51c 100644 GIT binary patch delta 407 zcmca9{!M~!IWI340}w11?n(~kpU5Y{#KAaGV_JO*cRFJxV-$Z1Pn19kZ#qK?O9~&5 zTOoXVCWQpL@{kRm#V38+UnMJz=es7fqF0!&JRNvTZ6 zbe1TQ6zM3@6qzWo6qYD)AeKmxjgm}}i;_x_4`$F*NYr9vVBm7eO5AMB_==H{YqA{k zW~nNPqSWG&__U(L+|=^?qHMj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