Skip to content

Commit

Permalink
open source
Browse files Browse the repository at this point in the history
  • Loading branch information
daisycamber committed Nov 28, 2024
1 parent 55b1749 commit 1946fe4
Show file tree
Hide file tree
Showing 119 changed files with 369 additions and 39 deletions.
2 changes: 1 addition & 1 deletion backup_date.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Wed Nov 27 02:09:40 AM PST 2024
Wed Nov 27 06:22:42 PM PST 2024
2 changes: 1 addition & 1 deletion backup_init_date.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Wed Nov 27 02:06:07 AM PST 2024
Wed Nov 27 06:19:51 PM PST 2024
Binary file modified barcode/__pycache__/barcode.cpython-312.pyc
Binary file not shown.
Binary file modified barcode/__pycache__/blur_detection.cpython-312.pyc
Binary file not shown.
Binary file modified barcode/__pycache__/forms.cpython-312.pyc
Binary file not shown.
Binary file modified barcode/__pycache__/idscan.cpython-312.pyc
Binary file not shown.
Binary file modified barcode/__pycache__/idscantext.cpython-312.pyc
Binary file not shown.
Binary file modified barcode/__pycache__/scan.cpython-312.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions barcode/idscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def scan_id(scan_path, instance):
return False
result = response['ParseImageResult']
document = result[list(result.keys())[0]]
if list(result.keys())[0] in settings.BANNED_ID_TYPES: return False
exp_date = document['ExpirationDate']
exp_date = datetime.strptime(exp_date, '%Y-%m-%d').replace(tzinfo=utc)
if exp_date < timezone.now().date():
Expand Down
Binary file added cache/03c6dad27dd2c648afb3f2bf613f3ca0.djcache
Binary file not shown.
Binary file added cache/0457bce89e00b3b078d6d1051930bfc4.djcache
Binary file not shown.
Binary file added cache/08d68c46b57768aefb876142a4d81ae4.djcache
Binary file not shown.
Binary file added cache/10304749be955690b411e1eb77a39e7b.djcache
Binary file not shown.
Binary file added cache/112508fbb3d10fce8d4b6487ccea6f11.djcache
Binary file not shown.
Binary file added cache/14b46fbd937b6277ff7a29672269d50e.djcache
Binary file not shown.
Binary file added cache/1e52f8b2eb729a15a8cb033b64c1c15a.djcache
Binary file not shown.
Binary file added cache/2104c804be430092bcad46c4816b4ebd.djcache
Binary file not shown.
Binary file added cache/30113d2150b9a2f910c4a0a0b588a01e.djcache
Binary file not shown.
Binary file added cache/3663580274a97b5e280f14bd925542bd.djcache
Binary file not shown.
Binary file added cache/379293fcca3b6848535906f4fa6a56c4.djcache
Binary file not shown.
Binary file added cache/3fc150bde245ff1ff87e01a55f5d6438.djcache
Binary file not shown.
Binary file added cache/418bfde748e009ca7906c3f733fb4407.djcache
Binary file not shown.
Binary file added cache/428fa621b484e7558e6b1b28bb2eebe2.djcache
Binary file not shown.
Binary file modified cache/436f22ce17c44342a082deeae6781d39.djcache
Binary file not shown.
Binary file added cache/48b5926c5e937eb53327291198ef656b.djcache
Binary file not shown.
Binary file added cache/4ccb0dbf731b97a85923dbc664c8927f.djcache
Binary file not shown.
Binary file modified cache/4cd66b02679d818843a33403cab129e9.djcache
Binary file not shown.
Binary file added cache/4edc20521d1e277d29c6c0cb51711e2e.djcache
Binary file not shown.
Binary file added cache/577065d497a6f081aaf9c475fa933a57.djcache
Binary file not shown.
Binary file added cache/611ed4e7cababf5d35848dbb20770fd2.djcache
Binary file not shown.
Binary file added cache/6126a4524cd52c543da4fd1e9ad3d274.djcache
Binary file not shown.
Binary file added cache/6162494afde5881d1f29d4b445f727f2.djcache
Binary file not shown.
Binary file added cache/6284926865d6fd0877bcb73d3ce93dd6.djcache
Binary file not shown.
Binary file added cache/66730043b1a22f726051d2a629d53d0f.djcache
Binary file not shown.
Binary file added cache/68c7c60028557d6a3726af225cc0853f.djcache
Binary file not shown.
Binary file added cache/6a8b90018b8f7719d327e326100e3e8d.djcache
Binary file not shown.
Binary file added cache/6acd3f3a948c74215affd83dd6a04bed.djcache
Binary file not shown.
Binary file added cache/6b4323df55eefb5116c1920dccd8b3c3.djcache
Binary file not shown.
Binary file added cache/6e271762b3907d0956bfcb81b990cdb7.djcache
Binary file not shown.
Binary file added cache/707c776ac872e7bcb0a5c66674611fd6.djcache
Binary file not shown.
Binary file added cache/7243660d2c1d9d5cdfa65fdca91173c0.djcache
Binary file not shown.
Binary file added cache/73fc321937b1b4f3f5297f888fe0a761.djcache
Binary file not shown.
Binary file added cache/74caaeaf889fc872bddca32d0154ddf6.djcache
Binary file not shown.
Binary file added cache/758401496a6c15b041a577e38b3d7765.djcache
Binary file not shown.
Binary file added cache/786becb4e27876fd1285f4d301f319f9.djcache
Binary file not shown.
Binary file added cache/7886d90003c44635fbd42fa86f890804.djcache
Binary file not shown.
Binary file added cache/829199c9245e13f89bf5bdae9265b093.djcache
Binary file not shown.
Binary file added cache/848f3c041ebbe6bf272d5bd6136d1b77.djcache
Binary file not shown.
Binary file added cache/84c1690763bacc0077232f96105ff17b.djcache
Binary file not shown.
Binary file added cache/85e8c4ac5d7833a53d15a57fe134386b.djcache
Binary file not shown.
Binary file added cache/868913a7680dfda52a2c7f3ef9a2dd3c.djcache
Binary file not shown.
Binary file added cache/8b7153ced45715b03b0eb1b1e5529690.djcache
Binary file not shown.
Binary file added cache/8ba453aee791a142cfa3be82cf2b2522.djcache
Binary file not shown.
Binary file added cache/8cc82e585432b74a8bf1949408edbc74.djcache
Binary file not shown.
Binary file added cache/91710af58a508c9a63e71eec58aff016.djcache
Binary file not shown.
Binary file added cache/96cce71aa7d56ac48567eb66d85c4e86.djcache
Binary file not shown.
Binary file added cache/96d3da1fcc11828267484e63a38df0d4.djcache
Binary file not shown.
Binary file added cache/9e8777747015243631727371135b831d.djcache
Binary file not shown.
Binary file added cache/a047dfb35e1eb2923bcebcfed4886ddc.djcache
Binary file not shown.
Binary file added cache/a2dd017d19acf5a54c7f30d77c52c0f6.djcache
Binary file not shown.
Binary file added cache/a712c4715bde55e4e878e8827fe9b8b6.djcache
Binary file not shown.
Binary file added cache/b5d951998f196130ac9d42c50b975a38.djcache
Binary file not shown.
Binary file added cache/bded57d0639a3eef815f7a9fe8b36e47.djcache
Binary file not shown.
Binary file added cache/be0f24380bb1afc81f81ddf46788de4d.djcache
Binary file not shown.
Binary file modified cache/bf06e4cebce5053fad4b3aba44214d94.djcache
Binary file not shown.
Binary file added cache/c563ba301ed97177af25075a35118f85.djcache
Binary file not shown.
Binary file added cache/c6ecd5a971433774d4e5d22ea180444b.djcache
Binary file not shown.
Binary file added cache/cc5abc4914a267369cf44c4ec54901d3.djcache
Binary file not shown.
Binary file added cache/ce5470ee33d5335b0b7ed410ed13f75c.djcache
Binary file not shown.
Binary file added cache/cf604ce27073c87bb649448d267e8604.djcache
Binary file not shown.
Binary file added cache/d7e9b740f1144770d4bc2e1146c9831d.djcache
Binary file not shown.
Binary file added cache/d861afca743a7199d6811eba9e34525a.djcache
Binary file not shown.
Binary file added cache/d90682832e2e53858c9ef4d6ca3c593c.djcache
Binary file not shown.
Binary file added cache/da3803b55bc25abba8c2f0076880e40e.djcache
Binary file not shown.
Binary file added cache/dda1f6238648982cab0693e65bef269c.djcache
Binary file not shown.
Binary file added cache/ddfd42173fd34cce0c453b14d63ed3b3.djcache
Binary file not shown.
Binary file added cache/e09c875d7a8f04938c7a99389fa42b7d.djcache
Binary file not shown.
Binary file added cache/e7d4a4ed90e579bc7f9365aec416609b.djcache
Binary file not shown.
Binary file added cache/e91b5a102e3168ffc8c794fab449d792.djcache
Binary file not shown.
Binary file added cache/ec556dd8b2eff2fce9fbec01fa8aff4f.djcache
Binary file not shown.
Binary file added cache/f1374d8b8a5c7043685bed4adb8b20a4.djcache
Binary file not shown.
Binary file added cache/f1ff149f8b3be7bdeb91c6fac716e73e.djcache
Binary file not shown.
Binary file added cache/f2ee38cf3c0c2a3f653d4903e16d34f9.djcache
Binary file not shown.
Binary file added cache/f56200b62aeae75a68ea9af41d23ca5b.djcache
Binary file not shown.
Binary file added cache/fe58693876b28bcdd5c07568562a3481.djcache
Binary file not shown.
12 changes: 0 additions & 12 deletions config/crontab
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
#@reboot /usr/bin/finishsetup
0 4 * * 1 sudo apt-get update && sudo apt-get upgrade -y && sudo reboot
0 0 1 * * sudo certbot renew --quiet
#*/5 * * * * /home/team/lotteh/venv/bin/python /home/team/lotteh/routine_caption.py
#* * * * * /home/team/lotteh/venv/bin/python /home/team/lotteh/crypto_trading.py
#*/30 * * * * /home/team/lotteh/venv/bin/python /home/team/lotteh/process_recordings.py
#0 */12 * * * sh -c "sudo backup" team
#*/10 * * * * sudo systemctl start apache2
#*/10 * * * * sudo systemctl start daphne
#*/10 * * * * sudo systemctl start celery
0 * * * * sudo systemctl start clamav-daemon
#@reboot /usr/bin/finishsetup
0 4 * * 1 sudo apt-get update && sudo apt-get upgrade -y && sudo reboot
0 0 1 * * sudo certbot renew --quiet
#*/5 * * * * /home/team/lotteh/venv/bin/python /home/team/lotteh/routine_caption.py
Expand Down
Binary file modified contact/__pycache__/email.cpython-312.pyc
Binary file not shown.
4 changes: 2 additions & 2 deletions email_list.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
team,jasper.camber.holton@gmail.com
Daisy,jasper.camber.holton@gmail.com
abtest abtest,a13148467632@gmail.com
ZAnix,zin.bra@yandex.ru
ABitraky,uconquallkolesa@gmail.com
Expand Down Expand Up @@ -48,6 +46,8 @@ sexybeauty69,jamescook312@outlook.com
beautifulsweetheart54,mikexxxx@gmail.com
perfectwoman92,ebojajuje04@gmail.com
lovelybeast15,yasen.krasen.13+85607@mail.ru
Daisy,jasper.camber.holton@gmail.com
bustylover76,bagsikpogi4@gmail.com
Guest821841,duqotayowud23@gmail.com
gorgeousbeauty43,adinatanat@gmail.com
team,jasper.camber.holton@gmail.com
Binary file modified face/__pycache__/deep.cpython-312.pyc
Binary file not shown.
Binary file modified feed/__pycache__/align.cpython-312.pyc
Binary file not shown.
Binary file modified feed/__pycache__/apis.cpython-312.pyc
Binary file not shown.
Binary file modified feed/__pycache__/blur.cpython-312.pyc
Binary file not shown.
Binary file modified feed/__pycache__/logo.cpython-312.pyc
Binary file not shown.
Binary file modified feed/templatetags/__pycache__/app_filters.cpython-312.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion feed/templatetags/app_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,4 +797,4 @@ def cryptoformat(amount):

@register.filter('replspace')
def replspace(text):
return text.replace(' ', '+')
return str(text).replace(' ', '+')
Binary file modified live/__pycache__/show.cpython-312.pyc
Binary file not shown.
219 changes: 219 additions & 0 deletions log/commands.log

Large diffs are not rendered by default.

Binary file modified misc/__pycache__/sitemap.cpython-312.pyc
Binary file not shown.
Binary file modified payments/__pycache__/stripe.cpython-312.pyc
Binary file not shown.
Binary file modified retargeting/__pycache__/path.cpython-312.pyc
Binary file not shown.
106 changes: 106 additions & 0 deletions scripts/ijson.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
"""
Serialize data to/from JSON
"""

import datetime
import decimal
import json, ijson
import uuid

from django.core.serializers.base import DeserializationError
from django.core.serializers.python import Deserializer as PythonDeserializer
from django.core.serializers.python import Serializer as PythonSerializer
from django.utils.duration import duration_iso_string
from django.utils.functional import Promise
from django.utils.timezone import is_aware


class Serializer(PythonSerializer):
"""Convert a queryset to JSON."""

internal_use_only = False

def _init_options(self):
self._current = None
self.json_kwargs = self.options.copy()
self.json_kwargs.pop("stream", None)
self.json_kwargs.pop("fields", None)
if self.options.get("indent"):
# Prevent trailing spaces
self.json_kwargs["separators"] = (",", ": ")
self.json_kwargs.setdefault("cls", DjangoJSONEncoder)
self.json_kwargs.setdefault("ensure_ascii", False)

