def page_settings(): check_logged_in() current_version = get_current_version() latest_version = get_latest_version() current_beta_version = get_current_beta_version() latest_beta_version = get_latest_beta_version() changelog = get_device_changelog() serial_number = get_device_serial() device_type = get_device_type() device_arch = get_device_arch() device_ram = get_device_ram() product_key = get_product_key() pk_skipped = skipped_product_key() pk_error = not is_valid_product_key() uptime = get_system_uptime() date = get_system_date() local_ip = get_local_ip() # Get QuickSync Rates upload_rate = 100 download_rate = 100 try: upload_rate = subprocess.check_output( ["cat", "/mnt/hdd/mynode/settings/quicksync_upload_rate"]) download_rate = subprocess.check_output([ "cat", "/mnt/hdd/mynode/settings/quicksync_background_download_rate" ]) except: upload_rate = 100 download_rate = 100 logout_time_days, logout_time_hours = get_flask_session_timeout() templateData = { "title": "myNode Settings", "apps": get_all_applications(order_by="alphabetic"), "password_message": "", "current_version": current_version, "latest_version": latest_version, "current_beta_version": current_beta_version, "latest_beta_version": latest_beta_version, "has_checkin_error": has_checkin_error(), "upgrade_error": did_upgrade_fail(), "upgrade_log": get_recent_upgrade_log(), "upgrade_logs": get_all_upgrade_logs(), "serial_number": serial_number, "device_type": device_type, "device_arch": device_arch, "device_ram": device_ram, "swap_size": get_swap_size(), "product_key": product_key, "product_key_skipped": pk_skipped, "product_key_error": pk_error, "changelog": changelog, "is_https_forced": is_https_forced(), "logout_time_days": logout_time_days, "logout_time_hours": logout_time_hours, "using_bitcoin_custom_config": using_bitcoin_custom_config(), "using_lnd_custom_config": using_lnd_custom_config(), "is_bitcoin_synced": is_bitcoin_synced(), "is_installing_docker_images": is_installing_docker_images(), "firewall_rules": get_firewall_rules(), "is_testnet_enabled": is_testnet_enabled(), "is_quicksync_disabled": not is_quicksync_enabled(), "netdata_enabled": is_service_enabled("netdata"), "is_uploader_device": is_uploader(), "download_rate": download_rate, "upload_rate": upload_rate, "is_btc_lnd_tor_enabled": is_btc_lnd_tor_enabled(), "is_aptget_tor_enabled": is_aptget_tor_enabled(), "skip_fsck": skip_fsck(), "uptime": uptime, "date": date, "local_ip": local_ip, "throttled_data": get_throttled_data(), "oom_error": has_oom_error(), "oom_info": get_oom_error_info(), "drive_usage": get_drive_usage(), "cpu_usage": get_cpu_usage(), "ram_usage": get_ram_usage(), "device_temp": get_device_temp(), "ui_settings": read_ui_settings() } return render_template('settings.html', **templateData)
def page_settings(): check_logged_in() current_version = get_current_version() latest_version = get_latest_version() current_beta_version = get_current_beta_version() latest_beta_version = get_latest_beta_version() changelog = get_device_changelog() serial_number = get_device_serial() device_type = get_device_type() device_ram = get_device_ram() product_key = get_product_key() pk_skipped = skipped_product_key() pk_error = not is_valid_product_key() uptime = get_system_uptime() date = get_system_date() local_ip = get_local_ip() # Get Startup Status startup_status_log = get_journalctl_log("mynode") # Get QuickSync Status quicksync_enabled = is_quicksync_enabled() quicksync_status = "Disabled" quicksync_status_color = "gray" quicksync_status_log = "DISABLED" if quicksync_enabled: quicksync_status = get_service_status_basic_text("quicksync") quicksync_status_color = get_service_status_color("quicksync") try: quicksync_status_log = subprocess.check_output( ["mynode-get-quicksync-status"]).decode("utf8") except: quicksync_status_log = "ERROR" # Get Bitcoin Status bitcoin_status_log = "" try: bitcoin_status_log = subprocess.check_output( ["tail", "-n", "200", "/mnt/hdd/mynode/bitcoin/debug.log"]).decode("utf8") lines = bitcoin_status_log.split('\n') lines.reverse() bitcoin_status_log = '\n'.join(lines) except: bitcoin_status_log = "ERROR" # Get QuickSync Rates upload_rate = 100 download_rate = 100 try: upload_rate = subprocess.check_output( ["cat", "/mnt/hdd/mynode/settings/quicksync_upload_rate"]) download_rate = subprocess.check_output([ "cat", "/mnt/hdd/mynode/settings/quicksync_background_download_rate" ]) except: upload_rate = 100 download_rate = 100 templateData = { "title": "myNode Settings", "password_message": "", "current_version": current_version, "latest_version": latest_version, "current_beta_version": current_beta_version, "latest_beta_version": latest_beta_version, "has_checkin_error": has_checkin_error(), "upgrade_error": did_upgrade_fail(), "upgrade_logs": get_recent_upgrade_logs(), "serial_number": serial_number, "device_type": device_type, "device_ram": device_ram, "swap_size": get_swap_size(), "product_key": product_key, "product_key_skipped": pk_skipped, "product_key_error": pk_error, "changelog": changelog, "is_https_forced": is_https_forced(), "using_bitcoin_custom_config": using_bitcoin_custom_config(), "using_lnd_custom_config": using_lnd_custom_config(), "is_bitcoin_synced": is_bitcoind_synced(), "is_installing_docker_images": is_installing_docker_images(), "firewall_rules": get_firewall_rules(), "is_quicksync_disabled": not quicksync_enabled, "is_netdata_enabled": is_netdata_enabled(), "is_uploader_device": is_uploader(), "download_rate": download_rate, "upload_rate": upload_rate, "is_btc_lnd_tor_enabled": is_btc_lnd_tor_enabled(), "is_aptget_tor_enabled": is_aptget_tor_enabled(), "uptime": uptime, "date": date, "local_ip": local_ip, "drive_usage": get_drive_usage(), "cpu_usage": get_cpu_usage(), "ram_usage": get_ram_usage(), "device_temp": get_device_temp(), "ui_settings": read_ui_settings() } return render_template('settings.html', **templateData)