Add CKBunker v0.9 (beta)

This commit is contained in:
Taylor Helsper 2021-02-11 22:25:05 -06:00
parent b9cb63085b
commit 6fc598a06b
17 changed files with 236 additions and 85 deletions

View File

@ -1,6 +1,6 @@
# myNode System Notes
Various restrictions and behaviors of myNode and the various applications will be documented below.
Various restrictions and behaviors of myNode and the various applications are documented below.
## Thunderhub
@ -9,3 +9,12 @@ Various restrictions and behaviors of myNode and the various applications will b
## BTC Pay Server
- The upgrade button within BTC Pay Server will not work on myNode. Upgrades are performed as part of the myNode upgrade process.
## CKBunker
- On some occasions, the CKBunker application will stop detecting a ColdCard that has been attached for a significant period of time.
-- Workaround: Run these commands as root.
echo 0 > /sys/bus/usb/devices/<coldcard device>/authorized
echo 1 > /sys/bus/usb/devices/<coldcard device>/authorized
- CKBunker uses a separate password that starts as "bolt" and can be updated within the app
- The password is stored in plaintext on the myNode drive

View File

@ -0,0 +1,23 @@
server {
listen 9824 ssl;
server_name ckbunker;
include /etc/nginx/mynode/mynode_ssl_params.conf;
include /etc/nginx/mynode/mynode_ssl_cert_key.conf;
access_log /var/log/nginx/access_ckbunker.log;
error_log /var/log/nginx/error_ckbunker.log;
location / {
proxy_pass http://127.0.0.1:9823;
include /etc/nginx/mynode/mynode_ssl_proxy_params.conf;
}
location /websocket {
proxy_pass http://127.0.0.1:9823/websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
}

View File

@ -1,7 +1,7 @@
ALLOW_REBOOTS: true
DATA_FILES: /mnt/hdd/mynode/ckbunker
EASY_CAPTCHA: false
#EXPLORA: http://explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion
EXPLORA: http://explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion
MASTER_PW: bolt
MAX_IDLE_TIME: 600
MAX_LOGIN_WAIT_TIME: 300

View File

@ -93,6 +93,10 @@ def api_get_service_status():
data["status"], data["color"] = get_lnbits_status_and_color()
elif service == "thunderhub":
data["status"], data["color"] = get_thunderhub_status_and_color()
elif service == "ckbunker":
data["status"], data["color"] = get_ckbunker_status_and_color()
elif service == "sphinxrelay":
data["status"], data["color"] = get_sphinxrelay_status_and_color()
elif service == "tor":
data["status"] = "Private Connections"
data["color"] = get_service_status_color("tor@default")

View File

@ -565,6 +565,30 @@ def get_thunderhub_status_and_color():
status = "Waiting on LND..."
return status,color
def get_ckbunker_status_and_color():
status = "Coldcard Signing Tool"
color = "gray"
if is_bitcoind_synced():
if is_ckbunker_enabled():
color = get_service_status_color("lndhub")
else:
status = "Waiting on Bitcoin..."
return status,color
def get_sphinxrelay_status_and_color():
color = "gray"
status = "Chat"
if is_lnd_ready():
if is_sphinxrelay_enabled():
status_code = get_service_status_code("sphinxrelay")
if status_code != 0:
color = "red"
else:
color = "green"
else:
status = "Waiting on LND..."
return status,color
def get_lndhub_status_and_color():
status = "BlueWallet Backend"
color = "gray"

View File

@ -71,6 +71,26 @@ def disable_thunderhub():
os.system("systemctl disable thunderhub --no-pager")
def is_ckbunker_enabled():
return is_service_enabled("ckbunker")
def enable_ckbunker():
os.system("systemctl enable ckbunker --no-pager")
os.system("systemctl start ckbunker --no-pager")
def disable_ckbunker():
os.system("systemctl stop ckbunker --no-pager")
os.system("systemctl disable ckbunker --no-pager")
def is_sphinxrelay_enabled():
return is_service_enabled("thunderhub")
def enable_sphinxrelay():
os.system("systemctl enable sphinx-relay --no-pager")
os.system("systemctl start sphinx-relay --no-pager")
def disable_sphinxrelay():
os.system("systemctl stop sphinx-relay --no-pager")
os.system("systemctl disable sphinx-relay --no-pager")
def is_btcrpcexplorer_enabled():
if os.path.isfile(BTCRPCEXPLORER_ENABLED_FILE):
return True

View File

@ -486,6 +486,12 @@ def index():
# Find Thunderhub status
thunderhub_status, thunderhub_status_color = get_thunderhub_status_and_color()
# Find CKBunker status
ckbunker_status, ckbunker_status_color = get_ckbunker_status_and_color()
# Find Sphinx Relay status
sphinxrelay_status, sphinxrelay_status_color = get_sphinxrelay_status_and_color()
# Find electrs status
electrs_status, electrs_status_color = get_electrs_status_and_color()
@ -562,6 +568,12 @@ def index():
"thunderhub_status_color": thunderhub_status_color,
"thunderhub_status": thunderhub_status,
"thunderhub_enabled": is_thunderhub_enabled(),
"ckbunker_status_color": ckbunker_status_color,
"ckbunker_status": ckbunker_status,
"ckbunker_enabled": is_ckbunker_enabled(),
"sphinxrelay_status_color": sphinxrelay_status_color,
"sphinxrelay_status": sphinxrelay_status,
"sphinxrelay_enabled": is_sphinxrelay_enabled(),
"lndhub_status_color": lndhub_status_color,
"lndhub_status": lndhub_status,
"lndhub_enabled": is_lndhub_enabled(),
@ -683,6 +695,24 @@ def page_toggle_thunderhub():
enable_thunderhub()
return redirect("/")
@app.route("/toggle-ckbunker")
def page_toggle_ckbunker():
check_logged_in()
if is_ckbunker_enabled():
disable_ckbunker()
else:
enable_ckbunker()
return redirect("/")
@app.route("/toggle-sphinxrelay")
def page_toggle_sphinxrelay():
check_logged_in()
if is_sphinxrelay_enabled():
disable_sphinxrelay()
else:
enable_sphinxrelay()
return redirect("/")
@app.route("/toggle-electrs")
def page_toggle_electrs():
check_logged_in()
@ -921,10 +951,10 @@ def start_threads():
app.logger.info("STARTING THREADS")
# Start threads
btc_thread1 = BackgroundThread(update_bitcoin_main_info_thread, 10)
btc_thread1 = BackgroundThread(update_bitcoin_main_info_thread, 15)
btc_thread1.start()
threads.append(btc_thread1)
btc_thread2 = BackgroundThread(update_bitcoin_other_info_thread, 30)
btc_thread2 = BackgroundThread(update_bitcoin_other_info_thread, 60)
btc_thread2.start()
threads.append(btc_thread2)
electrs_info_thread = BackgroundThread(update_electrs_info_thread, 60)

View File

@ -197,7 +197,7 @@ td {
position: relative;
border: none;
border-radius: 10px;
width: 300px;
width: 385px;
height: 180px;
padding: 10px;
margin: 6px 10px 6px 10px;
@ -209,7 +209,7 @@ td {
position: relative;
border: none;
border-radius: 10px;
width: 640px;
width: 810px;
height: 120px;
padding: 10px;
margin: 6px 10px 6px 10px;
@ -308,6 +308,13 @@ td {
font-size: 12px;
line-height: 130%;
}
.app_beta_tag_image {
width: 40px;
height: 40px;
position: absolute;
left: 110px;
top: 0px;
}
.app_contents {
font-size: 12px;
position: absolute;
@ -532,7 +539,7 @@ a:link.ui-button, a:visited.ui-button, .ui-button {
color: #333333;
border: 3px solid orange;
background-color: rgb(255, 250, 238);
width: 600px;
width: 800px;
border-radius: 25px;
text-align: justify;
display: block;
@ -546,7 +553,7 @@ a:link.ui-button, a:visited.ui-button, .ui-button {
color: #333333;
border: 3px solid red;
background-color: rgb(255, 238, 238);
width: 600px;
width: 800px;
border-radius: 25px;
text-align: justify;
display: block;
@ -562,21 +569,6 @@ a:link.ui-button, a:visited.ui-button, .ui-button {
text-align: center;
}
.upgrade_ad_main_page {
color: #333333;
border: 3px solid orange;
background-color: rgb(255, 250, 238);
width: 600px;
border-radius: 25px;
text-align: justify;
display: block;
font-size: 12px;
padding: 5px;
padding-left: 12px;
margin: auto;
margin-bottom: 20px;
}
.port_forwarded_icon {
width: 26px;
height: 24px;

View File

@ -94,7 +94,6 @@ td {
}
.main_page_warning_block,
.upgrade_ad_main_page,
.halving_message_main_page {
color: #eee;
border: 3px solid #f9c132;

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -1,4 +1,6 @@
<div class="main_header">Apps</div>
<!-- ROW 1 -->
<div class="app_tile_row">
<div class="app_tile">
<div class="app_status_icon {{ rtl_status_color }}" id="rtl_status_icon"></div>
@ -48,6 +50,26 @@
{% endif %}
</div>
</div>
<div class="app_tile">
<div class="app_status_icon {{mempoolspace_status_color}}" id="mempoolspace_status_icon"></div>
<div class="app_logo"><img class="app_logo_icon" src="{{ url_for('static', filename="images/mempoolspace.png")}}"/></div>
<div class="app_title">Mempool</div>
<div class="app_status" id="mempoolspace_status">{{ mempoolspace_status }}</div>
<div class="app_contents">
{% if product_key_skipped %}
Premium Feature
{% else %}
{% if not is_installing_docker_images %}
{% if mempoolspace_enabled %}
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="mempoolspace">View</a>
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-mempoolspace">Disable</a>
{% else %}
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-mempoolspace">Enable</a>
{% endif %}
{% endif %}
{% endif %}
</div>
</div>
<div class="app_tile">
<div class="app_status_icon {{ lndhub_status_color }}" id="lndhub_status_icon"></div>
<div class="app_logo"><img class="app_logo_icon" src="{{ url_for('static', filename="images/lndhub.png")}}"/></div>
@ -62,21 +84,10 @@
{% endif %}
</div>
</div>
<!--
<div class="app_tile">
<div class="app_status_icon {{ lndconnect_status_color }}" id="lndconnect_status_icon"></div>
<div class="app_logo"><img class="app_logo_icon" src="{{ url_for('static', filename="images/lndconnect.png")}}"/></div>
<div class="app_title">LND Connect</div>
<div class="app_status">{% if not lnd_ready %}Waiting on LND...{% else %}Lightning Tool{% endif %}</div>
<div class="app_contents">
{% if lnd_ready %}
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="lndconnect">LND Connect</a>
{% endif %}
</div>
</div>
-->
</div>
<!-- ROW 2 -->
<div class="app_tile_row">
<div class="app_tile">
<div class="app_status_icon {{ btcrpcexplorer_status_color }}" id="btcrpcexplorer_status_icon"></div>
@ -133,20 +144,40 @@
</div>
{% endif %}
<div class="app_tile">
<div class="app_status_icon {{mempoolspace_status_color}}" id="mempoolspace_status_icon"></div>
<div class="app_logo"><img class="app_logo_icon" src="{{ url_for('static', filename="images/mempoolspace.png")}}"/></div>
<div class="app_title">Mempool</div>
<div class="app_status" id="mempoolspace_status">{{ mempoolspace_status }}</div>
<div class="app_status_icon {{ thunderhub_status_color }}" id="thunderhub_status_icon"></div>
<div class="app_logo"><img class="app_logo_icon" src="{{ url_for('static', filename="images/thunderhub.png")}}"/></div>
<div class="app_title">Thunderhub</div>
<div class="app_status" id="thunderhub_status">{{ thunderhub_status }}</div>
<div class="app_contents">
{% if product_key_skipped %}
Premium Feature
{% else %}
{% if not is_installing_docker_images %}
{% if mempoolspace_enabled %}
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="mempoolspace">View</a>
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-mempoolspace">Disable</a>
{% if lnd_ready %}
{% if thunderhub_enabled %}
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="thunderhub">Thunderhub</a>
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-thunderhub">Disable</a>
{% else %}
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-mempoolspace">Enable</a>
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-thunderhub">Enable</a>
{% endif %}
{% endif %}
{% endif %}
</div>
</div>
<div class="app_tile">
<div class="app_status_icon {{ lnbits_status_color }}" id="lnbits_status_icon"></div>
<div class="app_logo"><img class="app_logo_icon" src="{{ url_for('static', filename="images/lnbits.png")}}"/></div>
<div class="app_title">LNbits</div>
<div class="app_status" id="lnbits_status">{{ lnbits_status }}</div>
<div class="app_contents">
{% if product_key_skipped %}
Premium Feature
{% else %}
{% if lnd_ready %}
{% if lnbits_enabled %}
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="lnbits">LNbits</a>
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-lnbits">Disable</a>
{% else %}
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-lnbits">Enable</a>
{% endif %}
{% endif %}
{% endif %}
@ -154,6 +185,8 @@
</div>
</div>
<!-- ROW 3 -->
<div class="app_tile_row">
<div class="app_tile">
<div class="app_status_icon {{ caravan_status_color }}" id="caravan_status_icon"></div>
@ -192,41 +225,21 @@
</div>
</div>
<div class="app_tile">
<div class="app_status_icon {{ lnbits_status_color }}" id="lnbits_status_icon"></div>
<div class="app_logo"><img class="app_logo_icon" src="{{ url_for('static', filename="images/lnbits.png")}}"/></div>
<div class="app_title">LNbits</div>
<div class="app_status" id="lnbits_status">{{ lnbits_status }}</div>
<div class="app_status_icon {{ ckbunker_status_color }}" id="ckbunker_status_icon"></div>
<div class="app_logo"><img class="app_logo_icon" src="{{ url_for('static', filename="images/ckbunker.png")}}"/></div>
<img class="app_beta_tag_image" src="{{ url_for('static', filename="images/beta.png")}}"/>
<div class="app_title">CKBunker</div>
<div class="app_status" id="ckbunker_status">{{ ckbunker_status }}</div>
<div class="app_contents">
{% if product_key_skipped %}
Premium Feature
{% else %}
{% if lnd_ready %}
{% if lnbits_enabled %}
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="lnbits">LNbits</a>
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-lnbits">Disable</a>
{% if ckbunker_enabled %}
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="ckbunker">CKBunker</a>
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-ckbunker">Disable</a>
{% else %}
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-lnbits">Enable</a>
{% endif %}
{% endif %}
{% endif %}
</div>
</div>
<div class="app_tile">
<div class="app_status_icon {{ thunderhub_status_color }}" id="thunderhub_status_icon"></div>
<div class="app_logo"><img class="app_logo_icon" src="{{ url_for('static', filename="images/thunderhub.png")}}"/></div>
<div class="app_title">Thunderhub</div>
<div class="app_status" id="thunderhub_status">{{ thunderhub_status }}</div>
<div class="app_contents">
{% if product_key_skipped %}
Premium Feature
{% else %}
{% if lnd_ready %}
{% if thunderhub_enabled %}
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="thunderhub">Thunderhub</a>
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-thunderhub">Disable</a>
{% else %}
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-thunderhub">Enable</a>
{% endif %}
<a class="ui-button ui-widget ui-corner-all mynode_button" href="#" id="toggle-ckbunker">Enable</a>
{% endif %}
{% endif %}
</div>

View File

@ -27,7 +27,7 @@
{% endif %}
{% if not has_changed_password %}
<div class="upgrade_ad_main_page">
<div class="main_page_warning_block">
<p style="text-align: center;"><b>Warning!</b><br/>You appear to be using the default password! You should change it to something else on the <a href="/settings">settings</a> page.</p>
</div>
{% endif %}

View File

@ -10,7 +10,7 @@
<a class="ui-button ui-widget ui-corner-all mynode_button" href="/bitcoind">Manage</a>
</div>
</div>
<div style="width: 160px; padding-left: 10px; float: right;">
<div style="width: 230px; padding-left: 10px; float: right;">
<table style="font-size: 10px; width: 100%;" cellpadding="0" cellspacing="0">
<tr>
<td class="td_left_header">Height</td>
@ -50,7 +50,7 @@
<a class="ui-button ui-widget ui-corner-all mynode_button" href="/lnd">Manage</a>
</div>
</div>
<div style="width: 160px; padding-left: 10px; float: right;">
<div style="width: 230px; padding-left: 10px; float: right;">
<table style="font-size: 10px; width: 100%;" cellpadding="0" cellspacing="0">
<tr>
<td class="td_left_header">Peers</td>
@ -131,6 +131,14 @@
</div>
<div class="bitcoin_block_height" id="bitcoin_block_height_5">???</div>
</div>
<div class="bitcoin_block">
<div class="bitcoin_block_orange_square">
<div class="bitcoin_block_size" id="bitcoin_block_size_6">0.00 MB</div>
<div class="bitcoin_block_num_txs" id="bitcoin_block_num_txs_6">0 TXs</div>
<div class="bitcoin_block_time" id="bitcoin_block_time_6">999 min ago</div>
</div>
<div class="bitcoin_block_height" id="bitcoin_block_height_6">???</div>
</div>
</div>
</div>
</div>

View File

@ -156,6 +156,14 @@
update_status("thunderhub_status", data);
update_status_icon("thunderhub_status_icon", data);
});
$.getJSON("/api/get_service_status?service=ckbunker", function( data ) {
update_status("ckbunker_status", data);
update_status_icon("ckbunker_status_icon", data);
});
$.getJSON("/api/get_service_status?service=sphinxrelay", function( data ) {
update_status("sphinxrelay_status", data);
update_status_icon("sphinxrelay_status_icon", data);
});
$.getJSON("/api/get_service_status?service=tor", function( data ) {
update_status("tor_status", data);
update_status_icon("tor_status_icon", data);
@ -245,6 +253,19 @@
window.open(url,'_blank');
})
$("#ckbunker").on("click", function() {
port="9823"
if (location.protocol == "https:") {
port="9824"
}
url = location.protocol+'//'+location.hostname+':'+port
window.open(url,'_blank');
})
$("#sphinxrelay").on("click", function() {
alert("TODO???")
})
$("#btcrpcexplorer").on("click", function() {
port="3002"
if (location.protocol == "https:") {
@ -349,6 +370,14 @@
window.location.href="/toggle-thunderhub"
});
$("#toggle-ckbunker").on("click", function() {
window.location.href="/toggle-ckbunker"
});
$("#toggle-sphinxrelay").on("click", function() {
window.location.href="/toggle-sphinxrelay"
});
function lndconnect() {
$("#lndconnect_form").submit();
lndconnect_dialog.dialog( "close" );
@ -413,7 +442,7 @@
<div class="mynode_top_right_div">
{% if upgrade_available %}
<a class="ui-button ui-widget ui-corner-all mynode_back" href="/settings"><span class="ui-icon ui-icon-notice"></span>upgrade available&nbsp;</a>
<a class="ui-button ui-widget ui-corner-all mynode_back" href="/settings"><span class="ui-icon ui-icon-notice"></span>upgrade&nbsp;</a>
{% endif %}
<a class="ui-button ui-widget ui-corner-all mynode_back" id="https" title="Use HTTPS" style="display: none;" href="#">&nbsp;<span class="ui-icon ui-icon-locked"></span>&nbsp;</a>
<a class="ui-button ui-widget ui-corner-all mynode_back" href="/logout" title="Logout"><span class="ui-icon ui-icon-close"></span>&nbsp;</a>
@ -446,7 +475,7 @@
{% if product_key_skipped %}
<div class="main_header">Community Edition</div>
<div class="upgrade_ad_main_page">
<div class="main_page_warning_block" style="padding-left: 15px;">
<p>
You are currently running myNode Community Edition. Upgrading to myNode Premium provides:
<br/>
@ -518,7 +547,7 @@
</div>
{% if product_key_skipped %}
<div class="upgrade_ad_main_page">
<div class="main_page_warning_block">
<p style="text-align: center;"><b>Tip Address</b><br/>bc1q75z4fj946pqucfu9gasxdrzma0z4seh8f58sfd</p>
</div>
{% endif %}

View File

@ -100,7 +100,7 @@ def update_bitcoin_main_info_thread():
bitcoin_block_height = get_bitcoin_block_height()
mynode_block_height = get_mynode_block_height()
remaining = bitcoin_block_height - mynode_block_height
if remaining == 0 and bitcoin_block_height > 630000:
if remaining == 0 and bitcoin_block_height > 670000:
if not os.path.isfile(BITCOIN_SYNCED_FILE):
open(BITCOIN_SYNCED_FILE, 'a').close() # touch file
elif remaining > 18: