added motd, todo.txt, and small bug fixes

master
Kevin Froman 2019-10-08 16:14:30 -05:00
parent 695f334297
commit c4c4fb70d5
14 changed files with 106 additions and 199 deletions

View File

@ -5,3 +5,7 @@
* document usage * document usage
* encrypt local data and keys * encrypt local data and keys
* ensure accessibility for Onionr web UI * ensure accessibility for Onionr web UI
* make forward secrecy compatible with multiple devices
* make uptime timer be human meaningful
* add confirm for shutdown/restart
* add way to mark key as dead

View File

@ -80,7 +80,7 @@ systemctl start onionr
# pretty header thing # pretty header thing
"$EXECUTABLE" --header 'Onionr successfully installed.' "$EXECUTABLE" details
# and we're good! # and we're good!

View File

@ -30,6 +30,14 @@ static_files_bp = Blueprint('staticfiles', __name__)
root = os.path.dirname(os.path.realpath(__file__)) + '/../../../static-data/www/' # should be set to onionr install directory from onionr startup root = os.path.dirname(os.path.realpath(__file__)) + '/../../../static-data/www/' # should be set to onionr install directory from onionr startup
@static_files_bp.route('/onboarding/', endpoint='onboardingIndex')
def onboard():
return send_from_directory(f'{root}onboarding/', "index.html")
@static_files_bp.route('/onboarding/<path:path>', endpoint='onboarding')
def onboard_files(path):
return send_from_directory(f'{root}onboarding/', path)
@static_files_bp.route('/chat/', endpoint='chatIndex') @static_files_bp.route('/chat/', endpoint='chatIndex')
def chat_index(): def chat_index():
return send_from_directory(root + 'chat/', "index.html") return send_from_directory(root + 'chat/', "index.html")

View File

@ -24,7 +24,8 @@ from . import pluginwhitelist
# Be extremely mindful of this. These are endpoints available without a password # Be extremely mindful of this. These are endpoints available without a password
whitelist_endpoints = ['www', 'staticfiles.homedata', 'staticfiles.sharedContent', whitelist_endpoints = ['www', 'staticfiles.homedata', 'staticfiles.sharedContent',
'staticfiles.friends', 'staticfiles.friendsindex', 'siteapi.site', 'staticfiles.onionrhome', 'themes.getTheme'] 'staticfiles.friends', 'staticfiles.friendsindex', 'siteapi.site', 'staticfiles.onionrhome',
'themes.getTheme', 'staticfiles.onboarding', 'staticfiles.onboardingIndex']
class ClientAPISecurity: class ClientAPISecurity:
def __init__(self, client_api): def __init__(self, client_api):

View File

