def get_dojo_status(): # Find dojo status dojo_status = "Disabled" dojo_status_color = "gray" if is_installing_docker_images(): dojo_status = "Installing..." dojo_status_color = "yellow" dojo_initialized = "" return dojo_status, dojo_status_color, dojo_initialized try: dojo_initialized = subprocess.check_output("docker inspect --format={{.State.Running}} db", shell=True) dojo_initialized = dojo_initialized.strip() except: dojo_initialized = "" if is_dojo_enabled(): if dojo_initialized != "false": if is_electrs_active(): dojo_status = "Running" dojo_status_color = "green" else: dojo_status = "Waiting on Electrum..." dojo_status_color = "yellow" else: dojo_status = "Issue Starting" dojo_status_color = "red" dojo_initialized = "" return dojo_status, dojo_status_color, dojo_initialized
def dojo_page(): check_logged_in() NODE_ADMIN_KEY = 'Not found' try: NODE_ADMIN_KEY = subprocess.check_output( "cat /opt/mynode/dojo/docker/my-dojo/conf/docker-node.conf | grep -i NODE_ADMIN_KEY= | cut -c 16-", shell=True) NODE_ADMIN_KEY = NODE_ADMIN_KEY.strip() except: NODE_ADMIN_KEY = 'error' DOJO_V3_ADDR = 'Not found' try: DOJO_V3_ADDR = subprocess.check_output( "docker exec tor cat /var/lib/tor/hsv3dojo/hostname", shell=True) PAGE = '/admin' DOJO_V3_ADDR = DOJO_V3_ADDR.strip() + PAGE except: DOJO_V3_ADDR = 'error' dojo_status, dojo_status_color, dojo_initialized = get_dojo_status() # Load page templateData = { "title": "myNode Dojo", "ui_settings": read_ui_settings(), "dojo_status": dojo_status, "dojo_status_color": dojo_status_color, "dojo_enabled": is_dojo_enabled(), "dojo_initialized": dojo_initialized, "NODE_ADMIN_KEY": NODE_ADMIN_KEY, "DOJO_V3_ADDR": DOJO_V3_ADDR } return render_template('dojo.html', **templateData)
def get_dojo_status(): # Find dojo status dojo_status = "Disabled" dojo_status_color = "gray" try: dojo_initialized = subprocess.check_output( "docker inspect --format={{.State.Running}} db", shell=True) dojo_initialized = dojo_initialized.strip() except: dojo_initialized = "" if is_dojo_enabled(): if dojo_initialized != "false": dojo_status = "Running" dojo_status_color = "green" else: dojo_status = "Issue Starting" dojo_status_color = "red" dojo_initialized = "" return dojo_status, dojo_status_color, dojo_initialized
def dojo_page(): check_logged_in() admin_key = get_dojo_admin_key() dojo_v3_addr = get_dojo_addr() dojo_status, dojo_status_color, dojo_initialized = get_dojo_status() # Load page templateData = { "title": "myNode Dojo", "ui_settings": read_ui_settings(), "is_dojo_installed": is_dojo_installed(), "dojo_status": dojo_status, "dojo_version": get_dojo_version(), "dojo_status_color": dojo_status_color, "dojo_enabled": is_dojo_enabled(), "dojo_initialized": dojo_initialized, "dojo_tracker_status": get_dojo_tracker_status(), "electrs_status": get_electrs_status(), "NODE_ADMIN_KEY": admin_key, "DOJO_V3_ADDR": dojo_v3_addr } return render_template('dojo.html', **templateData)