def start_serialization(self):
self._init_options()
self.stream.write("[")

def end_serialization(self):
if self.options.get("indent"):
self.stream.write("\n")
self.stream.write("]")
if self.options.get("indent"):
self.stream.write("\n")

def end_object(self, obj):
# self._current has the field data
indent = self.options.get("indent")
if not self.first:
self.stream.write(",")
if not indent:
self.stream.write(" ")
if indent:
self.stream.write("\n")
json.dump(self.get_dump_object(obj), self.stream, **self.json_kwargs)
self._current = None

def getvalue(self):
# Grandparent super
return super(PythonSerializer, self).getvalue()


def Deserializer(stream_or_string, **options):
"""Deserialize a stream or string of JSON data."""
if not isinstance(stream_or_string, (bytes, str)):
stream_or_string = stream_or_string.read()
if isinstance(stream_or_string, bytes):
stream_or_string = stream_or_string.decode()
try:
# with open('/home/team/lotteh/data/security.json', 'r') as f:
yield from PythonDeserializer(ijson.items(stream_or_string, 'item'), **options)
except (GeneratorExit, DeserializationError):
raise
except Exception as exc:
raise DeserializationError() from exc


class DjangoJSONEncoder(json.JSONEncoder):
"""
JSONEncoder subclass that knows how to encode date/time, decimal types, and
UUIDs.
"""

