forked from indymedia/epicyon
Reserved usernames
parent
fbaf144479
commit
e500d32b15
|
@ -147,7 +147,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
def do_GET(self):
|
def do_GET(self):
|
||||||
if self.server.debug:
|
if self.server.debug:
|
||||||
print('DEBUG: GET from '+self.server.baseDir+' path: '+self.path)
|
print('DEBUG: GET from '+self.server.baseDir+' path: '+self.path+' busy: '+str(self.server.GETbusy))
|
||||||
if self.server.GETbusy:
|
if self.server.GETbusy:
|
||||||
currTimeGET=int(time.time())
|
currTimeGET=int(time.time())
|
||||||
if currTimeGET-self.server.lastGET<10:
|
if currTimeGET-self.server.lastGET<10:
|
||||||
|
@ -159,8 +159,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.lastGET=currTimeGET
|
self.server.lastGET=currTimeGET
|
||||||
self.server.GETbusy=True
|
self.server.GETbusy=True
|
||||||
|
|
||||||
if self.server.debug:
|
|
||||||
print('DEBUG: GET _permittedDir')
|
|
||||||
if not self._permittedDir(self.path):
|
if not self._permittedDir(self.path):
|
||||||
if self.server.debug:
|
if self.server.debug:
|
||||||
print('DEBUG: GET Not permitted')
|
print('DEBUG: GET Not permitted')
|
||||||
|
@ -258,6 +256,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._set_headers('application/json')
|
self._set_headers('application/json')
|
||||||
|
|
||||||
def do_POST(self):
|
def do_POST(self):
|
||||||
|
if self.server.debug:
|
||||||
|
print('DEBUG: POST to from '+self.server.baseDir+' path: '+self.path+' busy: '+str(self.server.POSTbusy))
|
||||||
if self.server.POSTbusy:
|
if self.server.POSTbusy:
|
||||||
currTimePOST=int(time.time())
|
currTimePOST=int(time.time())
|
||||||
if currTimePOST-self.server.lastPOST<10:
|
if currTimePOST-self.server.lastPOST<10:
|
||||||
|
|
1
inbox.py
1
inbox.py
|
@ -141,7 +141,6 @@ def runInboxQueue(baseDir: str,httpPrefix: str,personCache: {},queue: [],domain:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
pubKey=getPersonPubKey(session,keyId,personCache,debug)
|
pubKey=getPersonPubKey(session,keyId,personCache,debug)
|
||||||
print('********* pubkey7825 '+str(pubKey))
|
|
||||||
if pubKey:
|
if pubKey:
|
||||||
print('DEBUG: public key: '+str(pubKey))
|
print('DEBUG: public key: '+str(pubKey))
|
||||||
break
|
break
|
||||||
|
|
|
@ -26,6 +26,9 @@ def createPerson(baseDir: str,nickname: str,domain: str,port: int, \
|
||||||
httpPrefix: str, saveToFile: bool,password=None) -> (str,str,{},{}):
|
httpPrefix: str, saveToFile: bool,password=None) -> (str,str,{},{}):
|
||||||
"""Returns the private key, public key, actor and webfinger endpoint
|
"""Returns the private key, public key, actor and webfinger endpoint
|
||||||
"""
|
"""
|
||||||
|
reservedNames=['inbox','outbox','followers','following','sharedInbox','publicKey']
|
||||||
|
if nickname in reservedNames:
|
||||||
|
return None,None,None,None
|
||||||
privateKeyPem,publicKeyPem=generateRSAKey()
|
privateKeyPem,publicKeyPem=generateRSAKey()
|
||||||
webfingerEndpoint= \
|
webfingerEndpoint= \
|
||||||
createWebfingerEndpoint(nickname,domain,port,httpPrefix,publicKeyPem)
|
createWebfingerEndpoint(nickname,domain,port,httpPrefix,publicKeyPem)
|
||||||
|
|
Loading…
Reference in New Issue