mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-12-25 14:08:07 +00:00
Add I2P; Better Network Control
This commit is contained in:
parent
2aa404d4b5
commit
10fe966bc7
|
@ -7,21 +7,34 @@ set -e
|
|||
bitcoin-cli getpeerinfo
|
||||
|
||||
# Give bitcoin some time to start
|
||||
sleep 2m
|
||||
sleep 1m
|
||||
|
||||
# Check if btc has peers
|
||||
while true; do
|
||||
echo "Checking Bitcoin peer count..."
|
||||
PEER_COUNT=$(bitcoin-cli getpeerinfo | grep "id" | wc -l)
|
||||
if [ "$PEER_COUNT" -lt "3" ]; then
|
||||
PEER_COUNT=$(bitcoin-cli getpeerinfo | jq '. | length')
|
||||
if [ "$PEER_COUNT" -lt "6" ]; then
|
||||
echo "$PEER_COUNT peers. Try adding one."
|
||||
|
||||
RANDOM_PEER=$(shuf /usr/share/mynode/bitcoin_peers.txt | head -n 1)
|
||||
echo -n "" > /tmp/new_peer
|
||||
if [ -f /mnt/hdd/mynode/settings/btc_ipv4_enabled ] || [ -f /home/bitcoin/.mynode/btc_ipv4_enabled ]; then
|
||||
RANDOM_PEER=$(shuf /usr/share/mynode/bitcoin_peers.txt | egrep "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | head -n 1)
|
||||
echo "$RANDOM_PEER" >> /tmp/new_peer
|
||||
fi
|
||||
if [ -f /mnt/hdd/mynode/settings/btc_tor_enabled ] || [ -f /home/bitcoin/.mynode/btc_tor_enabled ]; then
|
||||
RANDOM_PEER=$(shuf /usr/share/mynode/bitcoin_peers.txt | grep ".onion" | head -n 1)
|
||||
echo "$RANDOM_PEER" >> /tmp/new_peer
|
||||
fi
|
||||
if [ -f /mnt/hdd/mynode/settings/btc_i2p_enabled ] || [ -f /home/bitcoin/.mynode/btc_i2p_enabled ]; then
|
||||
RANDOM_PEER=$(shuf /usr/share/mynode/bitcoin_peers.txt | grep "b32.i2p:0" | head -n 1)
|
||||
echo "$RANDOM_PEER" >> /tmp/new_peer
|
||||
fi
|
||||
RANDOM_PEER=$(shuf /tmp/new_peer | head -n 1)
|
||||
|
||||
echo "Attempting to add peer $RANDOM_PEER"
|
||||
|
||||
bitcoin-cli addnode "$RANDOM_PEER" "onetry"
|
||||
|
||||
sleep 1m
|
||||
sleep 30s
|
||||
else
|
||||
echo "We have $PEER_COUNT peers!"
|
||||
sleep 60m
|
||||
|
|
|
@ -2,15 +2,34 @@
|
|||
|
||||
TOTAL_RAM_GB=$(free --giga | grep Mem | awk '{print $2}')
|
||||
|
||||
# Setup default settings
|
||||
if [ ! -f /mnt/hdd/mynode/settings/.btc_lnd_tor_enabled_defaulted ] && [ ! -f /home/bitcoin/.mynode/.btc_lnd_tor_enabled_defaulted ]; then
|
||||
touch /home/bitcoin/.mynode/.btc_lnd_tor_enabled_defaulted
|
||||
touch /mnt/hdd/mynode/settings/.btc_lnd_tor_enabled_defaulted
|
||||
touch /home/bitcoin/.mynode/btc_lnd_tor_enabled
|
||||
touch /mnt/hdd/mynode/settings/btc_lnd_tor_enabled
|
||||
# Setup default settings (new - 2022)
|
||||
if [ ! -f /mnt/hdd/mynode/settings/btc_network_settings_defaulted ] && [ ! -f /home/bitcoin/.mynode/btc_network_settings_defaulted ]; then
|
||||
|
||||
# based on old settings, set ipv4 or tor
|
||||
if [ -f /mnt/hdd/mynode/settings/.btc_lnd_tor_enabled_defaulted ] || [ -f /home/bitcoin/.mynode/.btc_lnd_tor_enabled_defaulted ]; then
|
||||
if [ -f /home/bitcoin/.mynode/btc_lnd_tor_enabled ] || [ -f /mnt/hdd/mynode/settings/btc_lnd_tor_enabled ]; then
|
||||
# Old settings indicate tor
|
||||
touch /home/bitcoin/.mynode/btc_tor_enabled
|
||||
touch /mnt/hdd/mynode/settings/btc_tor_enabled
|
||||
else
|
||||
# Old settings indicate ipv4
|
||||
touch /home/bitcoin/.mynode/btc_ipv4_enabled
|
||||
touch /mnt/hdd/mynode/settings/btc_ipv4_enabled
|
||||
fi
|
||||
else
|
||||
# Set new defaults
|
||||
touch /home/bitcoin/.mynode/btc_tor_enabled
|
||||
touch /mnt/hdd/mynode/settings/btc_tor_enabled
|
||||
touch /home/bitcoin/.mynode/btc_i2p_enabled
|
||||
touch /mnt/hdd/mynode/settings/btc_i2p_enabled
|
||||
fi
|
||||
|
||||
touch /mnt/hdd/mynode/settings/btc_network_settings_defaulted
|
||||
touch /home/bitcoin/.mynode/btc_network_settings_defaulted
|
||||
sync
|
||||
fi
|
||||
|
||||
|
||||
# Generate BTC Config
|
||||
if [ -f /mnt/hdd/mynode/settings/bitcoin_custom.conf ]; then
|
||||
# Use Custom Config
|
||||
|
@ -57,11 +76,17 @@ else
|
|||
sed -i "s/maxmempool=.*/maxmempool=50/g" /mnt/hdd/mynode/bitcoin/bitcoin.conf
|
||||
fi
|
||||
|
||||
# Append Tor/IP section (check new file or old file, should be migrated to new)
|
||||
if [ -f /mnt/hdd/mynode/settings/btc_lnd_tor_enabled ] || [ -f /home/bitcoin/.mynode/btc_lnd_tor_enabled ]; then
|
||||
cat /usr/share/mynode/bitcoin_tor.conf >> /mnt/hdd/mynode/bitcoin/bitcoin.conf
|
||||
else
|
||||
# Append network sections (IPv4 / Tor / I2P)
|
||||
if [ -f /mnt/hdd/mynode/settings/btc_ipv4_enabled ] || [ -f /home/bitcoin/.mynode/btc_ipv4_enabled ]; then
|
||||
cat /usr/share/mynode/bitcoin_ipv4.conf >> /mnt/hdd/mynode/bitcoin/bitcoin.conf
|
||||
else
|
||||
cat /usr/share/mynode/bitcoin_no_ipv4.conf >> /mnt/hdd/mynode/bitcoin/bitcoin.conf
|
||||
fi
|
||||
if [ -f /mnt/hdd/mynode/settings/btc_tor_enabled ] || [ -f /home/bitcoin/.mynode/btc_tor_enabled ]; then
|
||||
cat /usr/share/mynode/bitcoin_tor.conf >> /mnt/hdd/mynode/bitcoin/bitcoin.conf
|
||||
fi
|
||||
if [ -f /mnt/hdd/mynode/settings/btc_i2p_enabled ] || [ -f /home/bitcoin/.mynode/btc_i2p_enabled ]; then
|
||||
cat /usr/share/mynode/bitcoin_i2p.conf >> /mnt/hdd/mynode/bitcoin/bitcoin.conf
|
||||
fi
|
||||
|
||||
# Append Mainnet/Testnet section
|
||||
|
|
|
@ -1,5 +1,30 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Setup default settings (new - 2022)
|
||||
if [ ! -f /mnt/hdd/mynode/settings/lnd_network_settings_defaulted ] && [ ! -f /home/bitcoin/.mynode/lnd_network_settings_defaulted ]; then
|
||||
|
||||
# based on old settings, set ipv4 or tor
|
||||
if [ -f /mnt/hdd/mynode/settings/.btc_lnd_tor_enabled_defaulted ] || [ -f /home/bitcoin/.mynode/.btc_lnd_tor_enabled_defaulted ]; then
|
||||
if [ -f /home/bitcoin/.mynode/btc_lnd_tor_enabled ] || [ -f /mnt/hdd/mynode/settings/btc_lnd_tor_enabled ]; then
|
||||
# Old settings indicate tor only
|
||||
touch /home/bitcoin/.mynode/lnd_tor_enabled
|
||||
touch /mnt/hdd/mynode/settings/lnd_tor_enabled
|
||||
else
|
||||
# Old settings indicate ipv4 only
|
||||
touch /home/bitcoin/.mynode/lnd_ipv4_enabled
|
||||
touch /mnt/hdd/mynode/settings/lnd_ipv4_enabled
|
||||
fi
|
||||
else
|
||||
# Set new defaults
|
||||
touch /home/bitcoin/.mynode/lnd_tor_enabled
|
||||
touch /mnt/hdd/mynode/settings/lnd_tor_enabled
|
||||
fi
|
||||
|
||||
touch /mnt/hdd/mynode/settings/lnd_network_settings_defaulted
|
||||
touch /home/bitcoin/.mynode/lnd_network_settings_defaulted
|
||||
sync
|
||||
fi
|
||||
|
||||
# Setup Initial LND Node Name
|
||||
if [ ! -f /mnt/hdd/mynode/settings/.lndalias ]; then
|
||||
echo "mynodebtc.com [myNode]" > /mnt/hdd/mynode/settings/.lndalias
|
||||
|
@ -23,16 +48,22 @@ else
|
|||
cat /usr/share/mynode/lnd_watchtower_client.conf >> /mnt/hdd/mynode/lnd/lnd.conf
|
||||
fi
|
||||
|
||||
# Append Tor/IP section (check new file or old file, should be migrated to new)
|
||||
if [ -f /mnt/hdd/mynode/settings/btc_lnd_tor_enabled ] || [ -f /home/bitcoin/.mynode/btc_lnd_tor_enabled ]; then
|
||||
cat /usr/share/mynode/lnd_tor.conf >> /mnt/hdd/mynode/lnd/lnd.conf
|
||||
|
||||
# Upadte LND Tor stream isolation (true is default)
|
||||
if [ -f /mnt/hdd/mynode/settings/streamisolation_tor_disabled ]; then
|
||||
sed -i "s/tor.streamisolation=.*/tor.streamisolation=false/g" /mnt/hdd/mynode/lnd/lnd.conf
|
||||
fi
|
||||
else
|
||||
# Append Network Config (IPv4 / Tor)
|
||||
if [ -f /mnt/hdd/mynode/settings/lnd_ipv4_enabled ] || [ -f /home/bitcoin/.mynode/lnd_ipv4_enabled ]; then
|
||||
cat /usr/share/mynode/lnd_ipv4.conf >> /mnt/hdd/mynode/lnd/lnd.conf
|
||||
else
|
||||
cat /usr/share/mynode/lnd_no_ipv4.conf >> /mnt/hdd/mynode/lnd/lnd.conf
|
||||
fi
|
||||
if [ -f /mnt/hdd/mynode/settings/lnd_tor_enabled ] || [ -f /home/bitcoin/.mynode/lnd_tor_enabled ]; then
|
||||
cat /usr/share/mynode/lnd_tor.conf >> /mnt/hdd/mynode/lnd/lnd.conf
|
||||
else
|
||||
cat /usr/share/mynode/lnd_no_tor.conf >> /mnt/hdd/mynode/lnd/lnd.conf
|
||||
fi
|
||||
|
||||
|
||||
# Upadte LND Tor stream isolation (true is default)
|
||||
if [ -f /mnt/hdd/mynode/settings/streamisolation_tor_disabled ]; then
|
||||
sed -i "s/tor.streamisolation=.*/tor.streamisolation=false/g" /mnt/hdd/mynode/lnd/lnd.conf || true
|
||||
fi
|
||||
|
||||
# Append Mainnet/Testnet section
|
||||
|
|
|
@ -83,6 +83,8 @@ if ! skip_base_upgrades ; then
|
|||
if [ "$DEBIAN_VERSION" = "buster" ]; then
|
||||
grep -qxF "deb http://deb.debian.org/debian buster-backports main" /etc/apt/sources.list || echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
|
||||
fi
|
||||
# Add I2P Repo
|
||||
/bin/bash /usr/share/mynode/scripts/add_i2p_repo.sh
|
||||
|
||||
# Raspbian mirrors
|
||||
#if [ $IS_RASPI = 1 ]; then
|
||||
|
@ -132,7 +134,7 @@ if ! skip_base_upgrades ; then
|
|||
$TORIFY apt-get -y install libudev-dev libusb-1.0-0-dev python3-venv gunicorn sqlite3 libsqlite3-dev
|
||||
$TORIFY apt-get -y install torsocks python3-requests libsystemd-dev libjpeg-dev zlib1g-dev psmisc
|
||||
$TORIFY apt-get -y install hexyl libbz2-dev liblzma-dev netcat-openbsd hdparm iotop nut obfs4proxy
|
||||
$TORIFY apt-get -y install libpq-dev socat btrfs-progs
|
||||
$TORIFY apt-get -y install libpq-dev socat btrfs-progs i2pd
|
||||
|
||||
# Install software specific to debian version
|
||||
if [ "$DEBIAN_VERSION" == "bullseye" ]; then
|
||||
|
@ -1042,6 +1044,7 @@ systemctl enable docker_images
|
|||
systemctl enable glances
|
||||
systemctl enable webssh2
|
||||
systemctl enable tor
|
||||
systemctl enable i2pd
|
||||
systemctl enable loop
|
||||
systemctl enable pool
|
||||
systemctl enable rotate_logs
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
server=1
|
||||
daemon=1
|
||||
|
||||
# Bind to localhost and docker
|
||||
bind=127.0.0.1
|
||||
bind=172.17.0.1
|
||||
|
||||
# Needed for BTC-RPC-Explorer
|
||||
txindex=1
|
||||
|
||||
|
|
3
rootfs/standard/usr/share/mynode/bitcoin_i2p.conf
Normal file
3
rootfs/standard/usr/share/mynode/bitcoin_i2p.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Enable I2P
|
||||
onlynet=i2p
|
||||
i2psam=127.0.0.1:7656
|
|
@ -1,3 +1,5 @@
|
|||
# IPv4 only
|
||||
onlynet=ipv4
|
||||
listenonion=0
|
||||
#listenonion=0 #???
|
||||
|
||||
bind=0.0.0.0
|
3
rootfs/standard/usr/share/mynode/bitcoin_no_ipv4.conf
Normal file
3
rootfs/standard/usr/share/mynode/bitcoin_no_ipv4.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
# IPv4 Disabled
|
||||
dnsseed=0
|
||||
dns=0
|
File diff suppressed because it is too large
Load Diff
|
@ -1,13 +1,6 @@
|
|||
# Tor config
|
||||
proxy=127.0.0.1:9050
|
||||
listen=1
|
||||
|
||||
# Bind to localhost and docker
|
||||
bind=127.0.0.1
|
||||
bind=172.17.0.1
|
||||
|
||||
# Tor only (default)
|
||||
onlynet=onion
|
||||
dnsseed=0
|
||||
dns=0
|
||||
|
||||
|
||||
|
|
|
@ -2,6 +2,3 @@
|
|||
[Application Options]
|
||||
# Your router must support and enable UPnP
|
||||
nat=true
|
||||
|
||||
[Tor]
|
||||
tor.active=false
|
||||
|
|
4
rootfs/standard/usr/share/mynode/lnd_no_ipv4.conf
Normal file
4
rootfs/standard/usr/share/mynode/lnd_no_ipv4.conf
Normal file
|
@ -0,0 +1,4 @@
|
|||
|
||||
[Application Options]
|
||||
nat=false
|
||||
|
3
rootfs/standard/usr/share/mynode/lnd_no_tor.conf
Normal file
3
rootfs/standard/usr/share/mynode/lnd_no_tor.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
|
||||
[Tor]
|
||||
tor.active=false
|
|
@ -1,7 +1,4 @@
|
|||
|
||||
[Application Options]
|
||||
nat=false
|
||||
|
||||
[Tor]
|
||||
tor.active=true
|
||||
tor.v3=true
|
||||
|
|
67
rootfs/standard/usr/share/mynode/scripts/add_i2p_repo.sh
Normal file
67
rootfs/standard/usr/share/mynode/scripts/add_i2p_repo.sh
Normal file
|
@ -0,0 +1,67 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo "That script must be run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Fetch system release variables
|
||||
source /etc/os-release
|
||||
|
||||
function get_release {
|
||||
DIST=$ID
|
||||
case $ID in
|
||||
debian|ubuntu|raspbian)
|
||||
if [[ -n $DEBIAN_CODENAME ]]; then
|
||||
VERSION_CODENAME=$DEBIAN_CODENAME
|
||||
fi
|
||||
|
||||
if [[ -n $UBUNTU_CODENAME ]]; then
|
||||
VERSION_CODENAME=$UBUNTU_CODENAME
|
||||
fi
|
||||
|
||||
if [[ -z $VERSION_CODENAME ]]; then
|
||||
echo "Couldn't find VERSION_CODENAME in your /etc/os-release file. Did your system supported? Please report issue to me by writing to email: 'r4sas <at> i2pd.xyz'"
|
||||
exit 1
|
||||
fi
|
||||
RELEASE=$VERSION_CODENAME
|
||||
;;
|
||||
*)
|
||||
if [[ -z $ID_LIKE || "$ID_LIKE" != "debian" && "$ID_LIKE" != "ubuntu" ]]; then
|
||||
echo "Your system is not supported by this script. Currently it supports debian-like and ubuntu-like systems."
|
||||
exit 1
|
||||
else
|
||||
DIST=$ID_LIKE
|
||||
case $ID_LIKE in
|
||||
debian)
|
||||
if [[ "$ID" == "kali" ]]; then
|
||||
if [[ "$VERSION" == "2019"* || "$VERSION" == "2020"* ]]; then
|
||||
RELEASE="buster"
|
||||
elif [[ "$VERSION" == "2021"* || "$VERSION" == "2022"* ]]; then
|
||||
RELEASE="bullseye"
|
||||
fi
|
||||
else
|
||||
RELEASE=$DEBIAN_CODENAME
|
||||
fi
|
||||
;;
|
||||
ubuntu)
|
||||
RELEASE=$UBUNTU_CODENAME
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if [[ -z $RELEASE ]]; then
|
||||
echo "Couldn't detect your system release. Please report issue to me by writing to email: 'r4sas <at> i2pd.xyz'"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
get_release
|
||||
|
||||
echo "Importing signing key"
|
||||
wget -q -O - https://repo.i2pd.xyz/r4sas.gpg | apt-key --keyring /etc/apt/trusted.gpg.d/i2pd.gpg add -
|
||||
|
||||
echo "Adding APT repository"
|
||||
echo "deb https://repo.i2pd.xyz/$DIST $RELEASE main" > /etc/apt/sources.list.d/i2pd.list
|
||||
echo "deb-src https://repo.i2pd.xyz/$DIST $RELEASE main" >> /etc/apt/sources.list.d/i2pd.list
|
|
@ -128,7 +128,7 @@ def update_bitcoin_other_info():
|
|||
for p in peerdata:
|
||||
peer = p
|
||||
|
||||
peer["pingtime"] = int(p["pingtime"] * 1000) if ("pingtime" in p) else "N/A"
|
||||
peer["pingtime"] = int(p["pingtime"]) if ("pingtime" in p) else "N/A"
|
||||
peer["tx"] = "{:.2f}".format(float(p["bytessent"]) / 1000 / 1000) if ("bytessent" in p) else "N/A"
|
||||
peer["rx"] = "{:.2f}".format(float(p["bytesrecv"]) / 1000 / 1000) if ("bytesrecv" in p) else "N/A"
|
||||
peer["minping"] = str(p["minping"]) if ("minping" in p) else "N/A"
|
||||
|
|
|
@ -69,6 +69,9 @@ def factory_reset():
|
|||
|
||||
# Delete settings files on SD card
|
||||
os.system("rm -f /home/bitcoin/.mynode/.btc_lnd_tor_enabled_defaulted")
|
||||
os.system("rm -f /home/bitcoin/.mynode/btc_lnd_tor_enabled_defaulted")
|
||||
os.system("rm -f /home/bitcoin/.mynode/btc_network_settings_defaulted")
|
||||
os.system("rm -f /home/bitcoin/.mynode/lnd_network_settings_defaulted")
|
||||
os.system("rm -f /home/bitcoin/.mynode/.product_key")
|
||||
os.system("rm -f /home/bitcoin/.mynode/ui.json")
|
||||
|
||||
|
|
|
@ -55,12 +55,15 @@ def bitcoin_status_page():
|
|||
# Peers
|
||||
peers = peerdata
|
||||
|
||||
# Local address
|
||||
local_address = "..."
|
||||
# Bitcoin address
|
||||
addresses = ["..."]
|
||||
if networkdata != None:
|
||||
local_address = "not none"
|
||||
addresses = ["no local addresses"]
|
||||
if ("localaddresses" in networkdata) and (len(networkdata["localaddresses"]) > 0):
|
||||
local_address = "{}:{}".format(networkdata["localaddresses"][0]["address"], networkdata["localaddresses"][0]["port"])
|
||||
addresses = []
|
||||
for addr in networkdata["localaddresses"]:
|
||||
addresses.append("{}:{}".format(addr["address"], addr["port"]))
|
||||
|
||||
|
||||
except Exception as e:
|
||||
templateData = {
|
||||
|
@ -76,7 +79,7 @@ def bitcoin_status_page():
|
|||
"title": "myNode Bitcoin Status",
|
||||
"blocks": blocks,
|
||||
"peers": peers,
|
||||
"local_address": local_address,
|
||||
"addresses": addresses,
|
||||
"difficulty": get_bitcoin_difficulty(),
|
||||
"block_num": info["blocks"],
|
||||
"header_num": info["headers"],
|
||||
|
|
|
@ -95,7 +95,11 @@ def page_settings():
|
|||
"download_rate": download_rate,
|
||||
"upload_rate": upload_rate,
|
||||
"btcrpcexplorer_token_enabled": is_btcrpcexplorer_token_enabled(),
|
||||
"is_btc_lnd_tor_enabled": settings_file_exists("btc_lnd_tor_enabled"),
|
||||
"is_btc_ipv4_enabled": settings_file_exists("btc_ipv4_enabled"),
|
||||
"is_btc_tor_enabled": settings_file_exists("btc_tor_enabled"),
|
||||
"is_btc_i2p_enabled": settings_file_exists("btc_i2p_enabled"),
|
||||
"is_lnd_ipv4_enabled": settings_file_exists("lnd_ipv4_enabled"),
|
||||
"is_lnd_tor_enabled": settings_file_exists("lnd_tor_enabled"),
|
||||
"is_tor_repo_enabled": not settings_file_exists("tor_repo_disabled"),
|
||||
"is_aptget_tor_enabled": settings_file_exists("torify_apt_get"),
|
||||
"is_streamisolation_tor_enabled": not settings_file_exists("streamisolation_tor_disabled"),
|
||||
|
@ -718,6 +722,26 @@ def page_lnd_reset_lnd_watchtower():
|
|||
flash("Restarting lnd...", category="message")
|
||||
return redirect("/settings")
|
||||
|
||||
@mynode_settings.route("/settings/save-network-settings", methods=['POST'])
|
||||
def page_save_network_settings():
|
||||
check_logged_in()
|
||||
|
||||
check_and_mark_reboot_action("save_network_settings")
|
||||
|
||||
network_settings = ["btc_ipv4", "btc_tor", "btc_i2p", "lnd_ipv4", "lnd_tor"]
|
||||
for s in network_settings:
|
||||
delete_settings_file(s + "_enabled")
|
||||
|
||||
for s in network_settings:
|
||||
if request.form.get(s + "_checkbox"):
|
||||
create_settings_file(s + "_enabled")
|
||||
|
||||
# Trigger reboot
|
||||
t = Timer(1.0, reboot_device)
|
||||
t.start()
|
||||
|
||||
return redirect("/rebooting")
|
||||
|
||||
@mynode_settings.route("/settings/reset-tor", methods=['POST'])
|
||||
def page_reset_tor():
|
||||
check_logged_in()
|
||||
|
|
|
@ -230,7 +230,11 @@
|
|||
<div class="app_tile_row">
|
||||
<div class="info_tile">
|
||||
<div class="info_tile_header">Local Bitcoin Address / Port</div>
|
||||
<div class="info_tile_contents">{{local_address}}</div>
|
||||
<div class="info_tile_contents" style="font-size: 12px">
|
||||
{% for addr in addresses %}
|
||||
<p>{{addr}}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<div class="main_header">Bitcoin Config</div>
|
||||
|
||||
<div class="text_block">
|
||||
You can edit the Bitcoin config. However, using your own config will prevent any future automatic updates and may have adverse effects.
|
||||
You can edit the Bitcoin config. However, using your own config will prevent any future automatic updates and may have adverse effects. Many other settings will have no effect.
|
||||
<br/><br/>
|
||||
Saving will reboot your device.
|
||||
<br/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<div class="main_header">LND Custom Config</div>
|
||||
|
||||
<div class="text_block">
|
||||
You can edit the LND config. However, using your own config will prevent any future automatic updates and may have adverse effects.
|
||||
You can edit the LND config. However, using your own config will prevent any future automatic updates and may have adverse effects. Many other settings will have no effect.
|
||||
<br/><br/>
|
||||
Saving will reboot your device.
|
||||
<br/>
|
||||
|
|
|
@ -505,20 +505,6 @@
|
|||
window.location.href='/settings/modify-swap?size='+swap_choice
|
||||
});
|
||||
|
||||
$('#btc_lnd_tor_checkbox').change(function () {
|
||||
$("#btc_lnd_tor").show();
|
||||
});
|
||||
$("#btc_lnd_tor").on("click", function() {
|
||||
checked=$('#btc_lnd_tor_checkbox').is(":checked")
|
||||
val = "0"
|
||||
if (checked)
|
||||
{
|
||||
val = "1"
|
||||
}
|
||||
$('#loading_spinner_overlay').fadeIn();
|
||||
window.location.href='/settings/toggle_setting?name=btc_lnd_tor_enabled&reboot=1&enable='+val
|
||||
});
|
||||
|
||||
$('#streamisolation_tor_checkbox').change(function () {
|
||||
$("#streamisolation_tor").show();
|
||||
});
|
||||
|
@ -907,16 +893,73 @@
|
|||
<button id="reboot-device" class="ui-button ui-widget ui-corner-all settings_button">Reboot Device</button>
|
||||
<button id="shutdown-device" class="ui-button ui-widget ui-corner-all settings_button">Shutdown Device</button>
|
||||
|
||||
<div class="divider"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="settings_block">
|
||||
<a id="firewall"></a>
|
||||
<div class="settings_block_header">Networking</div>
|
||||
|
||||
<div class="settings_block_subheader">Bitcoin and Lightning Networks</div>
|
||||
You can use various networks for Bitcoin and Lightning. Tor and I2P increase privacy, however, they can slow down block download
|
||||
and cause less consistent connections.
|
||||
<br/><br/>
|
||||
Saving will trigger a reboot.
|
||||
<br/><br/>
|
||||
|
||||
<form action="/settings/save-network-settings" method="POST">
|
||||
<table border="0" style="font-size: 14px;">
|
||||
<tr>
|
||||
<td width="100px"></td>
|
||||
<td width="80px"><b>Clearnet</b></td>
|
||||
<td width="80px"><b>Tor</b></td>
|
||||
<td width="80px"><b>I2P</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Bitcoin</b></td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input type="checkbox" name="btc_ipv4_checkbox" {% if is_btc_ipv4_enabled %}checked{% endif %}>
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input type="checkbox" name="btc_tor_checkbox" {% if is_btc_tor_enabled %}checked{% endif %}>
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input type="checkbox" name="btc_i2p_checkbox" {% if is_btc_i2p_enabled %}checked{% endif %}>
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Lightning</b></td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input type="checkbox" name="lnd_ipv4_checkbox" {% if is_lnd_ipv4_enabled %}checked{% endif %}>
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input type="checkbox" name="lnd_tor_checkbox" {% if is_lnd_tor_enabled %}checked{% endif %}>
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
N/A
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<input type="submit" id="btc_lnd_networks_save" class="ui-button ui-widget ui-corner-all" value="Save"/>
|
||||
</form>
|
||||
|
||||
<div class="settings_block_subheader">Download Debug Logs</div>
|
||||
This will download all recent logs from your myNode. This can be helpful for debugging issues.
|
||||
<br/>
|
||||
It may take about one minute to gather and download the logs.
|
||||
<br/>
|
||||
Do not share these logs in a public place. They may contain sensitive information.
|
||||
<br/>
|
||||
<a href="/settings/mynode_logs.tar.gz" class="ui-button ui-widget ui-corner-all settings_button">Download Logs</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -1071,68 +1114,7 @@
|
|||
|
||||
<div class="settings_block">
|
||||
<a id="firewall"></a>
|
||||
<div class="settings_block_header">Networking</div>
|
||||
|
||||
<div class="settings_block_subheader">Bitcoin and Lightning Networks</div>
|
||||
You can use various networks for Bitcoin and Lightning. Tor and I2P increase privacy, however, they can slow down block download,
|
||||
and Lightning may have less consistent connections. If you have customized your Bitcoin or LND config, this setting has no effect.
|
||||
<br/><br/>
|
||||
Saving will trigger a reboot.
|
||||
<br/><br/>
|
||||
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><b>Clearnet</b></td>
|
||||
<td><b>Tor</b></td>
|
||||
<td><b>I2P</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Bitcoin</b></td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="btc_ipv4_checkbox" {% if is_btc_ipv4_enabled %}checked{% endif %}>
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="btc_tor_checkbox" {% if is_btc_tor_enabled %}checked{% endif %}>
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="btc_i2p_checkbox" {% if is_btc_i2p_enabled %}checked{% endif %}>
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Lightning</b></td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="lnd_ipv4_checkbox" {% if is_lnd_ipv4_enabled %}checked{% endif %}>
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="lnd_tor_checkbox" {% if is_lnd_tor_enabled %}checked{% endif %}>
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
N/A
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/><br/>
|
||||
<button id="btc_lnd_networks_save" class="ui-button ui-widget ui-corner-all">Save</button>
|
||||
|
||||
|
||||
<div class="divider"></div>
|
||||
<div class="settings_block_header">Firewall</div>
|
||||
|
||||
<div class="settings_block_subheader">Firewall Rules</div>
|
||||
Show the current firewall configuration.
|
||||
|
@ -1214,7 +1196,7 @@
|
|||
|
||||
<div class="divider"></div>
|
||||
|
||||
{% if is_btc_lnd_tor_enabled %}
|
||||
{% if is_lnd_tor_enabled %}
|
||||
<div class="settings_block_subheader">Use Tor Stream Isolation for LND</div>
|
||||
When using tor, enable stream isolation for LND. This increases privacy, but it can take significant resources with large numbers of lightning channels.
|
||||
<br/><br/>
|
||||
|
@ -1319,6 +1301,17 @@
|
|||
<a id="advanced"></a>
|
||||
<div class="settings_block_header">Advanced</div>
|
||||
|
||||
<div class="settings_block_subheader">Download Debug Logs</div>
|
||||
This will download all recent logs from your myNode. This can be helpful for debugging issues.
|
||||
<br/>
|
||||
It may take about one minute to gather and download the logs.
|
||||
<br/>
|
||||
Do not share these logs in a public place. They may contain sensitive information.
|
||||
<br/>
|
||||
<a href="/settings/mynode_logs.tar.gz" class="ui-button ui-widget ui-corner-all settings_button">Download Logs</a>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="settings_block_subheader">Toggle Testnet</div>
|
||||
Testnet can be enabled for Bitcoin and Lightning, which can be used to test various features, but may cause other applications to
|
||||
fail or become unstable if enabled. This testnet toggle does not work if you have customized your bitcoin or lnd configs. This will
|
||||
|
|
|
@ -66,11 +66,11 @@
|
|||
<div class="app_tile_row">
|
||||
<div class="info_tile">
|
||||
<div class="info_tile_header">Bitcoin</div>
|
||||
<div class="info_tile_contents">{% if is_btc_lnd_tor_enabled %}Tor Enabled{% else %}Tor Disabled{%endif%}</div>
|
||||
<div class="info_tile_contents">{% if is_btc_tor_enabled %}Tor Enabled{% else %}Tor Disabled{%endif%}</div>
|
||||
</div>
|
||||
<div class="info_tile">
|
||||
<div class="info_tile_header">Lightning</div>
|
||||
<div class="info_tile_contents">{% if is_btc_lnd_tor_enabled %}Tor Enabled{% else %}Tor Disabled{%endif%}</div>
|
||||
<div class="info_tile_contents">{% if is_lnd_tor_enabled %}Tor Enabled{% else %}Tor Disabled{%endif%}</div>
|
||||
</div>
|
||||
<div class="info_tile">
|
||||
<div class="info_tile_header">Version</div>
|
||||
|
|
|
@ -103,7 +103,8 @@ def page_tor():
|
|||
templateData = {
|
||||
"title": "myNode Tor Services",
|
||||
"version": get_tor_version(),
|
||||
"is_btc_lnd_tor_enabled": settings_file_exists("btc_lnd_tor_enabled"),
|
||||
"is_btc_tor_enabled": settings_file_exists("btc_tor_enabled"),
|
||||
"is_lnd_tor_enabled": settings_file_exists("lnd_tor_enabled"),
|
||||
"v3_services": v3_services,
|
||||
"fully_noded_link": fully_noded_link,
|
||||
"ui_settings": read_ui_settings()
|
||||
|
|
|
@ -168,6 +168,8 @@ fi
|
|||
if [ "$DEBIAN_VERSION" = "buster" ]; then
|
||||
grep -qxF "deb http://deb.debian.org/debian buster-backports main" /etc/apt/sources.list || echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
|
||||
fi
|
||||
# Add I2P Repo
|
||||
/bin/bash $TMP_INSTALL_PATH/usr/share/mynode/scripts/add_i2p_repo.sh
|
||||
|
||||
# Import Keys
|
||||
curl https://keybase.io/roasbeef/pgp_keys.asc | gpg --import
|
||||
|
@ -215,7 +217,7 @@ apt-get -y install openjdk-11-jre libevent-dev ncurses-dev
|
|||
apt-get -y install zlib1g-dev libudev-dev libusb-1.0-0-dev python3-venv gunicorn
|
||||
apt-get -y install sqlite3 libsqlite3-dev torsocks python3-requests libsystemd-dev
|
||||
apt-get -y install libjpeg-dev zlib1g-dev psmisc hexyl libbz2-dev liblzma-dev netcat-openbsd
|
||||
apt-get -y install hdparm iotop nut obfs4proxy libpq-dev socat btrfs-progs
|
||||
apt-get -y install hdparm iotop nut obfs4proxy libpq-dev socat btrfs-progs i2pd
|
||||
|
||||
# Install packages dependent on Debian release
|
||||
if [ "$DEBIAN_VERSION" == "bullseye" ]; then
|
||||
|
@ -944,6 +946,7 @@ systemctl enable redis-server
|
|||
systemctl enable tls_proxy
|
||||
systemctl enable rtl
|
||||
systemctl enable tor
|
||||
systemctl enable i2pd
|
||||
systemctl enable invalid_block_check
|
||||
systemctl enable usb_driver_check
|
||||
systemctl enable docker_images
|
||||
|
|
Loading…
Reference in New Issue
Block a user