Add HTTPS option for GUI

This commit is contained in:
Taylor Helsper 2019-10-18 22:39:29 -05:00
parent 71ab3a61f4
commit 755a5cdfec
6 changed files with 52 additions and 8 deletions

View File

@ -0,0 +1,22 @@
# myNode www service
# /etc/systemd/system/www.service
[Unit]
Description=Proxy for HTTPS
Wants=www.service
After=www.service
[Service]
Type=simple
KillMode=process
TimeoutSec=30
Restart=always
RestartSec=10
ExecStartPre=/usr/bin/mynode_gen_cert.sh https
ExecStart=/usr/sbin/hitch -u bitcoin -g bitcoin --tls --backend=[127.0.0.1]:80 --frontend=[0.0.0.0]:443 /home/bitcoin/.mynode/https/myNode.local.pem
User=root
Group=root
[Install]
WantedBy=multi-user.target

View File

@ -1,13 +1,22 @@
#!/bin/bash
# Main variables
OUTPUT_DIR="/home/bitcoin/.mynode/electrs"
HDD_DIR="/mnt/hdd/mynode/settings/electrs"
domain=myNode.local
commonname=myNode.local
OUTPUT_DIR_BASE="/home/bitcoin/.mynode"
HDD_DIR_BASE="/mnt/hdd/mynode/settings"
mkdir -p $OUTPUT_DIR_BASE
mkdir -p $HDD_DIR_BASE
OUTPUT_DIR="${OUTPUT_DIR_BASE}/electrs"
HDD_DIR="${HDD_DIR_BASE}/electrs"
if [ ! -z "$1" ]; then
OUTPUT_DIR="${OUTPUT_DIR_BASE}/$1"
HDD_DIR="${HDD_DIR_BASE}/$1"
fi
mkdir -p $OUTPUT_DIR
mkdir -p $HDD_DIR
domain=myNode.local
commonname=myNode.local
# Check for files on HDD and move to SD
if [ ! -f $OUTPUT_DIR/$domain.pem ] && [ -f $HDD_DIR/$domain.pem ]; then

View File

@ -192,6 +192,7 @@ fi
systemctl enable firewall
systemctl enable invalid_block_check
systemctl enable usb_driver_check
systemctl enable tls_proxy_https
# Disable any old services
sudo systemctl disable hitch

View File

@ -40,7 +40,7 @@ a:active {
left: 20px;
}
.mynode_upgrade_div {
.mynode_top_right_div {
position: fixed;
top: 20px;
right: 20px;

View File

@ -114,6 +114,15 @@
lndconnect_dialog.dialog( "close" );
});
$("#https").on("click", function() {
location.href = 'https:' + window.location.href.substring(window.location.protocol.length);
});
// Show HTTPS button
if (location.protocol != 'https:') {
$("#https").show();
}
});
</script>
</head>
@ -121,11 +130,13 @@
<body>
<div class="logo_header"><a href="/"><img class="logo_image" src="{{ url_for('static', filename="images/logo.png")}}"/></a></div>
{% if upgrade_available %}
<div class="mynode_upgrade_div">
<div class="mynode_top_right_div">
<a class="ui-button ui-widget ui-corner-all mynode_back" id="https" style="display: none;" href="#">&nbsp;<span class="ui-icon ui-icon-locked"></span>&nbsp;</a>
{% 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>
{% endif %}
</div>
{% endif %}
{% include 'includes/message_display.html' %}

View File

@ -400,6 +400,7 @@ systemctl enable mongodb
#systemctl enable lndhub # DISABLED BY DEFAULT
#systemctl enable btc_rpc_explorer # DISABLED BY DEFAULT
systemctl enable tls_proxy
systemctl enable tls_proxy_https
systemctl enable rtl
systemctl enable lnd_admin
systemctl enable tor