mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
b02ddbaed0
commit
db64ceb87d
1
auth.py
1
auth.py
|
@ -10,7 +10,6 @@ import base64
|
||||||
import hashlib
|
import hashlib
|
||||||
import binascii
|
import binascii
|
||||||
import os
|
import os
|
||||||
import random
|
|
||||||
import secrets
|
import secrets
|
||||||
|
|
||||||
|
|
||||||
|
|
10
person.py
10
person.py
|
@ -153,16 +153,14 @@ def randomizeActorImages(personJson: {}) -> None:
|
||||||
existingExtension = lastPartOfFilename.split('.')[1]
|
existingExtension = lastPartOfFilename.split('.')[1]
|
||||||
# NOTE: these files don't need to have cryptographically
|
# NOTE: these files don't need to have cryptographically
|
||||||
# secure names
|
# secure names
|
||||||
|
randStr = str(randint(10000000000000, 99999999999999)) # nosec
|
||||||
personJson['icon']['url'] = \
|
personJson['icon']['url'] = \
|
||||||
personId + '/avatar' + \
|
personId + '/avatar' + randStr + '.' + existingExtension
|
||||||
str(randint(10000000000000, 99999999999999)) + \ # nosec
|
|
||||||
'.' + existingExtension
|
|
||||||
lastPartOfFilename = personJson['image']['url'].split('/')[-1]
|
lastPartOfFilename = personJson['image']['url'].split('/')[-1]
|
||||||
existingExtension = lastPartOfFilename.split('.')[1]
|
existingExtension = lastPartOfFilename.split('.')[1]
|
||||||
|
randStr = str(randint(10000000000000, 99999999999999)) # nosec
|
||||||
personJson['image']['url'] = \
|
personJson['image']['url'] = \
|
||||||
personId + '/image' + \
|
personId + '/image' + randStr + '.' + existingExtension
|
||||||
str(randint(10000000000000, 99999999999999)) + \ # nosec
|
|
||||||
'.' + existingExtension
|
|
||||||
|
|
||||||
|
|
||||||
def createPersonBase(baseDir: str, nickname: str, domain: str, port: int,
|
def createPersonBase(baseDir: str, nickname: str, domain: str, port: int,
|
||||||
|
|
3
utils.py
3
utils.py
|
@ -1099,8 +1099,7 @@ def siteIsActive(url: str) -> bool:
|
||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
req = urllib.request.Request(url)
|
req = urllib.request.Request(url)
|
||||||
with urllib.request.urlopen(req, timeout=10) as res: # nosec
|
urllib.request.urlopen(req, timeout=10) # nosec
|
||||||
# testStr = response.read()
|
|
||||||
return True
|
return True
|
||||||
except SocketError as e:
|
except SocketError as e:
|
||||||
if e.errno == errno.ECONNRESET:
|
if e.errno == errno.ECONNRESET:
|
||||||
|
|
Loading…
Reference in New Issue