def default(self, o):
# See "Date Time String Format" in the ECMA-262 specification.
if isinstance(o, datetime.datetime):
r = o.isoformat()
if o.microsecond:
r = r[:23] + r[26:]
if r.endswith("+00:00"):
r = r.removesuffix("+00:00") + "Z"
return r
elif isinstance(o, datetime.date):
return o.isoformat()
elif isinstance(o, datetime.time):
if is_aware(o):
raise ValueError("JSON can't represent timezone-aware times.")
r = o.isoformat()
if o.microsecond:
r = r[:12]
return r
elif isinstance(o, datetime.timedelta):
return duration_iso_string(o)
elif isinstance(o, (decimal.Decimal, uuid.UUID, Promise)):
return str(o)
else:
return super().default(o)
14 changes: 7 additions & 7 deletions scripts/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import datetime
import decimal
import json
import json, ijson
import uuid

from django.core.serializers.base import DeserializationError
Expand Down Expand Up @@ -61,13 +61,13 @@ def getvalue(self):

def Deserializer(stream_or_string, **options):
"""Deserialize a stream or string of JSON data."""
if not isinstance(stream_or_string, (bytes, str)):
stream_or_string = stream_or_string.read()
if isinstance(stream_or_string, bytes):
stream_or_string = stream_or_string.decode()
# if not isinstance(stream_or_string, (bytes, str)):
# stream_or_string = stream_or_string.read()
# if isinstance(stream_or_string, bytes):
# stream_or_string = stream_or_string.decode()
try:
objects = json.loads(stream_or_string)
yield from PythonDeserializer(objects, **options)
with open('/home/team/lotteh/data/security.json', 'r') as f:
yield from PythonDeserializer(ijson.items(f, 'item'), **options)
except (GeneratorExit, DeserializationError):
raise
except Exception as exc:
Expand Down
7 changes: 5 additions & 2 deletions scripts/setup
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,9 @@ PYTHON_VERSION="3.12"
cp scripts/content.py /home/team/lotteh/venv/lib/python$PYTHON_VERSION/site-packages/pyxb/binding/content.py
cp scripts/pwa_webpush_forms.py /home/team/lotteh/venv/lib/python$PYTHON_VERSION/site-packages/pwa_webpush/forms.py
cp scripts/webauth_views.py /home/team/lotteh/venv/lib/python$PYTHON_VERSION/site-packages/webauth/views.py
cp scripts/serializers_json_lowmem.py venv/lib/python$PYTHON_VERSION/site-packages/
#cp scripts/json.py venv/lib/python$PYTHON_VERSION/site-packages/django/core/serializers/json.py
#cp scripts/serializers_json_lowmem.py venv/lib/python$PYTHON_VERSION/site-packages/django/core/serializers/json.py
cp venv/lib/python$PYTHON_VERSION/site-packages/django/core/serializers/json.py scripts/json.py
#cp scripts/serializers_json_lowmem.py venv/lib/python$PYTHON_VERSION/site-packages/django/core/serializers/json.py
cp scripts/nude.py venv/lib/python$PYTHON_VERSION/site-packages/nude.py
# Set user settings
sudo gpasswd -a www-data users
Expand Down Expand Up @@ -372,6 +373,8 @@ cat db.json.?? > db.json
echo "Loading data, this may take a while"
python manage.py loaddata db.json
./scripts/loadtables
# Fix venv again
cp scripts/serializers_json_lowmem.py venv/lib/python$PYTHON_VERSION/site-packages/django/core/serializers/json.py
sudo systemctl start apache2 daphne celery celerybeat
echo "Setup crontab/sudoers configuration"
sudo crontab -l -u root | cat - config/crontab | sudo crontab -u root -
Expand Down
36 changes: 23 additions & 13 deletions scripts/webauth_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def post(self, request, *args, **kwargs):
pub_key_credential = json.dumps(data.get("pubKeyCredential"))

