From c22f084315396c1b91f459ee44b34a4c7fd4bf19 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Mon, 7 Oct 2019 00:51:30 -0500 Subject: [PATCH] work on runtime tests and onboarding --- TODO.txt | 7 + onionr/onionrblocks/insert.py | 6 +- onionr/runtests/__init__.py | 4 +- onionr/runtests/inserttest.py | 13 ++ static-data/www/onboarding/index.html | 233 ++++++++++++++++++++++++++ static-data/www/private/index.html | 2 +- 6 files changed, 259 insertions(+), 6 deletions(-) create mode 100644 TODO.txt create mode 100644 onionr/runtests/inserttest.py create mode 100644 static-data/www/onboarding/index.html diff --git a/TODO.txt b/TODO.txt new file mode 100644 index 00000000..d003ce96 --- /dev/null +++ b/TODO.txt @@ -0,0 +1,7 @@ +* Remove nav bar links for disabled plugins +* add GUI config editor +* add multi-device forward secrecy +* document anonymity & security theory +* document usage +* encrypt local data and keys +* ensure accessibility for Onionr web UI diff --git a/onionr/onionrblocks/insert.py b/onionr/onionrblocks/insert.py index bfda0c34..4416291d 100644 --- a/onionr/onionrblocks/insert.py +++ b/onionr/onionrblocks/insert.py @@ -45,9 +45,9 @@ def insert_block(data: Union[str, bytes], header: str ='txt', with open(filepaths.data_nonce_file, 'a') as nonceFile: nonceFile.write(dataNonce + '\n') - if type(data) is bytes: - data = data.decode() - data = str(data) + #if type(data) is bytes: + # data = data.decode() + #data = str(data) plaintext = data plaintextMeta = {} plaintextPeer = asymPeer diff --git a/onionr/runtests/__init__.py b/onionr/runtests/__init__.py index f98cfcb7..8c47eab3 100644 --- a/onionr/runtests/__init__.py +++ b/onionr/runtests/__init__.py @@ -20,9 +20,9 @@ import logger from onionrutils import epoch -from . import uicheck +from . import uicheck, inserttest -RUN_TESTS = [uicheck.check_ui] +RUN_TESTS = [uicheck.check_ui, inserttest.insert_bin_test] class OnionrRunTestManager: def __init__(self): diff --git a/onionr/runtests/inserttest.py b/onionr/runtests/inserttest.py new file mode 100644 index 00000000..5d67bca3 --- /dev/null +++ b/onionr/runtests/inserttest.py @@ -0,0 +1,13 @@ +import os + +import onionrblocks +import logger +import coredb + +def insert_bin_test(testmanager): + data = os.urandom(32) + b_hash = onionrblocks.insert(data, ) + + if not b_hash in coredb.blockmetadb.get_block_list(): + logger.error(str(b_hash) + 'is not in bl') + raise ValueError \ No newline at end of file diff --git a/static-data/www/onboarding/index.html b/static-data/www/onboarding/index.html new file mode 100644 index 00000000..2d643ae1 --- /dev/null +++ b/static-data/www/onboarding/index.html @@ -0,0 +1,233 @@ + + + + + + + + + Onionr + + + + + + + + + + + + + + + + + +
+
+

Your node will shutdown. Thank you for using Onionr.

+
+
+ + + + +
+
+
+
+
+

+ Onionr +

+

+ Private Decentralized Communication +

+
+
+
+
+

+ Identity +

+

+ +

+

+ + + + + +

+
+
+ +
+
+
+
+ +
+ +
+ + +
+
+
+ +
+
+

+ Onionr Sites +

+
+
+
+
+ +
+

+ +

+

+ Open Onionr Site +

+
+
+
+
+
+
+
+ +
+
+

+ Statistics +

+ +
+
+
+
+
+ + + + Security level: +
+
+ + Uptime: +
+
+
Session Connections
+
+
+ ️ Last Received: None since start +
+
+ + Total Requests: None since start +
+
+ + Outgoing Connections: +
+
Unable to get nodes
+
+
+
Blocks
+
+
+ + Stored Blocks: +
+
+ + Blocks in queue: +
+
+
+
+
+
+
+ + +
+
+

+ Edit Configuration +

+
+
+
+

Warning: Some values can be dangerous to change. Use caution.

+ + Save Config +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/static-data/www/private/index.html b/static-data/www/private/index.html index 0efc2129..88f66ef8 100755 --- a/static-data/www/private/index.html +++ b/static-data/www/private/index.html @@ -207,7 +207,7 @@

- Edit Configuration + Edit Configuration