From 24cb941f94c25a8ffbfeb14a08b582bb66d941c9 Mon Sep 17 00:00:00 2001 From: infidel Date: Thu, 24 Nov 2022 17:11:55 +0700 Subject: [PATCH] NEW API : * /api2/wgEdit?id=&state= --- .gitignore | 1 + wg_api/.views.py.swo | Bin 0 -> 28672 bytes wg_api/__pycache__/__init__.cpython-311.pyc | Bin 0 -> 169 bytes wg_api/__pycache__/admin.cpython-311.pyc | Bin 0 -> 721 bytes wg_api/__pycache__/apps.cpython-311.pyc | Bin 0 -> 539 bytes wg_api/__pycache__/models.cpython-311.pyc | Bin 0 -> 1134 bytes .../__pycache__/serializers.cpython-311.pyc | Bin 0 -> 822 bytes wg_api/__pycache__/views.cpython-311.pyc | Bin 0 -> 10783 bytes .../__pycache__/0001_initial.cpython-311.pyc | Bin 0 -> 1379 bytes .../__pycache__/__init__.cpython-311.pyc | Bin 0 -> 180 bytes .../__pycache__/html_parser.cpython-311.pyc | Bin 0 -> 3861 bytes .../__pycache__/reqs_handler.cpython-311.pyc | Bin 0 -> 1188 bytes .../__pycache__/statistics.cpython-311.pyc | Bin 0 -> 1364 bytes wg_api/utils/html_parser.py | 1 + wg_api/utils/reqs_handler.py | 29 ++++ wg_api/views.py | 162 ++++++++++++++---- wgweb/__pycache__/__init__.cpython-311.pyc | Bin 0 -> 168 bytes wgweb/__pycache__/settings.cpython-311.pyc | Bin 0 -> 2897 bytes wgweb/__pycache__/urls.cpython-311.pyc | Bin 0 -> 1670 bytes wgweb/__pycache__/wsgi.cpython-311.pyc | Bin 0 -> 686 bytes wgweb/settings.py | 2 +- wgweb/urls.py | 3 +- 22 files changed, 164 insertions(+), 34 deletions(-) create mode 100644 wg_api/.views.py.swo create mode 100644 wg_api/__pycache__/__init__.cpython-311.pyc create mode 100644 wg_api/__pycache__/admin.cpython-311.pyc create mode 100644 wg_api/__pycache__/apps.cpython-311.pyc create mode 100644 wg_api/__pycache__/models.cpython-311.pyc create mode 100644 wg_api/__pycache__/serializers.cpython-311.pyc create mode 100644 wg_api/__pycache__/views.cpython-311.pyc create mode 100644 wg_api/migrations/__pycache__/0001_initial.cpython-311.pyc create mode 100644 wg_api/migrations/__pycache__/__init__.cpython-311.pyc create mode 100644 wg_api/utils/__pycache__/html_parser.cpython-311.pyc create mode 100644 wg_api/utils/__pycache__/reqs_handler.cpython-311.pyc create mode 100644 wg_api/utils/__pycache__/statistics.cpython-311.pyc create mode 100644 wg_api/utils/reqs_handler.py create mode 100644 wgweb/__pycache__/__init__.cpython-311.pyc create mode 100644 wgweb/__pycache__/settings.cpython-311.pyc create mode 100644 wgweb/__pycache__/urls.cpython-311.pyc create mode 100644 wgweb/__pycache__/wsgi.cpython-311.pyc diff --git a/.gitignore b/.gitignore index 1377554e..ca3ce43f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.swp +/inf-env/ diff --git a/wg_api/.views.py.swo b/wg_api/.views.py.swo new file mode 100644 index 0000000000000000000000000000000000000000..215bde65184e906aae46e77ba0eddbaed99901d5 GIT binary patch literal 28672 zcmeI4dypJO8Ni2x2nZpOXIX*_duZ?&DQ}{%%#r%4I#~x#|o5i-rutE*I>)RTLrn zJqlLdakKjs2?DQ@3AXpGFX!4XcAX(B=eIk#O54a_+p27CjaAOKj|^tA6}$aP+ZyrG zmGxt%swK1rv*{Ozc^07o_ z{a@MtuS_$Hop2kJ;q!0;yo20h@Do@JBHo$sF_;2>Agvv66Wjg(F8(=ZC!LhK1 zNsr&a&){2dE3Aj5&<@jKFB2=z!y|AnY=%wH2eaT)@J}X3{sfQ1kKvneJzN3jz$f7y zCSaa}hv7lk47bA&*w6yaa10y`yP5FW2@kSgvh!p?(YDII*DU2*WD#7;A9l;;Qs1v!VtEy(>{*mw6|2?EIc1-C8Gn7n z>YkCUppsnHx1BQC2uc$RlbN8r`QcKolWhhR;f^OMR}hqa)0zRpbGttmbYr)w5{% zd8s%7RoM4KO9!MHQS2oPmK{W~52V!MN$+!^$5-vuIuV6lxV*2cE3_e!4*%MI#vksvGW=%u|%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PSPG}YDKHr(f!YtSi}nBeVJqAUx4_Nd!vI_a{F^f4aM;U! zfM3G{a0_^F1@yw%Fd5!pPrx&9Kimv1^g|Dv1(RS8djy__t#A{ph0EbWm<@-)U)dk< z6nqbEgbJwr1GD&TfY>+iE4UB71`b>X=fg~x1bf&k@HA`%v4_BeE1(z7hNB4z*?xlN|*!Z!YnZ1 zG?)g*LQv zjl|li>N-F4K0teJXwMDN7}aj*3GcaqtBaTJ5l$|`k-5+E*)`B)E^sX|_psg>cFn-k zz+7#)Ryth&|0Qp z0U+%CM_~&%P=*CC4c@?R-vd8|ufp|kDYU_#vDcr4>)|?ZpbU%PWOxl*eFt0z>!25U zU_P7zCxP(s-wUElKZGBEKC}k32DApW2DApW2DAqL=QI#nL#t4i9dPq=Yg z`O*CJq$8Me)Jyt>8DZUof5l$h{*?CWi*=Gz6-y6Q?%$1E?zC4Qes;0?LPuBa)tA(W z_$@pt@GPW7$zP4U`l3j&bR++^HvHRacJ`~7aYUw+LthX>g{gC}wvT%o$tX9Ggs0Sg s9Y~@b`J&&bo&!&Mw?&WSQ3?OH(8)3i4D(ZU8Bdm@sKmyIF!2`SKcOs^>Hq)$ literal 0 HcmV?d00001 diff --git a/wg_api/__pycache__/__init__.cpython-311.pyc b/wg_api/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b86660114eb0b1322de7dbf936f8b931cc6b8a65 GIT binary patch literal 169 zcmZ3^%ge<81l6TA$sqbMh=2h`DC095kTIPhg&~+hlhJP_LlF~@{~09t%SJyVKQ~oB zGcPSOB{fGsxH2zUKcFZ-D>b=9KR>xZw>(`pDKR-aH7`ZKJUu?KAX7g+J~J<~BtBlR npz;@oO>TZlX-=wL5i8IzkaflUK;i>4BO~Jn1{hJq3={(ZRbwa; literal 0 HcmV?d00001 diff --git a/wg_api/__pycache__/admin.cpython-311.pyc b/wg_api/__pycache__/admin.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..acd215b84dbaaa551a14f2d762840d3325eaa728 GIT binary patch literal 721 zcmZuu&1=*^6n~R!J_v0OuAYSAu{pFk3nB;wp|*>#o}w_MnK90qk9Cp|R*Uq|gGX<@ z_EZu7nNX@ts6B(&~;Dr@$d33_^pE&}4=#XDX*j zo?s>4QFfDzqKuv&oYm~mLqx9OdmWr~XOqA0!ntg>8c6RkJcvECN5czANyAQ^*JPw}AV#4DpDB|gM zlWZSG@mrp=ph;*n6+!#*o#{;C=vsl(EQeYg|67aU%j11q@@^kB@?EvTCQ+UgJ8_X$ zQXESB6=k=BD#^&$V`R8Vc4a7e2e!}nv3_tIkIp1OH0=DKo HxBdME*hI8j literal 0 HcmV?d00001 diff --git a/wg_api/__pycache__/apps.cpython-311.pyc b/wg_api/__pycache__/apps.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d791aa90ae6819b07fb7e09b849bb6c635bc6164 GIT binary patch literal 539 zcmZutJ5R$f5I!eqRr){(P^AtGj2W7&9S~9h!GKgDbwJ8uxv?8k@*-(e6&O0O!`6QQ zLj0MIRaPdpqB3>DPEsTUXZ!9u-`#iiz0_)D;Bpt=n~&VS3ui5b94s{sra*xr2V7(z z1QMJ9l^%e~3_Z&LZ~SCpNL1;9TKEvIijs|X5FGnn-?q#=BQ+>@mURxMz`#Hhcr7wy zDj5ouIfs%|F0FQ8XXUqhbU-}I*Jw|3eaf6jJF=~IJoHa(=Fp@#vM>qkj#@}c7<i&y(!@=UR;7dNONZeWcf}y1bFLOLLTC>Av)_ABl+f-1{;DVSQ`~<2 I6H1$X1D~XZ0*Nj$J1gji?`2sJ_~V(?NhAs?ML84B$9{75))ImpfGhnytC^dnu@-}&+pIgy}RGL^A|!S1hU`yQ2T}v z`oW!4#0z6|AB-bJ5ydugu!b=b&=W+314J_n*M+p;ID^m$Jc(!-n%zPr@r=7A9Oaw_ zWwu|tNXM@fJUR#W2r;B#iZnq$EK|>>K#EU=W7ymYJc(#xjL4-v%}gMsF7?PxAo4L{ zI_+@`#!2cRP5N(k=2G{`_2p|3go+19o25Az(o`h1eCFx#h^)In6b2?a#yj0+t{Lo} z{f3>L-2_z|4*?u*^AV2bK^>t0bSm{R4%*{tNryCych!;-<#pXP9H#4$q;t|Oo7=LkziAnElJPjPX!`N4 z;cZyVrhMmBsEMR?2MEM5Z-!&Uw)vdxMe;K@U?#gjLvYPAxfK{e%jech zFrB713&mfNr@+hOoAvmGj}^aq{wb)=_%|R6hp$4i(4Fg%a-Wn#QtoUF$RZCecJK5^ zrB5m$sX$OJ9Bzbip)2&{)xNwM%B!9Afn4OlVqabkbmo z?!BI(_7yc$)Xvi@gTpKqZx7L=N{Da{)lxQ^rgg(L8x^{p3{u?WUtdD8z9=oRAA`9(2=d* zpa}6D_zWEwqFb4|rAntvyywGBqxRk1&+m`l-@6~pW*v~ejK9Xe@%xvAioE~K{0%Z^ zAVIPeG8Qrh(vduMG9GdU4!i~Fego+#cIZ~l=N#Y{9!sGo{Vud?mn62CSud1MqBQxe zbaBb7u0BSk$a1OD*m_y4Le5{Id`)U-Knh;T%3USc(&6*H{C{se1x}d7ZDe(;T) zS~N}2cx6k*?c#8eW1guX8T1ltIOrY^;^3Xm4^=!0@_4vC>2H6C;v+SX z!K5#uVG`ULS!Z}`T&hSvz*v-}c!qFtv!)wcr{1)+b?Vd7Ei~#)goC!L*GXs)G%K~< zAg=uDF>$pDX!gY}!ZP&CalGdXLyS~R@15-?z+e592k?3ih-6YpXn%;=<%NZ4R zV2}3c4J_}@ma|&oVr|#Xd`~~c0Cc0pdxRNhj7{O?#p<5Ii;LAgb2-B{?!xz-KbxH^ LGF;zdEqnO~w!giy literal 0 HcmV?d00001 diff --git a/wg_api/__pycache__/views.cpython-311.pyc b/wg_api/__pycache__/views.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6261f8c5434f141f8fb5ecc7bc987ee6095e82e7 GIT binary patch literal 10783 zcmd5?YfKwimag*qQN}jL_=Symgja$|pwkT`frdaxNSd@d>Bo4wWjQWGO#C2KMd;9G z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+j}NER%OR3?3l&*AUw|(r~kVGS67ua-Mxz#uzd<$$G z8iro7v2PFwRkH85>_@4Ln3EFcZnONmnjNPVGot*Fz(q;h=KnDl>2A7 literal 0 HcmV?d00001 diff --git a/wg_api/utils/__pycache__/reqs_handler.cpython-311.pyc b/wg_api/utils/__pycache__/reqs_handler.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3c4bc1e66a35f839ded93365e09ad872c7fc4b40 GIT binary patch literal 1188 zcmZ`%&1(}u6rbIl?WV~#ty*#X~P)n;F}Uo85J0W3i;T zieQz3-r9qQo+{Fde}YGkiR2I#Dh2W2Ezny}zS*{mReZDi-n_4QZ|3(t_VpzZ(AVqF zD>r0>ehB4|K#yoQ3t|lsL?j!{?n`M_BJwLVD-#8{LZlg#!@orM-Aa^nz%WP!{@poX zaE1g+{vaa=z#?vNW>b``%T<7%LVo77JsAv5Qx(UMd!ghV9Nnk`g8ueNv~~=b<)3 zIk#LV#GcE2I4>E+l!@t^p=vpg%AAYxnatjlvEbII0XB+0E03u|jK%q~=~+hIw`^`eEnZ$Q9b!{f@ScUKdFq$>ep%KBXN%|Kmw^SSGjjH` z);x9vzM!fXAFE;?J$5Aemi7db%N~~kh;mL^#U@E?V_<*W$wT7|@z;4ChLY#IO1rYXt zA7YO{C~t`V{vo3M9lMPGJgb3^R+3;yVIUJQ43A8k)2R^qtWF;Qh_Xe(9`2idoiFM4 z>66Su)6V4c6Pcyl|3;%?Th#FlPW}9TVor^~32~Lfc&Maa^LVIw%yN9z3(bT7IEYXc z;gqGsUIVPlPfa^i1n4T5GJ=>coN3{t!~*c6jFVs#S$r8-fVTDFH+NR=1d}_O{$Bg0 z4R?{Gp6Cn=t*FA%^YXbc40Q$u!7zAYLv5zd!52(#r;o2z*N0o_)9v)>VEQNST`8=e zZ{chkXPY>?lk9(Y;q8Uy(9JLBTgg&8Sqg56m@_X*uS!9*SQ?N+%TvE5`1Um&T0Xe?`tgA?p)Iq5rS{>9MM5~Kc=~x%VEIlCgchSErD)1Y( C2oDDU literal 0 HcmV?d00001 diff --git a/wg_api/utils/__pycache__/statistics.cpython-311.pyc b/wg_api/utils/__pycache__/statistics.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8f229fe9d9c4d41638d0cacca2987709081f0995 GIT binary patch literal 1364 zcmbu8&ubGw6vt=wN0K(#G&TK!qPQq15$obXq1p zJ&44TLp?P}51y3bKck+)Ud2Oi3%y8BzL}(HBCQ}!$anU=`Sm{Y-h5V+Q3UOE5E^d< zgnlsNxPi^v;Z5jv5kUmoXbBPF4O+rP1Qmz`DiRq~A}LUr;6+qQAFzcL1M~G=5us!M zLltBf`2%Ai`UKXOz6W-|l@g9c+jO9li0G&Q^!`3V` zFAox-pV@rVe>dBj{VGiyf(H$8NZ{ZcH{b(q1#jUHmC-Y0O9*i&5aB#q!rLp*E!@h7 z>`ufAWfvODjcVC)_Q64AW~Zs?FTc?37{Bz`zN)Iy6dULT=~I1m)iNlHjRoq>fJCU1 zAB!G#l<@>%`6`zt?i8lmxP5(Z^jqOdGu=!lDU>Tl6`Fw+Lk#R3&Ttn#1{jLKFhoGa z8m|H>hnPq`o(aw)_jodm>LOfj;Kh$#9{mp}uCWV2 z98??vmAasmJrsJ538SM$kW-oJCN-d}^r}gxVa^nrcL(HbrYEg?I~&{c|A!xvqy71)a1=#lzJFyJ%cU*mY zj^nm(x1a9a|G4qtZ2D3vmexF|5LW&C8Sq-+m&=dr2FHq=Kb)h?+`3Bw+k8MTf{)ds sXMiLk#<+vB5&tEUfG44@jwO@A#RT=GAY&y#eaZK~xbF|MKaUsSZ}cY{0RR91 literal 0 HcmV?d00001 diff --git a/wg_api/utils/html_parser.py b/wg_api/utils/html_parser.py index 6736cbf6..c8689a2e 100644 --- a/wg_api/utils/html_parser.py +++ b/wg_api/utils/html_parser.py @@ -151,6 +151,7 @@ def get_profiles(): current_data["data_id"]=i final_data.append(current_data) i = i + 1 + final_data = json.dumps(final_data) # print(final_data) diff --git a/wg_api/utils/reqs_handler.py b/wg_api/utils/reqs_handler.py new file mode 100644 index 00000000..88c84d4c --- /dev/null +++ b/wg_api/utils/reqs_handler.py @@ -0,0 +1,29 @@ +import json +import requests + +def get_session(): + login_data = {'username':"admin","password":"admin"} + inf_s = requests.Session() + inf_s.post('http://10.30.1.138:5000/login', login_data) + + return inf_s + +def req_edit_state(id, state): + inf_s = get_session() + + if state == "false": + state = False + + if state == "true": + state = True + + req_val = {"id":id,"status":state} + req_val = json.dumps(req_val) + + print("Req Val --> ", req_val) + + req = inf_s.post('http://10.30.1.138:5000/client/set-status', req_val) + + print(req) + + diff --git a/wg_api/views.py b/wg_api/views.py index 99416f6a..66c60ca2 100644 --- a/wg_api/views.py +++ b/wg_api/views.py @@ -8,6 +8,7 @@ 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 # Create your views here. class wgView(viewsets.ModelViewSet): @@ -127,48 +128,145 @@ def wgViewClients(request): final_data = [] - if filter : - print("x"*100) - i = 1 - for x in data: - if str(filter).lower() in str(x["name"]).lower(): - print(x["data_id"]) - x["data_id"]=i - print(x["data_id"]) - final_data.append(x) - i = i+1 - final_data = json.dumps(final_data) - + if filter : - elif param == "stats": - data_logs = get_logs() - data = json.loads(data_logs) + filter = str(filter).split(" ") - sum_data = count_clients(data) - connected_data = count_connection(data) - traffic_data = len(data) + for x in filter: + print("-> ",x) - percentage_data = count_percentage(data) - broken_data = count_broken(data) + final_data = data + + if not (filter[0] == "" and filter[1] == "undefined" and filter[2] == "undefined"): + if filter[0] != "": + f_name = filter[0] + i = 0 + tmp_data = [] + for x in final_data: + if str(f_name).lower() in str(x["name"]).lower(): + x["data_id"]=i + tmp_data.append(x) + i = i+1 + final_data = tmp_data + + if filter[1] != "undefined": + f_orgs = filter[1] + i = 0 + tmp_data = [] + for x in final_data: + if str(f_orgs).lower() in str(x["name"]).lower(): + x["data_id"]=i + tmp_data.append(x) + i = i+1 + final_data = tmp_data + + if filter[2] != "undefined": + i = 0 + f_email = filter[2] + tmp_data = [] + + if f_email == "" : + print("Empty mails...") + for x in final_data: + if str(x["email"]).lower() == "": + x["data_id"]=i + tmp_data.append(x) + i = i+1 + else: + for x in final_data: + if str(f_email).lower() in str(x["email"]).lower(): + x["data_id"]=i + tmp_data.append(x) + i = i+1 + + final_data = tmp_data - traffic_data = count_traffic(data) - if traffic_data > 1000000000: - traffic_data="{:.2f}".format(traffic_data/1000000000)+" GB" else: - traffic_data="{:.2f}".format(traffic_data/1000000)+" MB" + final_data = data - data = {} + final_data = json.dumps(final_data) + + elif len(param)>0: + + if param == "email": + groups = [] + for x in data: + if str("@").lower() in str(x["email"]).lower(): + 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 param == "orgs": + + groups = [] + for x in data: + if str("-").lower() in str(x["name"]).lower(): + tmp_val = x["name"] + tmp_val = str(tmp_val).split("-")[0] + tmp_val = tmp_val.upper() + + if {"orgs": tmp_val} not in groups: + print("-> ",tmp_val) + groups.append({"orgs": tmp_val}) + + final_data = json.dumps(groups) + + if param == "stats": + data_logs = get_logs() + data = json.loads(data_logs) + + sum_data = count_clients(data) + connected_data = count_connection(data) + traffic_data = len(data) + + percentage_data = count_percentage(data) + broken_data = count_broken(data) + + traffic_data = count_traffic(data) + if traffic_data > 1000000000: + traffic_data="{:.2f}".format(traffic_data/1000000000)+" GB" + else: + traffic_data="{:.2f}".format(traffic_data/1000000)+" MB" + + data = {} + + data["clienttotal"]=sum_data + data["traffictotal"]=traffic_data + data["connectedtotal"]=connected_data + data["percentagetotal"]=percentage_data + data["brokentotal"]=broken_data + + final_data = json.dumps(data) - data["clienttotal"]=sum_data - data["traffictotal"]=traffic_data - data["connectedtotal"]=connected_data - data["percentagetotal"]=percentage_data - data["brokentotal"]=broken_data - - final_data = json.dumps(data) else : final_data = json.dumps(data) # print(request.GET.get('param', '')) return HttpResponse(final_data, content_type='application') + +def wgEditClients(request): + + id = request.GET.get('id', '') + state = request.GET.get('state', '') + + print("Edit Request") + + if state and id: + print("[ Edit ]=======") + print(id) + print(state) + + req_edit_state(id, state) + + + final_data = json.dumps({"state":"Success"}) + + return HttpResponse(final_data, content_type='application') + + diff --git a/wgweb/__pycache__/__init__.cpython-311.pyc b/wgweb/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ceff05a3f027e7d3f3e5bdb23f581673da0aab7a GIT binary patch literal 168 zcmZ3^%ge<81l6TA$sqbMh=2h`DC095kTIPhg&~+hlhJP_LlF~@{~09t%UVApKQ~oB zGcPSOB{fGsxH2zUKcFZ-D>b=9KR>xZw>(`pDKR-aH7`ZKJiRPO4oIE6^;EZN>aR;sY}yBjX1K7*WIw6axSz1}C-v literal 0 HcmV?d00001 diff --git a/wgweb/__pycache__/settings.cpython-311.pyc b/wgweb/__pycache__/settings.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0a21b9d88b51bb67b76679b49dd38100a0f2c6b2 GIT binary patch literal 2897 zcmb6bOK;mon$-Ip*|8lbO#l`_o5-mt%gVcjTUw$Wp|Yfkbi7NTC1}oAro)FqQc+Bx zfR4LB4}04ldf3gO#Ug*kSrll%lYyRkN!^BDr3 zjemYE|0honKl_X6lbB3?{Vz=ZP9Q=c5Q!oxsYQecNkj-7!O`zYf_Mr4@$-+^bQT`J zhsDb?#8G@YJ)a2)6cv&vCZu`i!tGcYD$%)*$0F^AGZ9{Jc9@^QHrq(Y+n zcd;HR6i`99fG(gSPM|p_OAu)OyNE&xMRXA@0M$jb7{H|fUQ)d4n2QAcLBSyiHf=b>Q9tiJD_caB;sr&wusksFs($kpT7B-^ zc~GsIX7z5h^sHJrl9Bq=t?SbMdi6uATDdoPj-T8@E2|>9`}DyBz7%tEl?Ur|B{;&dJTRRr=S|Lq#hcU{qX+U+FE#h2iB#uvoJmZEgQORD*JR059i`6b^wQc zZwBeJVBNNl``B_W&1_oOvLHflZfLL}^?>8bEQbv-mHkLsZdNu->kvx_o0eNJv1N+~ zrljGaVLova!=5Phl~T%CorusBgj76~OiTxURP1A#^BoG4owGgX_N>Oq8R-x|H^zmy zN^dHGOwtUUt_8#IkXq&eT?6n~!NU;gy_vH};NkE&7+8aI6*)-s5aX;7Q-6k;cg8*r zaov535vn3TIg;cjP;B&{wtV-t`+ikfA-)enfe34;L43~1N^xh=FFdHb^MtGV2{%Qb zrR2l^L!VRo>G&4v06jO6J?zoCF7;>)JDH%l&;wJoobtpr8*6z}R% zt%jd$Tkd?2xzBA8I)eVVLffVs3JiseR72>Tayw=yGm~>2$!XeR$6Q>AUie zOSdyQ+rpkY&y-;@x?`s%=Pqq}^~Ny5DbC0ur{O~isHH3MPQqBoTul(?~_ zU=_7W%WhH>;mQ(4H`#}aK~?t6D7e;5iK5>TeLQqQLw$zbL?8N`Zo8>XhGYFWyBUtH zby;5goc*&Kud|!G+isp|Hrsn_U3}E$c+M>}S{x53KtOVEZf2)ZuQ%B}rpvmEwRV>i z+ua6)Ror{j;Mrz_oJBdEB@v7-%@|w_-5m$?EC-DzW*wF{YU>@`7v7=rMv=B=#rxh5T^5^_-XNr zli(fYy-apK;t^9YDtK4Y1wc#z@GK=R17ZqJh()hR6t9kQUW!;?$=AjC*9*(1Im#pA z*9##KO)g}-bS|Fo2p>cX`N$~kQN+SWCqxkr6feA literal 0 HcmV?d00001 diff --git a/wgweb/__pycache__/urls.cpython-311.pyc b/wgweb/__pycache__/urls.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..91a2e759dc802807b80a3a473795aaa33835d118 GIT binary patch literal 1670 zcma)6&2QT_6sH{eLw4;n+t8#47I5uSN2n{oMT-H(K2W4B7N8i4e(d0jt4OpgR}uwM zo|jw}?6MwnD6kxQ*eTo4f5rxMFm%~~opv+O(|X#YBp2?G6{SdmeDCqS-}~`Vzt-zj z1nrMYKUg;~LVwB4qE+(6t49h#KO-A;k*(MTPw@-gf+E)|-inXA*e`aA=^lF}zuYaS z>!Mfj)vl_b0;1(%8b$g$h4C_Xj8L~mYrmX(vt3%)C8`eV3xQoeU4e5jvX*+qc7+y( zjfHHux>%hSz!pZaJ%Bacv(GvzNU7 z9|{%?D3?I=l&A%qufbP}{you1d)*X0>10Ry52C%m@ z1+GWh(jATTb1FL-UD3AksZ7rALiJ3>)LH2J>}e?A&9HIBevb zUC*UKB;F|R*lzTV_EA#q^`Q28y`+(+3oJ$4-RJUYC$%LGIQ)(fFG_KPQxWz09ExDf z_)}hz8dXkZsjlCqeRJeR59GVxNhyP$R5*3uxk$;_`4+A%!NQGbf+fRAHIqruNj+QV znB`W&U2JPh_4zw`1rgEf&kR|M20S&_rk?TeAh3-4*+Vjz6EXfa%I7|_M;`r>Z-O8B{}KPdG+$8^WnO3~c#h<>g_KVwh%EOR`gC$upP@^WxBCoj zOy2H)s$0+2V|8n)l2|22r5P&ywEE-faph$DMeDc96t!d2o}l);go^6X?PnXuH=lQ& ze>KIIV|;mrDYBJi;(@l!)w=f literal 0 HcmV?d00001 diff --git a/wgweb/__pycache__/wsgi.cpython-311.pyc b/wgweb/__pycache__/wsgi.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f88153818ce92ab22039c60adaa23f6c0487bbd2 GIT binary patch literal 686 zcmY*XL2DC16n?XtHoCQoi0yeOy#&mT1wjxI1Fa#VsgR12%VxXtve`I0v+QmXQ#};) zKX~<2k^Y%fD#D%up1cKm>&e-~KzwiJ&Ad1BzW2RhzHM$=pyk8hqyLEj{4SiOl>Tk5 zdV2E(IJAKiZV1vQdNqX+nQfB*lK%20d|g{6udckr*Uk)pb3GSAzyLJQv~#`;L3^DW zEvT%Y{IuS*>J92E*$o5QRS6vhBRr;YqWb7(j%776itl5UVoI|f(#3U82=7=R^-}85 zNb!Nds=y%%I`oooek8pJIqh`3I2NJrWucOtj>dbYYeXtR8cJO*njcUlHF%iPZYb~` zO%bhLmc{8K#<=oRhxa`hs3j*~MGPf-;Ow!U8fA)cjD;FUC^I%ngOFK&ibk6ilHUz5 zbBma}LL=Yae_m_W58c+m(NUvWZ@DiI_g}v_II-uwJ1J&aD1)?8&daW=3Ak=>{z3$}j1)@0k6+<$rjwM(c?pf