From c4c4fb70d569b6c8681b5c869c12c54994b0fb36 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Tue, 8 Oct 2019 16:14:30 -0500 Subject: [PATCH] added motd, todo.txt, and small bug fixes --- TODO.txt | 4 + install/install_arch.sh | 2 +- onionr/httpapi/miscclientapi/staticfiles.py | 8 + onionr/httpapi/security/client.py | 3 +- static-data/default_config.json | 9 +- static-data/www/board/index.html | 1 - static-data/www/friends/index.html | 1 - static-data/www/mail/index.html | 1 - static-data/www/onboarding/index.html | 192 ++++---------------- static-data/www/onboarding/onboarding.css | 19 ++ static-data/www/onboarding/onboarding.js | 0 static-data/www/private/index.html | 47 ++--- static-data/www/private/js/motd.js | 13 ++ static-data/www/shared/panel.js | 5 - 14 files changed, 106 insertions(+), 199 deletions(-) create mode 100644 static-data/www/onboarding/onboarding.css create mode 100644 static-data/www/onboarding/onboarding.js create mode 100644 static-data/www/private/js/motd.js diff --git a/TODO.txt b/TODO.txt index d003ce96..38bff9f0 100644 --- a/TODO.txt +++ b/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 diff --git a/install/install_arch.sh b/install/install_arch.sh index 15bd698d..8be1684d 100755 --- a/install/install_arch.sh +++ b/install/install_arch.sh @@ -80,7 +80,7 @@ systemctl start onionr # pretty header thing -"$EXECUTABLE" --header 'Onionr successfully installed.' +"$EXECUTABLE" details # and we're good! diff --git a/onionr/httpapi/miscclientapi/staticfiles.py b/onionr/httpapi/miscclientapi/staticfiles.py index abfc566a..4640d8af 100644 --- a/onionr/httpapi/miscclientapi/staticfiles.py +++ b/onionr/httpapi/miscclientapi/staticfiles.py @@ -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/', 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") diff --git a/onionr/httpapi/security/client.py b/onionr/httpapi/security/client.py index 6a2b1e91..d462c1cf 100644 --- a/onionr/httpapi/security/client.py +++ b/onionr/httpapi/security/client.py @@ -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): diff --git a/static-data/default_config.json b/static-data/default_config.json index 7ea4b457..1757ac9b 100755 --- a/static-data/default_config.json +++ b/static-data/default_config.json @@ -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, diff --git a/static-data/www/board/index.html b/static-data/www/board/index.html index bbd7c022..dc70d9a1 100755 --- a/static-data/www/board/index.html +++ b/static-data/www/board/index.html @@ -48,7 +48,6 @@ Mail Friends Circles - Chat diff --git a/static-data/www/friends/index.html b/static-data/www/friends/index.html index f53c5aa0..677f205b 100755 --- a/static-data/www/friends/index.html +++ b/static-data/www/friends/index.html @@ -40,7 +40,6 @@ Mail Friends Circles - Chat diff --git a/static-data/www/mail/index.html b/static-data/www/mail/index.html index 75cf2ff8..156f0834 100755 --- a/static-data/www/mail/index.html +++ b/static-data/www/mail/index.html @@ -43,7 +43,6 @@ Mail Friends Circles - Chat diff --git a/static-data/www/onboarding/index.html b/static-data/www/onboarding/index.html index 2d643ae1..6c2a408f 100644 --- a/static-data/www/onboarding/index.html +++ b/static-data/www/onboarding/index.html @@ -12,6 +12,7 @@ + @@ -20,6 +21,7 @@ + @@ -30,34 +32,6 @@ - -
@@ -72,24 +46,7 @@
-
-
-

- Identity -

-

- -

-

- - - - - -

-
-
-
+

Shutdown @@ -110,124 +67,43 @@
- -

-
-
- -
-
-

- Onionr Sites -

-
-
+
+

Welcome. There are just a few questions for you to answer before you get started.

+
+
+
+
+ I am worried about the following targeting me...
+ +
+ +
+ +
+
-
- -
-
-

- 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: -
-
-
-
+
+
+
+ I want to contribute to Onionr by...
+ +
+
-
- - -
-
-

- Edit Configuration -

-
-
-
-

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

- - Save Config +
+
+ I prefer these words...
+
-
+
+ +
-
- - + \ No newline at end of file diff --git a/static-data/www/onboarding/onboarding.css b/static-data/www/onboarding/onboarding.css new file mode 100644 index 00000000..c59a1580 --- /dev/null +++ b/static-data/www/onboarding/onboarding.css @@ -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%; +} diff --git a/static-data/www/onboarding/onboarding.js b/static-data/www/onboarding/onboarding.js new file mode 100644 index 00000000..e69de29b diff --git a/static-data/www/private/index.html b/static-data/www/private/index.html index d740961d..ecc548f2 100755 --- a/static-data/www/private/index.html +++ b/static-data/www/private/index.html @@ -2,32 +2,33 @@ - + Onionr - + - + - - - - - - - - + + + + + + + + + -
+

Your node will shutdown. Thank you for using Onionr.

@@ -36,7 +37,7 @@
- Uptime: + Uptime:
Session Connections
- ️ Last Received: None since start + ️ Last Received: None since start
- Total Requests: None since start + Total Requests: None since start
@@ -194,11 +195,11 @@
- Stored Blocks: + Stored Blocks:
- Blocks in queue: + Blocks in queue:
@@ -217,7 +218,7 @@

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

- + Save Config
diff --git a/static-data/www/private/js/motd.js b/static-data/www/private/js/motd.js new file mode 100644 index 00000000..03cc03be --- /dev/null +++ b/static-data/www/private/js/motd.js @@ -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 + } +}) \ No newline at end of file diff --git a/static-data/www/shared/panel.js b/static-data/www/shared/panel.js index 8bfc1fb0..88e02c40 100755 --- a/static-data/www/shared/panel.js +++ b/static-data/www/shared/panel.js @@ -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() -}