@ -36,8 +36,7 @@
"verbosity": "default", "verbosity": "default",
"file": { "file": {
"output": true, "output": true
"path": "output.log"
}, },
"console": { "console": {
@ -53,12 +52,6 @@
"bridge_fingerprint": "" "bridge_fingerprint": ""
}, },
"i2p": {
"host": false,
"connect": true,
"own_addr": ""
},
"allocations": { "allocations": {
"disk": 100000000, "disk": 100000000,
"net_total": 1000000000, "net_total": 1000000000,

View File

@ -48,7 +48,6 @@
<a class="navbar-item idLink" href="/mail/">Mail</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="/friends/">Friends</a>
<a class="navbar-item idLink" href="/board/">Circles</a> <a class="navbar-item idLink" href="/board/">Circles</a>
<a class="navbar-item idLink" href="/chat/">Chat</a>
</div> </div>
</div> </div>
</nav> </nav>

View File

@ -40,7 +40,6 @@
<a class="navbar-item idLink" href="/mail/">Mail</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="/friends/">Friends</a>
<a class="navbar-item idLink" href="/board/">Circles</a> <a class="navbar-item idLink" href="/board/">Circles</a>
<a class="navbar-item idLink" href="/chat/">Chat</a>
</div> </div>
</div> </div>
</nav> </nav>

View File

@ -43,7 +43,6 @@
<a class="navbar-item idLink" href="/mail/">Mail</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="/friends/">Friends</a>
<a class="navbar-item idLink" href="/board/">Circles</a> <a class="navbar-item idLink" href="/board/">Circles</a>
<a class="navbar-item idLink" href="/chat/">Chat</a>
</div> </div>
</div> </div>
</nav> </nav>

View File

@ -12,6 +12,7 @@
<link rel="stylesheet" href="/private/main.css"> <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="/shared/fontawesome-free-5.10.2/css/all.min.css">
<link rel="stylesheet" href="/gettheme"> <link rel="stylesheet" href="/gettheme">
<link rel="stylesheet" href="onboarding.css">
<script defer src='/shared/navbar.js'></script> <script defer src='/shared/navbar.js'></script>
<script defer src='/shared/loadabout.js'></script> <script defer src='/shared/loadabout.js'></script>
<script defer src='/shared/misc.js'></script> <script defer src='/shared/misc.js'></script>
@ -20,6 +21,7 @@
<script defer src='/shared/configeditor.js'></script> <script defer src='/shared/configeditor.js'></script>
<script defer src='/shared/sites.js'></script> <script defer src='/shared/sites.js'></script>
<script defer src='/private/js/console.js'></script> <script defer src='/private/js/console.js'></script>
<script defer src='onboarding.js'></script>
<script>alert("Content security policy appears to not be working. Your browser security is weak!")</script> <script>alert("Content security policy appears to not be working. Your browser security is weak!")</script>
</head> </head>
@ -30,34 +32,6 @@
</div> </div>
</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)--> <!--Hero (Dark Bar)-->
<section class="hero is-small is-dark"> <section class="hero is-small is-dark">
<div class="hero-body"> <div class="hero-body">
@ -72,24 +46,7 @@
</h2> </h2>
</div> </div>
<div class="column is-7"> <div class="column is-7">
<div class="field"> <div class="field is-grouped is-pulled-right">
<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"> <p class="control">
<a class="button is-danger is-outlined" id='shutdownNode'> <a class="button is-danger is-outlined" id='shutdownNode'>
Shutdown Shutdown
@ -110,124 +67,43 @@
<br> <br>
<!--Start of content--> <div class="onboarding">
<div class="container"> <p>Welcome. There are just a few questions for you to answer before you get started.</p>
<div class="columns"> <br>
<div class="column"> <form method='post'>
<!--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"> <div class="field">
<label class="label">Open Site</label> <div>
<div class="field has-addons"> I am worried about the following targeting me...
<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> <i class="icon fas fa-laptop-code"></i> <input type="checkbox" name="hackers"> <label for="state"> Cyber criminals</label>
</div> <br>
</div> <i class="icon fas fa-eye"></i> <input type="checkbox" name="state"> <label for="state">Government (mass surveillance)</label>
</div> <br>
</div> <i class="icon fas fa-university"></i> <input type="checkbox" name="stateTarget"> <label for="stateTarget">Government (direct target)</label>
<div class="column"> <br>
<!--Statistics Card--> <i class="icon fas fa-binoculars"></i> <input type="checkbox" name="local"> <label for="local">Local area threat (LAN or physical)</label>
<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> </div>
<br> <br>
<h6>Blocks</h6> <div class="field">
<div class="columns"> <div>
<div class="column"> I want to contribute to Onionr by...
<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>
<i class="icon fas fa-network-wired"></i> <input checked type="checkbox" name="networkContribution"> <label for="networkContribution">Participating in data storage & sharing</label>
<br>
<i class="icon fas fa-book-open"></i> <input checked type="checkbox" name="networkContributionPlain"> <label for="networkContributionPlain">Storing plaintext data</label>
</div> </div>
<div class="field">
<div>
I prefer these words...
</div> </div>
<select name="userIDWords">
<option value=""></option>
</select>
</div> </div>
<br>
<input type="submit" value="Get Started" class="button is-primary">
</form>
</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> </body>
</html> </html>

View File

@ -0,0 +1,19 @@
img{
vertical-align: middle;
}
.navbarLogo{
display: inline;
}
.onboarding{
padding-left: 5%;
text-align: justify;
font-size: 1.5em;
}
.icon{
padding-right: 1em;
}
form{
margin-left: 2%;
}

View File

View File

@ -2,32 +2,33 @@
<html> <html>
<head> <head>
<meta charset='utf-8'> <meta charset="utf-8">
<!--Mobile responsive--> <!--Mobile responsive-->
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title> <title>
Onionr Onionr
</title> </title>
<link rel='shortcut icon' type='image/ico' href='/shared/images/favicon.ico'> <link rel='shortcut icon' type='image/ico' href="/shared/images/favicon.ico">
<link rel="stylesheet" href="/private/main.css"> <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="/shared/fontawesome-free-5.10.2/css/all.min.css">
<link rel='stylesheet' href='/shared/main/PNotifyBrightTheme.css'> <link rel='stylesheet' href="/shared/main/PNotifyBrightTheme.css">
<link rel="stylesheet" href="/gettheme"> <link rel="stylesheet" href="/gettheme">
<script defer src="/shared/node_modules/pnotify/dist/iife/PNotify.js"></script> <script defer src="/shared/node_modules/pnotify/dist/iife/PNotify.js"></script>
<script defer src="/shared/node_modules/pnotify/dist/iife/PNotifyButtons.js"></script> <script defer src="/shared/node_modules/pnotify/dist/iife/PNotifyButtons.js"></script>
<script defer src='/shared/navbar.js'></script> <script defer src="/shared/navbar.js"></script>
<script defer src='/shared/loadabout.js'></script> <script defer src="/shared/loadabout.js"></script>
<script defer src='/shared/misc.js'></script> <script defer src="/shared/misc.js"></script>
<script defer src='/shared/main/stats.js'></script> <script defer src="/shared/main/stats.js"></script>
<script defer src='/shared/panel.js'></script> <script defer src="/shared/panel.js"></script>
<script defer src='/shared/configeditor.js'></script> <script defer src="/shared/configeditor.js"></script>
<script defer src='/shared/sites.js'></script> <script defer src="/shared/sites.js"></script>
<script defer src='/private/js/console.js'></script> <script defer src="/private/js/console.js"></script>
<script defer src="/private/js/motd.js"></script>
<script>alert("Content security policy appears to not be working. Your browser security is weak!")</script> <script>alert("Content security policy appears to not be working. Your browser security is weak!")</script>
</head> </head>
<body> <body>
<div id="shutdownNotice" class='overlay'> <div id="shutdownNotice" class="overlay">
<div> <div>
<p>Your node will shutdown. Thank you for using Onionr.</p> <p>Your node will shutdown. Thank you for using Onionr.</p>
</div> </div>
@ -36,7 +37,7 @@
<nav class="navbar is-dark" role="navigation" aria-label="main navigation"> <nav class="navbar is-dark" role="navigation" aria-label="main navigation">
<div class="navbar-brand"> <div class="navbar-brand">
<a class="navbar-item idLink" href="/"> <a class="navbar-item idLink" href="/">
<img src="/shared/images/favicon.ico" class='navbarLogo'> Onionr <img src="/shared/images/favicon.ico" class="navbarLogo"> Onionr
</a> </a>
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false" <a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false"
@ -53,7 +54,6 @@
<a class="navbar-item idLink" href="/mail/">Mail</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="/friends/">Friends</a>
<a class="navbar-item idLink" href="/board/">Circles</a> <a class="navbar-item idLink" href="/board/">Circles</a>
<a class="navbar-item idLink" href="/chat/">Chat</a>
</div> </div>
<div class="navbar-end"> <div class="navbar-end">
<a class="navbar-item idLink aboutLink">About</a> <a class="navbar-item idLink aboutLink">About</a>
@ -94,12 +94,12 @@
</div> </div>
<div class="field is-grouped is-grouped-centered"> <div class="field is-grouped is-grouped-centered">
<p class="control"> <p class="control">
<a class="button is-danger is-outlined" id='shutdownNode'> <a class="button is-danger is-outlined" id="shutdownNode">
Shutdown Shutdown
</a> </a>
</p> </p>
<p class="control"> <p class="control">
<a class="button is-warning is-outlined" id='restartNode'> <a class="button is-warning is-outlined" id="restartNode">
Restart Restart
</a> </a>
</p> </p>
@ -148,6 +148,7 @@
</header> </header>
<div class="card-content"> <div class="card-content">
<div class="content motdContent"> <div class="content motdContent">
No MOTD currently.
</div> </div>
</div> </div>
</div> </div>
@ -167,21 +168,21 @@
<span class="icon"> <span class="icon">
<i class="fas fa-lock"></i> <i class="fas fa-lock"></i>
</span> </span>
Security level: <span id='securityLevel'></span> Security level: <span id="securityLevel"></span>
</div> </div>
<div class="column"> <div class="column">
<i class="fas fa-clock"></i> <i class="fas fa-clock"></i>
Uptime: <span id='uptime'></span> Uptime: <span id="uptime"></span>
</div> </div>
</div> </div>
<h6>Session Connections</h6> <h6>Session Connections</h6>
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
Last Received: <span id='lastIncoming'>None since start</span> Last Received: <span id="lastIncoming">None since start</span>
</div> </div>
<div class="column"> <div class="column">
<i class="fas fa-arrow-down"></i> <i class="fas fa-arrow-down"></i>
Total Requests: <span id='totalRec'>None since start</span> Total Requests: <span id="totalRec">None since start</span>
</div> </div>
</div> </div>
<i class="fas fa-link"></i> <i class="fas fa-link"></i>
@ -194,11 +195,11 @@
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<i class="fas fa-hdd"></i> <i class="fas fa-hdd"></i>
Stored Blocks: <span id='storedBlocks'></span> Stored Blocks: <span id="storedBlocks"></span>
</div> </div>
<div class="column"> <div class="column">
<i class="fas fa-mail-bulk"></i> <i class="fas fa-mail-bulk"></i>
Blocks in queue: <span id='blockQueue'></span> Blocks in queue: <span id="blockQueue"></span>
</div> </div>
</div> </div>
</div> </div>
@ -217,7 +218,7 @@
<div class="card-content" id="configContent"> <div class="card-content" id="configContent">
<div class="content"> <div class="content">
<p><em>Warning: </em><b>Some values can be dangerous to change. Use caution.</b></p> <p><em>Warning: </em><b>Some values can be dangerous to change. Use caution.</b></p>
<textarea class='textarea configEditor' rows="20"></textarea> <textarea class="textarea configEditor" rows="20"></textarea>
<a class="button is-primary saveConfig">Save Config</a> <a class="button is-primary saveConfig">Save Config</a>
</div> </div>
</div> </div>

View File

@ -0,0 +1,13 @@
fetch('/getmotd', {
headers: {
"token": webpass
}})
.then((resp) => resp.text())
.then(function(resp) {
resp = resp.trim()
if (resp.length <= 1){return}
let motds = document.getElementsByClassName("motdContent")
for (x = 0; x < motds.length; x++){
motds[x].innerText = resp
}
})

View File

@ -18,7 +18,6 @@
*/ */
shutdownBtn = document.getElementById('shutdownNode') shutdownBtn = document.getElementById('shutdownNode')
refreshStatsBtn = document.getElementById('refreshStats')
restartBtn = document.getElementById('restartNode') restartBtn = document.getElementById('restartNode')
shutdownBtn.onclick = function(){ shutdownBtn.onclick = function(){
@ -38,7 +37,3 @@ restartBtn.onclick = function(){
} }
} }
refreshStatsBtn.onclick = function(){
getStats()
}