forked from indymedia/epicyon
Tidying
parent
d0884fa04d
commit
12e9bca0c4
24
announce.py
24
announce.py
|
@ -195,7 +195,7 @@ def updateAnnounceCollection(recentPostsCache: {}, \
|
|||
pprint(postJsonObject)
|
||||
saveJson(postJsonObject,postFilename)
|
||||
|
||||
def announcedByPerson(postJsonObject: {}, nickname: str,domain: str) -> bool:
|
||||
def announcedByPerson(postJsonObject: {},nickname: str,domain: str) -> bool:
|
||||
"""Returns True if the given post is announced by the given person
|
||||
"""
|
||||
if not postJsonObject.get('object'):
|
||||
|
@ -212,9 +212,9 @@ def announcedByPerson(postJsonObject: {}, nickname: str,domain: str) -> bool:
|
|||
return False
|
||||
|
||||
def createAnnounce(session,baseDir: str,federationList: [], \
|
||||
nickname: str, domain: str, port: int, \
|
||||
toUrl: str, ccUrl: str, httpPrefix: str, \
|
||||
objectUrl: str, saveToFile: bool, \
|
||||
nickname: str,domain: str,port: int, \
|
||||
toUrl: str,ccUrl: str,httpPrefix: str, \
|
||||
objectUrl: str,saveToFile: bool, \
|
||||
clientToServer: bool, \
|
||||
sendThreads: [],postLog: [], \
|
||||
personCache: {},cachedWebfingers: {}, \
|
||||
|
@ -278,7 +278,7 @@ def createAnnounce(session,baseDir: str,federationList: [], \
|
|||
return newAnnounce
|
||||
|
||||
def announcePublic(session,baseDir: str,federationList: [], \
|
||||
nickname: str, domain: str, port: int, httpPrefix: str, \
|
||||
nickname: str,domain: str,port: int,httpPrefix: str, \
|
||||
objectUrl: str,clientToServer: bool, \
|
||||
sendThreads: [],postLog: [], \
|
||||
personCache: {},cachedWebfingers: {}, \
|
||||
|
@ -328,9 +328,9 @@ def repeatPost(session,baseDir: str,federationList: [], \
|
|||
debug,projectVersion)
|
||||
|
||||
def undoAnnounce(session,baseDir: str,federationList: [], \
|
||||
nickname: str, domain: str, port: int, \
|
||||
toUrl: str, ccUrl: str, httpPrefix: str, \
|
||||
objectUrl: str, saveToFile: bool, \
|
||||
nickname: str,domain: str,port: int, \
|
||||
toUrl: str,ccUrl: str,httpPrefix: str, \
|
||||
objectUrl: str,saveToFile: bool, \
|
||||
clientToServer: bool, \
|
||||
sendThreads: [],postLog: [], \
|
||||
personCache: {},cachedWebfingers: {}, \
|
||||
|
@ -390,7 +390,7 @@ def undoAnnounce(session,baseDir: str,federationList: [], \
|
|||
return newUndoAnnounce
|
||||
|
||||
def undoAnnouncePublic(session,baseDir: str,federationList: [], \
|
||||
nickname: str, domain: str, port: int, httpPrefix: str, \
|
||||
nickname: str,domain: str,port: int,httpPrefix: str, \
|
||||
objectUrl: str,clientToServer: bool, \
|
||||
sendThreads: [],postLog: [], \
|
||||
personCache: {},cachedWebfingers: {}, \
|
||||
|
@ -414,9 +414,9 @@ def undoAnnouncePublic(session,baseDir: str,federationList: [], \
|
|||
debug)
|
||||
|
||||
def undoRepeatPost(session,baseDir: str,federationList: [], \
|
||||
nickname: str, domain: str, port: int, httpPrefix: str, \
|
||||
announceNickname: str, announceDomain: str, \
|
||||
announcePort: int, announceHttpsPrefix: str, \
|
||||
nickname: str,domain: str,port: int,httpPrefix: str, \
|
||||
announceNickname: str,announceDomain: str, \
|
||||
announcePort: int,announceHttpsPrefix: str, \
|
||||
announceStatusNumber: int,clientToServer: bool, \
|
||||
sendThreads: [],postLog: [], \
|
||||
personCache: {},cachedWebfingers: {}, \
|
||||
|
|
10
auth.py
10
auth.py
|
@ -18,8 +18,8 @@ def hashPassword(password: str) -> str:
|
|||
"""
|
||||
salt=hashlib.sha256(os.urandom(60)).hexdigest().encode('ascii')
|
||||
pwdhash=hashlib.pbkdf2_hmac('sha512', \
|
||||
password.encode('utf-8'), \
|
||||
salt, 100000)
|
||||
password.encode('utf-8'), \
|
||||
salt, 100000)
|
||||
pwdhash=binascii.hexlify(pwdhash)
|
||||
return (salt+pwdhash).decode('ascii')
|
||||
|
||||
|
@ -29,9 +29,9 @@ def verifyPassword(storedPassword: str,providedPassword: str) -> bool:
|
|||
salt=storedPassword[:64]
|
||||
storedPassword=storedPassword[64:]
|
||||
pwdhash=hashlib.pbkdf2_hmac('sha512', \
|
||||
providedPassword.encode('utf-8'), \
|
||||
salt.encode('ascii'), \
|
||||
100000)
|
||||
providedPassword.encode('utf-8'), \
|
||||
salt.encode('ascii'), \
|
||||
100000)
|
||||
pwdhash=binascii.hexlify(pwdhash).decode('ascii')
|
||||
return pwdhash==storedPassword
|
||||
|
||||
|
|
|
@ -2217,7 +2217,7 @@ def addEmbeddedAudio(translate: {},content: str) -> str:
|
|||
w=w[:-1]
|
||||
if not w.endswith(extension):
|
||||
continue
|
||||
|
||||
|
||||
if not (w.startswith('http') or w.startswith('dat:') or \
|
||||
w.startswith('i2p:') or '/' in w):
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue