mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-12-23 21:18:07 +00:00
Upgrade improvements, netdata improvements
This commit is contained in:
parent
0403c0d340
commit
fdb2961ae0
|
@ -1,3 +1,12 @@
|
|||
=== v0.1.67 ===
|
||||
- Improve upgrade consistency
|
||||
- Improve resource usage of netdata
|
||||
- Add ability to disable netdata
|
||||
- Fix tor connection issue
|
||||
- Remove duplicate BTC Explorer
|
||||
- Handle 404 and 500 errors
|
||||
- Dark mode fixes
|
||||
|
||||
=== v0.1.66 ===
|
||||
- Add netdata as first docker container
|
||||
- Improve QS options on settings page when QS is disabled
|
||||
|
|
|
@ -212,6 +212,8 @@ ControlPort 9051
|
|||
CookieAuthentication 1
|
||||
CookieAuthFileGroupReadable 1
|
||||
|
||||
PidFile /tmp/tor.pid
|
||||
|
||||
# Hidden Service for myNode
|
||||
HiddenServiceDir /var/lib/tor/mynode/
|
||||
HiddenServiceVersion 2
|
||||
|
|
|
@ -13,4 +13,5 @@ services:
|
|||
- /etc/passwd:/host/etc/passwd:ro
|
||||
- /etc/group:/host/etc/group:ro
|
||||
- /proc:/host/proc:ro
|
||||
- /sys:/host/sys:ro
|
||||
- /sys:/host/sys:ro
|
||||
- /opt/mynode/netdata/netdata.conf:/etc/netdata/netdata.conf:ro
|
11317
rootfs/standard/opt/mynode/netdata/netdata.conf
Normal file
11317
rootfs/standard/opt/mynode/netdata/netdata.conf
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -3,6 +3,7 @@
|
|||
source /usr/share/mynode/mynode_config.sh
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
# Shut down main services to save memory and CPU
|
||||
systemctl stop electrs
|
||||
|
@ -40,6 +41,7 @@ usermod -aG docker root
|
|||
|
||||
|
||||
# Upgrade BTC
|
||||
set +e
|
||||
BTC_VERSION="0.18.1"
|
||||
ARCH="arm-linux-gnueabihf"
|
||||
uname -a | grep aarch64
|
||||
|
@ -49,6 +51,7 @@ fi
|
|||
if [ $IS_X86 = 1 ]; then
|
||||
ARCH="x86_64-linux-gnu"
|
||||
fi
|
||||
set -e
|
||||
BTC_UPGRADE_URL=https://bitcoincore.org/bin/bitcoin-core-$BTC_VERSION/bitcoin-$BTC_VERSION-$ARCH.tar.gz
|
||||
BTC_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.btc_url
|
||||
BTC_UPGRADE_SHA256SUM_URL=https://bitcoincore.org/bin/bitcoin-core-$BTC_VERSION/SHA256SUMS.asc
|
||||
|
|
|
@ -39,5 +39,13 @@ sleep 1
|
|||
|
||||
# Run post upgrade script
|
||||
VERSION=$(cat /usr/share/mynode/version)
|
||||
/bin/bash /usr/bin/mynode_post_upgrade.sh > /home/admin/upgrade_logs/upgrade_log_${VERSION}_post.txt 2>&1
|
||||
for i in {1..5}
|
||||
do
|
||||
/bin/bash /usr/bin/mynode_post_upgrade.sh > /home/admin/upgrade_logs/upgrade_log_${VERSION}_post_${i}.txt 2>&1
|
||||
RC=$?
|
||||
if [ "${RC}" -eq "0" ]; then
|
||||
break
|
||||
fi
|
||||
sleep 10s
|
||||
done
|
||||
chown -R admin:admin /home/admin/upgrade_logs
|
|
@ -24,3 +24,4 @@ ELECTRS_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_electrs_enabled"
|
|||
LNDHUB_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_lndhub_enabled"
|
||||
BTCRPCEXPLORER_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_btcrpceplorer_enabled"
|
||||
VPN_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_vpn_enabled"
|
||||
NETDATA_ENABLED_FILE = "/mnt/hdd/mynode/.mynode_netdata_enabled"
|
||||
|
|
|
@ -1,7 +1,20 @@
|
|||
import os
|
||||
import subprocess
|
||||
from config import *
|
||||
|
||||
|
||||
# Generic service check
|
||||
def is_service_enabled(service):
|
||||
cmd = "systemctl status {} --no-pager".format(service)
|
||||
try:
|
||||
results = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
|
||||
if "enabled;" in results:
|
||||
return True
|
||||
except:
|
||||
return False
|
||||
return False
|
||||
|
||||
|
||||
# Enable disable functions on homepage
|
||||
def is_lndhub_enabled():
|
||||
if os.path.isfile(LNDHUB_ENABLED_FILE):
|
||||
|
@ -73,3 +86,15 @@ def disable_vpn():
|
|||
os.system("systemctl disable vpn --no-pager")
|
||||
os.system("systemctl stop openvpn --no-pager")
|
||||
os.system("systemctl disable openvpn --no-pager")
|
||||
|
||||
|
||||
def is_netdata_enabled():
|
||||
return is_service_enabled("netdata")
|
||||
|
||||
def enable_netdata():
|
||||
os.system("systemctl enable netdata --no-pager")
|
||||
os.system("systemctl start netdata --no-pager")
|
||||
|
||||
def disable_netdata():
|
||||
os.system("systemctl stop netdata --no-pager")
|
||||
os.system("systemctl disable netdata --no-pager")
|
|
@ -133,6 +133,7 @@ def page_settings():
|
|||
"lnd_status": lnd_status,
|
||||
"electrs_status": electrs_status,
|
||||
"is_quicksync_disabled": not is_quicksync_enabled(),
|
||||
"is_netdata_enabled": is_netdata_enabled(),
|
||||
"is_uploader_device": is_uploader(),
|
||||
"download_rate": download_rate,
|
||||
"upload_rate": upload_rate,
|
||||
|
@ -467,4 +468,12 @@ def toggle_darkmode_page():
|
|||
disable_darkmode()
|
||||
else:
|
||||
enable_darkmode()
|
||||
return redirect("/settings")
|
||||
|
||||
@mynode_settings.route("/settings/toggle-netdata")
|
||||
def toggle_netdata_page():
|
||||
if is_netdata_enabled():
|
||||
disable_netdata()
|
||||
else:
|
||||
enable_netdata()
|
||||
return redirect("/settings")
|
|
@ -361,7 +361,9 @@
|
|||
<tr>
|
||||
<td>Details</td>
|
||||
<td style="padding-left: 20px;">
|
||||
{% if is_netdata_enabled %}
|
||||
<a id="netdata" class="ui-button ui-widget ui-corner-all settings_button_small" href="#">Open Netdata</a>
|
||||
{% endif %}
|
||||
<a id="glances" class="ui-button ui-widget ui-corner-all settings_button_small" href="#">Open Glances</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -571,6 +573,20 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div class="settings_block">
|
||||
<div class="settings_block_header">Services</div>
|
||||
|
||||
<div class="settings_block_subheader">Netdata</div>
|
||||
This will enable or disable netdata device monitoring.
|
||||
<br/>
|
||||
{% if is_netdata_enabled %}
|
||||
<a href="/settings/toggle-netdata" class="ui-button ui-widget ui-corner-all settings_button">Disable</a>
|
||||
{% else %}
|
||||
<a href="/settings/toggle-netdata" class="ui-button ui-widget ui-corner-all settings_button">Enable</a>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="settings_block">
|
||||
<div class="settings_block_header">Advanced</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user