added motd, todo.txt, and small bug fixes
This commit is contained in:
parent
695f334297
commit
c4c4fb70d5
4
TODO.txt
4
TODO.txt
@ -5,3 +5,7 @@
|
||||
* document usage
|
||||
* encrypt local data and keys
|
||||
* 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
|
||||
|
@ -80,7 +80,7 @@ systemctl start onionr
|
||||
|
||||
# pretty header thing
|
||||
|
||||
"$EXECUTABLE" --header 'Onionr successfully installed.'
|
||||
"$EXECUTABLE" details
|
||||
|
||||
# and we're good!
|
||||
|
||||
|
@ -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
|
||||
|
||||
@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')
|
||||
def chat_index():
|
||||
return send_from_directory(root + 'chat/', "index.html")
|
||||
|
@ -24,7 +24,8 @@ from . import pluginwhitelist
|
||||
|
||||
# Be extremely mindful of this. These are endpoints available without a password
|
||||
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:
|
||||
def __init__(self, client_api):
|
||||
|
@ -36,8 +36,7 @@
|
||||
"verbosity": "default",
|
||||
|
||||
"file": {
|
||||
"output": true,
|
||||
"path": "output.log"
|
||||
"output": true
|
||||
},
|
||||
|
||||
"console": {
|
||||
@ -53,12 +52,6 @@
|
||||
"bridge_fingerprint": ""
|
||||
},
|
||||
|
||||
"i2p": {
|
||||
"host": false,
|
||||
"connect": true,
|
||||
"own_addr": ""
|
||||
},
|
||||
|
||||
"allocations": {
|
||||
"disk": 100000000,
|
||||
"net_total": 1000000000,
|
||||
|
@ -48,7 +48,6 @@
|
||||
<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>
|
||||
</nav>
|
||||
|
@ -40,7 +40,6 @@
|
||||
<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>
|
||||
</nav>
|
||||
|
@ -43,7 +43,6 @@
|
||||
<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>
|
||||
</nav>
|
||||
|
@ -12,6 +12,7 @@
|
||||
<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">
|
||||
<link rel="stylesheet" href="onboarding.css">
|
||||
<script defer src='/shared/navbar.js'></script>
|
||||
<script defer src='/shared/loadabout.js'></script>
|
||||
<script defer src='/shared/misc.js'></script>
|
||||
@ -20,6 +21,7 @@
|
||||
<script defer src='/shared/configeditor.js'></script>
|
||||
<script defer src='/shared/sites.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>
|
||||
</head>
|
||||
|
||||
@ -30,34 +32,6 @@
|
||||
</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">
|
||||
@ -72,24 +46,7 @@
|
||||
</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">
|
||||
<div class="field is-grouped is-pulled-right">
|
||||
<p class="control">
|
||||
<a class="button is-danger is-outlined" id='shutdownNode'>
|
||||
Shutdown
|
||||
@ -110,124 +67,43 @@
|
||||
|
||||
<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 class="onboarding">
|
||||
<p>Welcome. There are just a few questions for you to answer before you get started.</p>
|
||||
<br>
|
||||
<form method='post'>
|
||||
<div class="field">
|
||||
<div>
|
||||
I am worried about the following targeting me...
|
||||
</div>
|
||||
<i class="icon fas fa-laptop-code"></i> <input type="checkbox" name="hackers"> <label for="state"> Cyber criminals</label>
|
||||
<br>
|
||||
<i class="icon fas fa-eye"></i> <input type="checkbox" name="state"> <label for="state">Government (mass surveillance)</label>
|
||||
<br>
|
||||
<i class="icon fas fa-university"></i> <input type="checkbox" name="stateTarget"> <label for="stateTarget">Government (direct target)</label>
|
||||
<br>
|
||||
<i class="icon fas fa-binoculars"></i> <input type="checkbox" name="local"> <label for="local">Local area threat (LAN or physical)</label>
|
||||
</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>
|
||||
<br>
|
||||
<div class="field">
|
||||
<div>
|
||||
I want to contribute to Onionr by...
|
||||
</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>
|
||||
|
||||
<!--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 class="field">
|
||||
<div>
|
||||
I prefer these words...
|
||||
</div>
|
||||
<select name="userIDWords">
|
||||
<option value=""></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<input type="submit" value="Get Started" class="button is-primary">
|
||||
</form>
|
||||
</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>
|
19
static-data/www/onboarding/onboarding.css
Normal file
19
static-data/www/onboarding/onboarding.css
Normal 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%;
|
||||
}
|
0
static-data/www/onboarding/onboarding.js
Normal file
0
static-data/www/onboarding/onboarding.js
Normal file
@ -2,32 +2,33 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<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='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='/shared/main/PNotifyBrightTheme.css'>
|
||||
<link rel='stylesheet' href="/shared/main/PNotifyBrightTheme.css">
|
||||
<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/PNotifyButtons.js"></script>
|
||||
<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 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 defer src="/private/js/motd.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 id="shutdownNotice" class="overlay">
|
||||
<div>
|
||||
<p>Your node will shutdown. Thank you for using Onionr.</p>
|
||||
</div>
|
||||
@ -36,7 +37,7 @@
|
||||
<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
|
||||
<img src="/shared/images/favicon.ico" class="navbarLogo"> Onionr
|
||||
</a>
|
||||
|
||||
<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="/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>
|
||||
@ -94,12 +94,12 @@
|
||||
</div>
|
||||
<div class="field is-grouped is-grouped-centered">
|
||||
<p class="control">
|
||||
<a class="button is-danger is-outlined" id='shutdownNode'>
|
||||
<a class="button is-danger is-outlined" id="shutdownNode">
|
||||
Shutdown
|
||||
</a>
|
||||
</p>
|
||||
<p class="control">
|
||||
<a class="button is-warning is-outlined" id='restartNode'>
|
||||
<a class="button is-warning is-outlined" id="restartNode">
|
||||
Restart
|
||||
</a>
|
||||
</p>
|
||||
@ -148,6 +148,7 @@
|
||||
</header>
|
||||
<div class="card-content">
|
||||
<div class="content motdContent">
|
||||
No MOTD currently.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -167,21 +168,21 @@
|
||||
<span class="icon">
|
||||
<i class="fas fa-lock"></i>
|
||||
</span>
|
||||
Security level: <span id='securityLevel'></span>
|
||||
Security level: <span id="securityLevel"></span>
|
||||
</div>
|
||||
<div class="column">
|
||||
<i class="fas fa-clock"></i>
|
||||
Uptime: <span id='uptime'></span>
|
||||
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>
|
||||
️ 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>
|
||||
Total Requests: <span id="totalRec">None since start</span>
|
||||
</div>
|
||||
</div>
|
||||
<i class="fas fa-link"></i>
|
||||
@ -194,11 +195,11 @@
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
<i class="fas fa-hdd"></i>
|
||||
Stored Blocks: <span id='storedBlocks'></span>
|
||||
Stored Blocks: <span id="storedBlocks"></span>
|
||||
</div>
|
||||
<div class="column">
|
||||
<i class="fas fa-mail-bulk"></i>
|
||||
Blocks in queue: <span id='blockQueue'></span>
|
||||
Blocks in queue: <span id="blockQueue"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -217,7 +218,7 @@
|
||||
<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>
|
||||
<textarea class="textarea configEditor" rows="20"></textarea>
|
||||
<a class="button is-primary saveConfig">Save Config</a>
|
||||
</div>
|
||||
</div>
|
||||
|
13
static-data/www/private/js/motd.js
Normal file
13
static-data/www/private/js/motd.js
Normal 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
|
||||
}
|
||||
})
|
@ -18,7 +18,6 @@
|
||||
*/
|
||||
|
||||
shutdownBtn = document.getElementById('shutdownNode')
|
||||
refreshStatsBtn = document.getElementById('refreshStats')
|
||||
restartBtn = document.getElementById('restartNode')
|
||||
|
||||
shutdownBtn.onclick = function(){
|
||||
@ -38,7 +37,3 @@ restartBtn.onclick = function(){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
refreshStatsBtn.onclick = function(){
|
||||
getStats()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user