diff --git a/rootfs/standard/usr/bin/mynode_firewall.sh b/rootfs/standard/usr/bin/mynode_firewall.sh index aed851f3..b250dee6 100755 --- a/rootfs/standard/usr/bin/mynode_firewall.sh +++ b/rootfs/standard/usr/bin/mynode_firewall.sh @@ -74,6 +74,17 @@ ufw allow 61209 comment 'allow Glances HTTPS' ufw allow from 127.0.0.1 comment 'allow from localhost' #ufw allow from ::1 comment 'allow from localhost' +# Allow all local traffic +if [ -f /mnt/hdd/mynode/settings/local_traffic_allowed ]; then + ufw allow from 10.0.0.0/8 + ufw allow from 192.168.0.0/16 + ufw allow from 172.16.0.0/12 +else + ufw delete allow from 10.0.0.0/8 + ufw delete allow from 192.168.0.0/16 + ufw delete allow from 172.16.0.0/12 +fi + # Open ports for additional apps mynode-manage-apps openports diff --git a/rootfs/standard/var/pynode/device_info.py b/rootfs/standard/var/pynode/device_info.py index cecb9509..0e261599 100644 --- a/rootfs/standard/var/pynode/device_info.py +++ b/rootfs/standard/var/pynode/device_info.py @@ -1009,6 +1009,11 @@ def delete_lnd_data(): os.system("rm -rf /home/admin/.lnd/") return True +def delete_lnd_watchtower_data(): + os.system("rm -rf /mnt/hdd/mynode/lnd/data/graph/mainnet/wtclient.db") + os.system("rm -rf /mnt/hdd/mynode/lnd/data/graph/mainnet/wtclient.db.last-compacted") + return True + #================================== # Mainnet / Testnet Functions diff --git a/rootfs/standard/var/www/mynode/settings.py b/rootfs/standard/var/www/mynode/settings.py index a5a69d24..cb2b8f98 100644 --- a/rootfs/standard/var/www/mynode/settings.py +++ b/rootfs/standard/var/www/mynode/settings.py @@ -83,6 +83,7 @@ def page_settings(): "is_bitcoin_synced": is_bitcoin_synced(), "is_installing_docker_images": is_installing_docker_images(), "firewall_rules": get_firewall_rules(), + "is_local_traffic_allowed": settings_file_exists("local_traffic_allowed"), "is_testnet_enabled": is_testnet_enabled(), "is_quicksync_disabled": not is_quicksync_enabled(), "netdata_enabled": is_service_enabled("netdata"), @@ -742,6 +743,19 @@ def page_lnd_delete_wallet(): } return render_template('reboot.html', **templateData) +@mynode_settings.route("/settings/delete-lnd-wallet", methods=['POST']) +def page_lnd_delete_watchtower(): + check_logged_in() + + # Successful Auth + delete_lnd_watchtower_data() + + # Restart LND + restart_lnd() + + # Wait until device is restarted + flash("Restarting lnd...", category="message") + return redirect("/settings") @mynode_settings.route("/settings/reset-tor", methods=['POST']) def page_reset_tor(): @@ -1188,5 +1202,25 @@ def page_toggle_setting(): flash("Error Updating Setting", category="error") return redirect("/settings") + # Restart service if necessary + restart_service = request.args.get('restart_service') + if restart_service == "1": + # TODO: Add if necessary + pass + + # Reboot if necessary + reboot = request.args.get('reboot') + if reboot == "1": + t = Timer(1.0, reboot_device) + t.start() + + templateData = { + "title": "myNode Reboot", + "header_text": "Restarting", + "subheader_text": "This will take several minutes...", + "ui_settings": read_ui_settings() + } + return render_template('reboot.html', **templateData) + flash("Setting Updated", category="message") return redirect("/settings") \ No newline at end of file diff --git a/rootfs/standard/var/www/mynode/templates/settings.html b/rootfs/standard/var/www/mynode/templates/settings.html index a41ce4db..afbc692f 100644 --- a/rootfs/standard/var/www/mynode/templates/settings.html +++ b/rootfs/standard/var/www/mynode/templates/settings.html @@ -58,6 +58,17 @@ delete_lnd_wallet_dialog.dialog( "open" ); }); + $("#delete_lnd_watchtower").on("click", function() { + var okFunction = function() { + window.location.href="/settings/reset-lnd-watchtower" + } + openConfirmDialog("confirm-dialog", + "Reset Lightning Watchtower", + "Resetting the Lightning watchtower will erase watchtower settings and restart LND. "+ + "Would you still like to reset Lightning watchtower data?", + okFunction) + }); + function resetTor() { $("#reset_tor_form").submit(); @@ -87,7 +98,6 @@ $("#reset-blockchain").on("click", function() { - // Enable electrs var okFunction = function() { window.location.href="/settings/reset-blockchain" } @@ -100,7 +110,6 @@ }); $("#restart-quicksync").on("click", function() { - // Enable electrs var okFunction = function() { window.location.href="/settings/restart-quicksync" } @@ -504,14 +513,12 @@ }); $("#randomize_balances_button").on("click", function() { enabled=$('#randomize_balances_checkbox').is(":checked") + val = "0" if (enabled) { - window.location.href='/settings/toggle_setting?name=randomize_balances&enable=1' - } - else - { - window.location.href='/settings/toggle_setting?name=randomize_balances&enable=0' + val = "1" } + window.location.href='/settings/toggle_setting?name=randomize_balances&enable='+val }); $('#hide_password_warning_checkbox').change(function () { @@ -519,14 +526,12 @@ }); $("#hide_password_warning_button").on("click", function() { enabled=$('#hide_password_warning_checkbox').is(":checked") + val = "0" if (enabled) { - window.location.href='/settings/toggle_setting?name=hide_password_warning&enable=1' - } - else - { - window.location.href='/settings/toggle_setting?name=hide_password_warning&enable=0' + val = "1" } + window.location.href='/settings/toggle_setting?name=hide_password_warning&enable='+val }); $('#https_forced_checkbox').change(function () { @@ -544,6 +549,19 @@ } }); + $('#local_traffic_allowed_checkbox').change(function () { + $("#local_traffic_allowed").show(); + }); + $("#local_traffic_allowed").on("click", function() { + enabled=$('#local_traffic_allowed_checkbox').is(":checked") + val = "0" + if (enabled) + { + val = "1" + } + window.location.href='/settings/toggle_setting?name=local_traffic_allowed&reboot=1&enable='+val + }); + $('#btcrpcexplorer_token_checkbox').change(function () { $("#btcrpcexplorer_token").show(); }); @@ -830,26 +848,6 @@ -
- -
Firewall
- -
Rules
- Show the current firewall configuration. -
- - - -
- -
Reset
- Resetting the firewall will disable and reenable the firewall and then reboot the device. -
- Reset Firewall - -
- -
Bitcoin
@@ -912,6 +910,14 @@ Advanced: This will delete your Lightning Wallet. It will delete both mainnet and testnet wallets if you have them.
+ +
+ +
Reset Watchtower Info
+ Advanced: This will reset the Watchtower information. This can be used if LND is having issues after adding watchtowers. +
+ +
@@ -983,6 +989,39 @@ +
+ +
Firewall
+ +
Rules
+ Show the current firewall configuration. +
+ + + +
+ +
Allow All Local Network Traffic
+ This will allow all local network traffic from 10.0.0.0/8, 192.168.0.0/16, and 172.16.0.0/12. This can be + helpful if you are having NAT-PMP or UPnP issues with LND. This will reboot the device. +

+ +

+ + +
+ +
Reset
+ Resetting the firewall will disable and reenable the firewall and then reboot the device. +
+ Reset Firewall + +
+ +
Tor