work on runtime tests and onboarding

master
Kevin Froman 2019-10-07 00:51:30 -05:00
parent dbb306d7ee
commit c22f084315
6 changed files with 259 additions and 6 deletions

7
TODO.txt Normal file
View File

@ -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

View File

@ -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

View File

@ -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):

View File

@ -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

View File

@ -0,0 +1,233 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<!--Mobile responsive-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>
Onionr
</title>
<link rel='shortcut icon' type='image/ico' href='/shared/images/favicon.ico'>
<link rel="stylesheet" href="/private/main.css">
<link rel="stylesheet" href="/shared/fontawesome-free-5.10.2/css/all.min.css">
<link rel="stylesheet" href="/gettheme">
<script defer src='/shared/navbar.js'></script>
<script defer src='/shared/loadabout.js'></script>
<script defer src='/shared/misc.js'></script>
<script defer src='/shared/main/stats.js'></script>
<script defer src='/shared/panel.js'></script>
<script defer src='/shared/configeditor.js'></script>
<script defer src='/shared/sites.js'></script>
<script defer src='/private/js/console.js'></script>
<script>alert("Content security policy appears to not be working. Your browser security is weak!")</script>
</head>
<body>
<div id="shutdownNotice" class='overlay'>
<div>
<p>Your node will shutdown. Thank you for using Onionr.</p>
</div>
</div>
<nav class="navbar is-dark" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<a class="navbar-item idLink" href="/">
<img src="/shared/images/favicon.ico" class='navbarLogo'> Onionr
</a>
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false"
data-target="navbarBasicExample">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
<div id="navbarBasicExample" class="navbar-menu">
<div class="navbar-start">
<a class="navbar-item idLink" href="/">Home</a>
<a class="navbar-item idLink" href="/mail/">Mail</a>
<a class="navbar-item idLink" href="/friends/">Friends</a>
<a class="navbar-item idLink" href="/board/">Circles</a>
<a class="navbar-item idLink" href="/chat/">Chat</a>
</div>
<div class="navbar-end">
<a class="navbar-item idLink aboutLink">About</a>
</div>
</div>
</nav>
<!--Hero (Dark Bar)-->
<section class="hero is-small is-dark">
<div class="hero-body">
<div class="container">
<div class="columns">
<div class="column">
<h1 class="title">
Onionr
</h1>
<h2 class="subtitle">
Private Decentralized Communication
</h2>
</div>
<div class="column is-7">
<div class="field">
<div class="field has-addons">
<p class="control">
<a class="button is-static">Identity</a>
</p>
<p class="control is-expanded">
<input id="myPub" class="input myPub" type="text" readonly>
</p>
<p class="control">
<a id="myPubCopy" class="button is-primary">
<span class="icon">
<i class="fas fa-copy"></i>
</span>
</a>
</p>
</div>
</div>
<div class="field is-grouped is-grouped-centered">
<p class="control">
<a class="button is-danger is-outlined" id='shutdownNode'>
Shutdown
</a>
</p>
<p class="control">
<a class="button is-warning is-outlined" id='restartNode'>
Restart
</a>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<br>
<!--Start of content-->
<div class="container">
<div class="columns">
<div class="column">
<!--Onionr Card-->
<div class="card">
<header class="card-header">
<p class="card-header-title">
Onionr Sites
</p>
</header>
<div class="card-content">
<div class="content">
<div class="field">
<label class="label">Open Site</label>
<div class="field has-addons">
<p class="control is-expanded">
<input class="input" type="text" id='siteViewer' placeholder="Site Hash">
</p>
<p class="control">
<a id='openSite' class="button is-info">Open Onionr Site</a>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="column">
<!--Statistics Card-->
<div class="card">
<header class="card-header">
<p class="card-header-title">
Statistics
</p>
<div class="field">
<div class="is-pulled-right">
<a class="button is-link" id='refreshStats'>
Refresh Stats
</a>
</div>
</div>
</header>
<div class="card-content">
<div class="content">
<div class="columns">
<div class="column">
<span class="icon">
<i class="fas fa-lock"></i>
</span>
Security level: <span id='securityLevel'></span>
</div>
<div class="column">
<i class="fas fa-clock"></i>
Uptime: <span id='uptime'></span>
</div>
</div>
<h6>Session Connections</h6>
<div class="columns">
<div class="column">
Last Received: <span id='lastIncoming'>None since start</span>
</div>
<div class="column">
<i class="fas fa-arrow-down"></i>
Total Requests: <span id='totalRec'>None since start</span>
</div>
</div>
<i class="fas fa-link"></i>
Outgoing Connections:
<div class="control">
<pre id='connectedNodes' class="textarea" rows="5" readonly>Unable to get nodes</pre>
</div>
<br>
<h6>Blocks</h6>
<div class="columns">
<div class="column">
<i class="fas fa-hdd"></i>
Stored Blocks: <span id='storedBlocks'></span>
</div>
<div class="column">
<i class="fas fa-mail-bulk"></i>
Blocks in queue: <span id='blockQueue'></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--Configuration Card-->
<div class="card">
<header class="card-header" id="configToggle">
<p class="card-header-title">
<a class="button is-white">Edit Configuration</a>
</p>
</header>
<div class="card-content" id="configContent">
<div class="content">
<p><em>Warning: </em><b>Some values can be dangerous to change. Use caution.</b></p>
<textarea class='textarea configEditor' rows="20"></textarea>
<a class="button is-primary saveConfig">Save Config</a>
</div>
</div>
</div>
</div>
<br>
<div class="modal aboutModal">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<button class="closeAboutModal delete" aria-label="close"></button>
</header>
<section class="modal-card-body aboutBody">
Loading... <i class="fas fa-spinner fa-spin"></i>
</section>
</div>
</div>
</body>
</html>

View File

@ -207,7 +207,7 @@
<div class="card">
<header class="card-header" id="configToggle">
<p class="card-header-title">
<a class="button is-white is-fullwidth">Edit Configuration</a>
<a class="button is-white">Edit Configuration</a>
</p>
</header>
<div class="card-content" id="configContent">