diff --git a/README.md b/README.md index 03ec0de5..98297240 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ -![Onionr logo](./docs/onionr-logo.png) +

-(***experimental, not well tested or easy to use yet***) + + +

+ +(***pre-alpha quality & experimental, not well tested or easy to use yet***) [![Open Source Love](https://badges.frapsoft.com/os/v3/open-source.png?v=103)](https://github.com/ellerbrock/open-source-badges/) @@ -9,19 +13,20 @@ Anonymous P2P platform, using Tor & I2P.
-**The main repo for this software is at https://gitlab.com/beardog/Onionr/** +**The main repository for this software is at https://gitlab.com/beardog/Onionr/** # Summary Onionr is a decentralized, peer-to-peer data storage network, designed to be anonymous and resistant to (meta)data analysis and spam. +Onionr stores data in independent packages referred to as 'blocks' (not to be confused with a blockchain). The blocks are synced to all other nodes in the network. Blocks and user IDs cannot be easily proven to have been created by particular nodes (only inferred). + +Users are identified by ed25519 public keys, which can be used to sign blocks (optional) or send encrypted data. + Onionr can be used for mail, as a social network, instant messenger, file sharing software, or for encrypted group discussion. -# Roadmap/features -Check the [Gitlab Project](https://gitlab.com/beardog/Onionr/milestones/1) to see progress towards the alpha release. - -## Core internal features +## Main Features * [X] Fully p2p/decentralized, no trackers or other single points of failure * [X] End to end encryption of user data @@ -29,14 +34,29 @@ Check the [Gitlab Project](https://gitlab.com/beardog/Onionr/milestones/1) to se * [X] Easy API system for integration to websites * [X] Metadata analysis resistance - -## Other features - **Onionr API and functionality is subject to non-backwards compatible change during pre-alpha development** +# Install and Run on Linux + +The following applies to Ubuntu Bionic. Other distros may have different package or command names. + +* Have python3.5+, python3-pip, Tor (daemon, not browser) installed (python3-dev recommended) +* Clone the git repo: `$ git clone https://gitlab.com/beardog/onionr` +* cd into install direction: `$ cd onionr/` +* Install the Python dependencies ([virtualenv strongly recommended](https://virtualenv.pypa.io/en/stable/userguide/)): `$ pip3 install -r requirements.txt` + ## Help out -Everyone is welcome to help out. Please get in touch first if you are making non-trivial changes. If you can't help with programming, you can write documentation or guides. +Everyone is welcome to help out. Help is wanted for the following: + +* Development (Get in touch first) + * Creation of a shared object library for use from other languages and faster proof-of-work + * Onionr mobile app development + * Windows and Mac support + * General development +* Testing +* Running stable nodes +* Security review/audit Bitcoin/Bitcoin Cash: 1onion55FXzm6h8KQw3zFw2igpHcV7LPq @@ -44,4 +64,4 @@ Bitcoin/Bitcoin Cash: 1onion55FXzm6h8KQw3zFw2igpHcV7LPq The Tor Project, I2P developers, and anyone else do not own, create, or endorse this project, and are not otherwise involved. -The badges (besides travis-ci build) are by Maik Ellerbrock is licensed under a Creative Commons Attribution 4.0 International License. +The badges (besides travis-ci build) are by Maik Ellerbrock is licensed under a Creative Commons Attribution 4.0 International License. \ No newline at end of file diff --git a/docs/Tor_Stinks_02.png b/docs/Tor_Stinks_02.png new file mode 100644 index 00000000..114a760c Binary files /dev/null and b/docs/Tor_Stinks_02.png differ diff --git a/onionr/api.py b/onionr/api.py index f5ba9c81..029da837 100755 --- a/onionr/api.py +++ b/onionr/api.py @@ -265,7 +265,7 @@ class API: self.bindPort = bindPort # Be extremely mindful of this - self.whitelistEndpoints = ('site', 'www', 'onionrhome', 'board', 'boardContent', 'sharedContent') + self.whitelistEndpoints = ('site', 'www', 'onionrhome', 'board', 'boardContent', 'sharedContent', 'mail', 'mailindex') self.clientToken = config.get('client.webpassword') self.timeBypassToken = base64.b16encode(os.urandom(32)).decode() @@ -308,6 +308,13 @@ class API: def loadBoard(): return send_from_directory('static-data/www/board/', "index.html") + @app.route('/mail/', endpoint='mail') + def loadMail(path): + return send_from_directory('static-data/www/mail/', '') + @app.route('/mail/', endpoint='mailindex') + def loadMailIndex(): + return send_from_directory('static-data/www/mail/', 'index.html') + @app.route('/board/', endpoint='boardContent') def boardContent(path): return send_from_directory('static-data/www/board/', path) @@ -407,7 +414,11 @@ class API: @app.route('/getstats') def getStats(): #return Response("disabled") - return Response(self._core.serializer.getStats()) + while True: + try: + return Response(self._core.serializer.getStats()) + except AttributeError: + pass @app.route('/getuptime') def showUptime(): diff --git a/onionr/config.py b/onionr/config.py index 0e1fd6a1..960286f6 100644 --- a/onionr/config.py +++ b/onionr/config.py @@ -105,7 +105,8 @@ def check(): open(get_config_file(), 'a', encoding="utf8").close() save() except: - logger.debug('Failed to check configuration file.') + pass + #logger.debug('Failed to check configuration file.') def save(): ''' @@ -129,7 +130,8 @@ def reload(): with open(get_config_file(), 'r', encoding="utf8") as configfile: set_config(json.loads(configfile.read())) except: - logger.debug('Failed to parse configuration file.') + pass + #logger.debug('Failed to parse configuration file.') def get_config(): ''' diff --git a/onionr/onionr.py b/onionr/onionr.py index 2733500a..e1c1c7f2 100755 --- a/onionr/onionr.py +++ b/onionr/onionr.py @@ -30,7 +30,7 @@ import webbrowser, uuid, signal from threading import Thread import api, core, config, logger, onionrplugins as plugins, onionrevents as events import onionrutils -import netcontroller +import netcontroller, onionrstorage from netcontroller import NetController from onionrblockapi import Block import onionrproofs, onionrexceptions, onionrusers, communicator @@ -190,6 +190,9 @@ class Onionr: 'openhome': self.openHome, 'open-home': self.openHome, + 'export-block': self.exportBlock, + 'exportblock': self.exportBlock, + 'get-file': self.getFile, 'getfile': self.getFile, @@ -271,6 +274,31 @@ class Onionr: THIS SECTION HANDLES THE COMMANDS ''' + def exportBlock(self): + exportDir = self.dataDir + 'block-export/' + try: + assert self.onionrUtils.validateHash(sys.argv[2]) + except (IndexError, AssertionError): + logger.error('No valid block hash specified.') + sys.exit(1) + else: + bHash = sys.argv[2] + try: + path = sys.argv[3] + except (IndexError): + if not os.path.exists(exportDir): + if os.path.exists(self.dataDir): + os.mkdir(exportDir) + else: + logger.error('Onionr not initialized') + sys.exit(1) + path = exportDir + data = onionrstorage.getData(self.onionrCore, bHash) + with open('%s/%s.dat' % (exportDir, bHash), 'wb') as exportFile: + exportFile.write(data) + + + def showDetails(self): details = { 'Node Address' : self.get_hostname(), diff --git a/onionr/static-data/www/mail/index.html b/onionr/static-data/www/mail/index.html new file mode 100644 index 00000000..73481922 --- /dev/null +++ b/onionr/static-data/www/mail/index.html @@ -0,0 +1,21 @@ + + + + + + Onionr Mail + + + + + +
+
+ + Onionr Web Mail +
+ +
+ + + \ No newline at end of file diff --git a/onionr/static-data/www/mail/mail.js b/onionr/static-data/www/mail/mail.js new file mode 100644 index 00000000..e69de29b diff --git a/onionr/storagecounter.py b/onionr/storagecounter.py index 863145f9..fc1a9d6b 100644 --- a/onionr/storagecounter.py +++ b/onionr/storagecounter.py @@ -42,6 +42,8 @@ class StorageCounter: retData = int(dataFile.read()) except FileNotFoundError: pass + except ValueError: + pass # Possibly happens when the file is empty return retData def getPercent(self):