diff --git a/docs/network-comparison.png b/docs/network-comparison.png new file mode 100644 index 00000000..0d1f42e6 Binary files /dev/null and b/docs/network-comparison.png differ diff --git a/docs/whitepaper.md b/docs/whitepaper.md index 29f23bed..8428b8a6 100755 --- a/docs/whitepaper.md +++ b/docs/whitepaper.md @@ -132,3 +132,13 @@ We seek to protect the following information: We assume that Tor onion services (v3) and I2P services cannot be trivially deanonymized, and that the underlying cryptographic primitives we employ cannot be broken in any manner faster than brute force unless a quantum computer is used. Once quantum safe algorithms are more mature and have decent high level libraries, they will be deployed. + +# Comparisons to other P2P software + +Since Onionr is far from the first to implement many of these ideas (on their own), this section compares Onionr to other networks + +![network comparison image](network-comparison.png) + +# Conclusion + +If successful, Onionr will be a complete decentralized platform for anonymous computing, complete with limited metadata exposure, both node and user anonymity, and spam prevention \ No newline at end of file diff --git a/onionr/communicator.py b/onionr/communicator.py index 14817a07..c2528cef 100755 --- a/onionr/communicator.py +++ b/onionr/communicator.py @@ -488,7 +488,7 @@ class OnionrCommunicatorDaemon: score = str(self.getPeerProfileInstance(i).score) logger.info(i + ', score: ' + score) - def peerAction(self, peer, action, data=''): + def peerAction(self, peer, action, data='', returnHeaders=False): '''Perform a get request to a peer''' if len(peer) == 0: return False @@ -512,7 +512,7 @@ class OnionrCommunicatorDaemon: else: self._core.setAddressInfo(peer, 'lastConnect', self._core._utils.getEpoch()) self.getPeerProfileInstance(peer).addScore(1) - return retData + return retData # If returnHeaders, returns tuple of data, headers. if not, just data string def getPeerProfileInstance(self, peer): '''Gets a peer profile instance from the list of profiles, by address name''' diff --git a/onionr/onionrutils.py b/onionr/onionrutils.py index f3d47b73..e76ebc37 100755 --- a/onionr/onionrutils.py +++ b/onionr/onionrutils.py @@ -480,7 +480,7 @@ class OnionrUtils: retData = False return retData - def doGetRequest(self, url, port=0, proxyType='tor', ignoreAPI=False): + def doGetRequest(self, url, port=0, proxyType='tor', ignoreAPI=False, returnHeaders=False): ''' Do a get request through a local tor or i2p instance ''' @@ -520,7 +520,10 @@ class OnionrUtils: if not 'ConnectTimeoutError' in str(e) and not 'Request rejected or failed' in str(e): logger.debug('Error: %s' % str(e)) retData = False - return retData + if returnHeaders: + return (retData, response_headers) + else: + return retData def strToBytes(self, data): try: diff --git a/onionr/static-data/default-plugins/pms/mailapi.py b/onionr/static-data/default-plugins/pms/mailapi.py index c8966112..87cdb678 100644 --- a/onionr/static-data/default-plugins/pms/mailapi.py +++ b/onionr/static-data/default-plugins/pms/mailapi.py @@ -28,6 +28,10 @@ flask_blueprint = Blueprint('mail', __name__) c = core.Core() kv = c.keyStore +@flask_blueprint.route('/mail/ping') +def mail_ping(): + return 'pong!' + @flask_blueprint.route('/mail/deletemsg/', methods=['POST']) def mail_delete(block): if not c._utils.validateHash(block): diff --git a/onionr/static-data/www/mail/index.html b/onionr/static-data/www/mail/index.html index 16b95db9..8af6f035 100755 --- a/onionr/static-data/www/mail/index.html +++ b/onionr/static-data/www/mail/index.html @@ -18,6 +18,9 @@ Onionr Mail ✉️

Home
+
+ API server either shutdown, has disabled mail, or has experienced a bug. +

Current Used Identity:


diff --git a/onionr/static-data/www/mail/mail.css b/onionr/static-data/www/mail/mail.css index 0334de30..af80deb1 100755 --- a/onionr/static-data/www/mail/mail.css +++ b/onionr/static-data/www/mail/mail.css @@ -53,6 +53,11 @@ input{ margin: 1em; } + .mailPing{ + display: none; + color: orange; + } + .danger{ color: red; } diff --git a/onionr/static-data/www/mail/mail.js b/onionr/static-data/www/mail/mail.js index 57c5fa40..24a74602 100755 --- a/onionr/static-data/www/mail/mail.js +++ b/onionr/static-data/www/mail/mail.js @@ -94,6 +94,27 @@ function deleteMessage(bHash){ }) } +function mailPing(){ + fetch('/mail/ping', { + "method": "get", + headers: { + "token": webpass + }}) + .then(function(resp) { + var pings = document.getElementsByClassName('mailPing') + if (resp.ok){ + for (var i=0; i < pings.length; i++){ + pings[i].style.display = 'none'; + } + } + else{ + for (var i=0; i < pings.length; i++){ + pings[i].style.display = 'block'; + } + } + }) +} + function loadInboxEntries(bHash){ fetch('/getblockheader/' + bHash, { headers: { @@ -201,12 +222,16 @@ function getSentbox(){ var toLabel = document.createElement('span') toLabel.innerText = 'To: ' var toEl = document.createElement('input') + var sentDate = document.createElement('span') + var humanDate = new Date(0) + humanDate.setUTCSeconds(resp[i]['date']) var preview = document.createElement('span') var deleteBtn = document.createElement('button') var message = resp[i]['message'] deleteBtn.classList.add('deleteBtn', 'dangerBtn') deleteBtn.innerText = 'X' toEl.readOnly = true + sentDate.innerText = humanDate if (resp[i]['name'] == null){ toEl.value = resp[i]['peer'] } @@ -219,6 +244,7 @@ function getSentbox(){ entry.appendChild(toLabel) entry.appendChild(toEl) entry.appendChild(preview) + entry.appendChild(sentDate) entry.onclick = (function(tree, el, msg) {return function() { console.log(resp) if (! entry.classList.contains('deleteBtn')){ @@ -315,4 +341,7 @@ fetch('/friends/list', { //alert(resp[keys[i]]['name']) } }) -setActiveTab('inbox') \ No newline at end of file +setActiveTab('inbox') + +setInterval(function(){mailPing()}, 10000) +mailPing() \ No newline at end of file diff --git a/onionr/static-data/www/private/index.html b/onionr/static-data/www/private/index.html index 8d5d5861..8d35f070 100755 --- a/onionr/static-data/www/private/index.html +++ b/onionr/static-data/www/private/index.html @@ -20,6 +20,9 @@ Onionr Web Control Panel

+

+ +


Mail - Friend Manager

Stats

Uptime:

@@ -32,5 +35,6 @@ + \ No newline at end of file diff --git a/onionr/static-data/www/shared/main/style.css b/onionr/static-data/www/shared/main/style.css index ae4d87db..8ac6c459 100755 --- a/onionr/static-data/www/shared/main/style.css +++ b/onionr/static-data/www/shared/main/style.css @@ -172,4 +172,10 @@ body{ .primaryBtn{ background-color:#396BAC; +} + +.openSiteBtn{ + padding: 5px; + border: 1px solid black; + border-radius: 5px; } \ No newline at end of file