verification = verify_registration_response(
credential=RegistrationCredential.parse_raw(pub_key_credential),
credential=pub_key_credential,
expected_challenge=challenge,
expected_origin=settings.WEBAUTH_ORIGIN,
expected_rp_id=settings.WEBAUTH_RP_ID,
Expand Down Expand Up @@ -124,6 +124,7 @@ def get(self, request, *args, **kwargs):
"usb",
"ble",
"nfc",
"internal",
],
}
for credential_id in credential_ids
Expand All @@ -136,18 +137,27 @@ def get(self, request, *args, **kwargs):
def post(self, request, *args, **kwargs):
challenge = bytes.fromhex(request.session.pop("webauth_challenge"))

credential = AuthenticationCredential.parse_raw(request.body.decode())
device = WebAuthDevice.objects.get(credential_id=credential.raw_id)

verification = verify_authentication_response(
credential=credential,
expected_challenge=challenge,
expected_rp_id=settings.WEBAUTH_RP_ID,
expected_origin=settings.WEBAUTH_ORIGIN,
credential_public_key=device.public_key,
credential_current_sign_count=device.sign_count,
require_user_verification=False,
)
credential = request.body.decode()
c = json.loads(credential)
print(json.dumps(c))
devices = WebAuthDevice.objects.filter(user=request.user)
#credential_id=c['rawId'].encode())
verification = None
for device in devices:
try:
verification = verify_authentication_response(
credential=credential,
expected_challenge=challenge,
expected_rp_id=settings.WEBAUTH_RP_ID,
expected_origin=settings.WEBAUTH_ORIGIN,
credential_public_key=device.public_key,
credential_current_sign_count=device.sign_count,
require_user_verification=False,
)
break
except:
pass
if not verification: raise Exception('No valid devices with this credential')

