diff --git a/rootfs/standard/usr/share/mynode_apps/lndboss/lndboss.json b/rootfs/standard/usr/share/mynode_apps/lndboss/lndboss.json new file mode 100644 index 00000000..97c01850 --- /dev/null +++ b/rootfs/standard/usr/share/mynode_apps/lndboss/lndboss.json @@ -0,0 +1,63 @@ +{ + "name": "LndBoss", + "short_name": "lndboss", + "author": { + "name": "niteshbalusu11", + "link": "https://github.com/niteshbalusu11" + }, + "website": { + "name": "GitHub", + "link": "https://github.com/niteshbalusu11/lndboss" + }, + "category": "lightning_app", + "short_description": "Lightning Utility", + "description": [ + "A GUI For BalanceOfSatoshis." + ], + "latest_version": "v2.16.0", + "supported_archs": null, + "download_skip": false, + "download_type": "source", + "download_source_url": "https://github.com/niteshbalusu11/lndboss/archive/refs/tags/{VERSION}.tar.gz", + "download_binary_url": { + "aarch64": "download_url", + "x86_64": "download_url" + }, + "install_env_vars": {}, + "supports_app_page": true, + "supports_testnet": false, + "http_port": 8055, + "https_port": 8056, + "requires_bitcoin": true, + "requires_docker_image_installation": true, + "requires_electrs": false, + "requires_lightning": true, + "show_on_application_page": true, + "show_on_homepage": true, + "show_on_status_page": true, + "hide_status_icon": false, + "app_tile_name": "LndBoss", + "app_tile_running_status_text": "Running", + "app_tile_button_text": "Info", + "app_tile_button_href": "/app/lndboss/info", + "app_page_show_open_button": true, + "app_page_content": [ + { + "heading": "Instructions", + "content": [ + "A GUI For BalanceOfSatoshis. You can open the app with the Open button on the left.", + "The username is 'admin' and the password is the same as your myNode password.", + "Enjoy!" + ] + } + ], + "can_uninstall": true, + "can_reinstall": true, + "can_enable_disable": true, + "is_beta": false, + "is_premium": false, + "homepage_section": "apps", + "homepage_order": 91, + "app_type": "custom", + "sdk_version": 2 +} \ No newline at end of file diff --git a/rootfs/standard/usr/share/mynode_apps/lndboss/lndboss.png b/rootfs/standard/usr/share/mynode_apps/lndboss/lndboss.png new file mode 100644 index 00000000..92ef322e Binary files /dev/null and b/rootfs/standard/usr/share/mynode_apps/lndboss/lndboss.png differ diff --git a/rootfs/standard/usr/share/mynode_apps/lndboss/lndboss.service b/rootfs/standard/usr/share/mynode_apps/lndboss/lndboss.service new file mode 100644 index 00000000..c637a9f4 --- /dev/null +++ b/rootfs/standard/usr/share/mynode_apps/lndboss/lndboss.service @@ -0,0 +1,40 @@ +# lndboss service +# /etc/systemd/system/lndboss.service + +[Unit] +Description=lndboss +Wants=www.service docker_images.service +After=www.service docker_images.service + +[Service] +WorkingDirectory=/opt/mynode/lndboss + +ExecStartPre=/usr/bin/is_not_shutting_down.sh +ExecStartPre=+/bin/bash -c 'if [ -f /usr/bin/service_scripts/pre_lndboss.sh ]; then /bin/bash /usr/bin/service_scripts/pre_lndboss.sh; fi' +ExecStart=/usr/bin/docker run --rm \ + --name lndboss \ + --publish 8055:8055 \ + --env BOS_DATA_PATH="/root/.bosgui" \ + --env LNDBOSS_DIRECTORY="/root/.bosgui" \ + --env NODE_ENV="production" \ + --env PORT="8055" \ + --env BOS_DEFAULT_LND_SOCKET="host.docker.internal:10009" \ + --volume /mnt/hdd/mynode/lndboss/:/root/.bosgui \ + --volume /mnt/hdd/mynode/lnd/:/root/.lnd \ + --add-host=host.docker.internal:host-gateway \ + lndboss +ExecStartPost=/bin/bash -c 'if [ -f /usr/bin/service_scripts/post_lndboss.sh ]; then /bin/bash /usr/bin/service_scripts/post_lndboss.sh; fi' +ExecStop=/usr/bin/docker stop -t 2 lndboss + +User=bitcoin +Group=bitcoin +Type=simple +TimeoutSec=120 +Restart=always +RestartSec=60 +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=lndboss + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/rootfs/standard/usr/share/mynode_apps/lndboss/nginx/https_lndboss.conf b/rootfs/standard/usr/share/mynode_apps/lndboss/nginx/https_lndboss.conf new file mode 100644 index 00000000..7228bcf3 --- /dev/null +++ b/rootfs/standard/usr/share/mynode_apps/lndboss/nginx/https_lndboss.conf @@ -0,0 +1,17 @@ +server { + listen 8056 ssl; + server_name lndboss; + + include /etc/nginx/mynode/mynode_ssl_params.conf; + include /etc/nginx/mynode/mynode_ssl_cert_key.conf; + + access_log /var/log/nginx/access_lndboss.log; + error_log /var/log/nginx/error_lndboss.log; + + location / { + proxy_pass http://127.0.0.1:8055; + + include /etc/nginx/mynode/mynode_ssl_proxy_params.conf; + } + +} \ No newline at end of file diff --git a/rootfs/standard/usr/share/mynode_apps/lndboss/scripts/install_lndboss.sh b/rootfs/standard/usr/share/mynode_apps/lndboss/scripts/install_lndboss.sh new file mode 100644 index 00000000..7e804997 --- /dev/null +++ b/rootfs/standard/usr/share/mynode_apps/lndboss/scripts/install_lndboss.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +source /usr/share/mynode/mynode_device_info.sh +source /usr/share/mynode/mynode_app_versions.sh + +set -x +set -e + +echo "==================== INSTALLING APP ====================" + +# The current directory is the app install folder and the app tarball from GitHub +# has already been downloaded and extracted. Any additional env variables specified +# in the JSON file are also present. + +# Remove old containers +docker rmi $(docker images --format '{{.Repository}}:{{.Tag}}' | grep 'lndboss') || true + +# Build docker container +if [ "$DEVICE_ARCH" = "x86_64" ]; then + docker build -t lndboss . +elif [ "$DEVICE_ARCH" = "aarch64" ]; then + docker build . -t lndboss -f arm64.Dockerfile +else + echo "THIS ARCHITECTURE IS NOT SUPPORTED FOR LndBoss" + exit 1 +fi + +echo "================== DONE INSTALLING APP =================" \ No newline at end of file diff --git a/rootfs/standard/usr/share/mynode_apps/lndboss/scripts/post_lndboss.sh b/rootfs/standard/usr/share/mynode_apps/lndboss/scripts/post_lndboss.sh new file mode 100644 index 00000000..8887ac6e --- /dev/null +++ b/rootfs/standard/usr/share/mynode_apps/lndboss/scripts/post_lndboss.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +# This will run after launching the application \ No newline at end of file diff --git a/rootfs/standard/usr/share/mynode_apps/lndboss/scripts/pre_lndboss.sh b/rootfs/standard/usr/share/mynode_apps/lndboss/scripts/pre_lndboss.sh new file mode 100644 index 00000000..acf7b39f --- /dev/null +++ b/rootfs/standard/usr/share/mynode_apps/lndboss/scripts/pre_lndboss.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# This will run prior to launching the application + +echo "" > /mnt/hdd/mynode/lndboss/auth.json +if [ -f /home/bitcoin/.mynode/.hashedpw_bcrypt ]; then + HASH_BCRYPT=$(cat /home/bitcoin/.mynode/.hashedpw_bcrypt) + cat << EOF > /mnt/hdd/mynode/lndboss/auth.json +{ + "username": "admin", + "passwordHash": "$HASH_BCRYPT" +} +EOF +fi \ No newline at end of file diff --git a/rootfs/standard/usr/share/mynode_apps/lndboss/scripts/uninstall_lndboss.sh b/rootfs/standard/usr/share/mynode_apps/lndboss/scripts/uninstall_lndboss.sh new file mode 100644 index 00000000..74784f8b --- /dev/null +++ b/rootfs/standard/usr/share/mynode_apps/lndboss/scripts/uninstall_lndboss.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +source /usr/share/mynode/mynode_device_info.sh +source /usr/share/mynode/mynode_app_versions.sh + +echo "==================== UNINSTALLING APP ====================" + +# The app folder will be removed automatically after this script runs. You may not need to do anything here. + +# Remove old containers +docker rmi $(docker images --format '{{.Repository}}:{{.Tag}}' | grep 'lndboss') || true + +echo "================== DONE UNINSTALLING APP =================" diff --git a/rootfs/standard/usr/share/mynode_apps/lndboss/www/python/lndboss.py b/rootfs/standard/usr/share/mynode_apps/lndboss/www/python/lndboss.py new file mode 100644 index 00000000..216fbf09 --- /dev/null +++ b/rootfs/standard/usr/share/mynode_apps/lndboss/www/python/lndboss.py @@ -0,0 +1,32 @@ +from flask import Blueprint, render_template, redirect +from user_management import check_logged_in +from enable_disable_functions import * +from device_info import * +from application_info import * +from systemctl_info import * +import subprocess +import os + + +mynode_lndboss = Blueprint('mynode_lndboss',__name__) + + +### Page functions (have prefix /app//xyz.html \ No newline at end of file diff --git a/rootfs/standard/usr/share/mynode_apps/lndboss/www/templates/lndboss.html b/rootfs/standard/usr/share/mynode_apps/lndboss/www/templates/lndboss.html new file mode 100644 index 00000000..27287fec --- /dev/null +++ b/rootfs/standard/usr/share/mynode_apps/lndboss/www/templates/lndboss.html @@ -0,0 +1,54 @@ + + + {{ title }} + {% include 'includes/head.html' %} + + + {% include 'includes/logo_header.html' %} +
+ +
+ +
{{app.name}} (custom page - remove)
+
+ +
+
+
Status
+
+ + + + + + + + + +
Status{{app_status}}
Actions + Open + Button A + Button B +
+
+
+
+ + +
+
Instructions
+
    +
  1. Custom instructions?
  2. +
+
+ +
+ + + + +