From efb87f3a4d34b937414843f53e3021b1a1db4ca6 Mon Sep 17 00:00:00 2001 From: Taylor Helsper Date: Sat, 28 Dec 2019 22:24:42 -0600 Subject: [PATCH] Show real tor status on homepage --- rootfs/standard/var/www/mynode/mynode.py | 9 +++++++ .../mynode/templates/includes/services.html | 26 +++++++++---------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/rootfs/standard/var/www/mynode/mynode.py b/rootfs/standard/var/www/mynode/mynode.py index 8de050fe..5f689eb4 100644 --- a/rootfs/standard/var/www/mynode/mynode.py +++ b/rootfs/standard/var/www/mynode/mynode.py @@ -207,6 +207,7 @@ def index(): elif status == STATE_STABLE: bitcoind_status_code = os.system("systemctl status bitcoind --no-pager") lnd_status_code = os.system("systemctl status lnd --no-pager") + tor_status_color = "gray" bitcoind_status_color = "red" lnd_status_color = "red" lnd_ready = is_lnd_ready() @@ -264,6 +265,13 @@ def index(): } return render_template('state.html', **templateData) + # Find tor status + status = os.system("systemctl status tor@default --no-pager") + if status != 0: + tor_status_color = "red" + else: + tor_status_color = "green" + # Find bitcoind status if bitcoind_status_code != 0: bitcoind_status_color = "red" @@ -393,6 +401,7 @@ def index(): "lnd_status_color": lnd_status_color, "lnd_status": Markup(lnd_status), "lnd_ready": lnd_ready, + "tor_status_color": tor_status_color, "electrs_status_color": electrs_status_color, "electrs_status": Markup(electrs_status), "electrs_enabled": is_electrs_enabled(), diff --git a/rootfs/standard/var/www/mynode/templates/includes/services.html b/rootfs/standard/var/www/mynode/templates/includes/services.html index c29979bf..8ed8d24b 100644 --- a/rootfs/standard/var/www/mynode/templates/includes/services.html +++ b/rootfs/standard/var/www/mynode/templates/includes/services.html @@ -37,6 +37,19 @@ {% if electrs_enabled %}Disable{% else %}Enable{% endif %} +
+
+ +
Tor
+
Private Connections
+
+ {% if product_key_skipped %} + Remote Access Premium Feature + {% else %} + Tor Services + {% endif %} +
+
@@ -53,19 +66,6 @@ {% endif %}
-
-
- -
Tor Services
-
Remote Access
-
- {% if product_key_skipped %} - Premium Feature - {% else %} - Tor Services - {% endif %} -
-