device.sign_count = verification.new_sign_count
device.save()
Expand Down
Binary file modified security/__pycache__/forms.cpython-312.pyc
Binary file not shown.
Binary file modified security/__pycache__/signing.cpython-312.pyc
Binary file not shown.
Binary file modified shell/__pycache__/consumers.cpython-312.pyc
Binary file not shown.
Binary file modified users/__pycache__/forms.cpython-312.pyc
Binary file not shown.
Binary file modified users/__pycache__/middleware.cpython-312.pyc
Binary file not shown.
Binary file modified users/__pycache__/oauth.cpython-312.pyc
Binary file not shown.
Binary file modified users/__pycache__/username_generator.cpython-312.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions users/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from django.shortcuts import get_object_or_404
from django.contrib import messages
from users.models import Profile
from security.models import SecurityProfile
from django.shortcuts import redirect
from django.urls import reverse
import urllib, json
Expand Down Expand Up @@ -84,6 +85,8 @@ def middleware(request):
if request.user.is_authenticated and (request.user.profile.enable_two_factor_authentication or request.user.profile.vendor) and not request.path.startswith('/accounts/tfa/') and not request.path.startswith('/accounts/logout/') and not request.path.startswith("/face/") and not request.path.startswith("/verify/"):
if not request.user.profile.phone_number or len(request.user.profile.phone_number) < 11:
return HttpResponseRedirect(reverse('users:tfa_onboarding'))
if not hasattr(request.user, 'profile'): Profile.objects.create(user=request.user)
if not hasattr(request.user, 'security_profile'): SecurityProfile.objects.create(user=request.user)
response = get_response(request)
if request.COOKIES.get('user_signup', False):
request.user_signup = True
Expand Down
Binary file modified verify/__pycache__/barcode.cpython-312.pyc
Binary file not shown.
Binary file modified verify/__pycache__/forensics.cpython-312.pyc
Binary file not shown.
Binary file modified verify/__pycache__/forms.cpython-312.pyc
Binary file not shown.
Binary file modified verify/__pycache__/idscan.cpython-312.pyc
Binary file not shown.
Binary file modified verify/__pycache__/ocr.cpython-312.pyc
Binary file not shown.
Binary file modified verify/__pycache__/process_barcode.cpython-312.pyc
Binary file not shown.
Binary file modified verify/__pycache__/validation.cpython-312.pyc
Binary file not shown.

0 comments on commit 1946fe4

Please sign in to comment.