work on adding peers, updated readme
This commit is contained in:
parent
0c6d1ed790
commit
084b2425e9
4
api.py
4
api.py
@ -42,6 +42,7 @@ class API:
|
||||
bindPort = int(self.config['CLIENT']['PORT'])
|
||||
self.bindPort = bindPort
|
||||
self.clientToken = self.config['CLIENT']['CLIENT HMAC']
|
||||
print(self.clientToken)
|
||||
|
||||
if not debug:
|
||||
hostNums = [random.randint(1, 255), random.randint(1, 255), random.randint(1, 255)]
|
||||
@ -99,6 +100,7 @@ class API:
|
||||
requestingPeer = request.args.get('myID')
|
||||
|
||||
if action == 'firstConnect':
|
||||
|
||||
pass
|
||||
|
||||
@app.errorhandler(404)
|
||||
@ -130,7 +132,7 @@ class API:
|
||||
if not request.host.endswith('onion') and not request.hosst.endswith('i2p'):
|
||||
abort(403)
|
||||
# Validate x-requested-with, to protect against CSRF/metadata leaks
|
||||
if self._developmentMode:
|
||||
if not self._developmentMode:
|
||||
try:
|
||||
request.headers['x-requested-with']
|
||||
except:
|
||||
|
@ -19,5 +19,15 @@ import core
|
||||
class OnionrCommunicate:
|
||||
def __init__(self):
|
||||
return
|
||||
def getKey(self, peerID):
|
||||
'''This function contacts a peer and gets their main PGP key.
|
||||
This is safe because Tor or I2P is used, but it does not insure that the person is who they say they are
|
||||
'''
|
||||
url = 'http://' + peerID + '/public/?action=getPGP'
|
||||
r = requests.get(url, headers=headers)
|
||||
response = r.text
|
||||
return response
|
||||
|
||||
|
||||
|
||||
OnionrCommunicate()
|
@ -2,8 +2,11 @@
|
||||
|
||||
P2P microblogging platform and social network, using Tor & I2P.
|
||||
|
||||
Major work in progress. *NOT USABLE OR SAFE YET*
|
||||
Major work in progress.
|
||||
|
||||
***THIS SOFTWARE IS NOT USABLE OR SAFE YET.***
|
||||
|
||||
|
||||
# Development
|
||||
|
||||
This software is in heavy development. If for some reason you want to get involved, get in touch first.
|
||||
|
Loading…
Reference in New Issue
Block a user