diff --git a/rootfs/standard/etc/nginx/sites-enabled/https_joinmarket_orderbook.conf b/rootfs/standard/etc/nginx/sites-enabled/https_joinmarket_orderbook.conf new file mode 100644 index 00000000..9209bfde --- /dev/null +++ b/rootfs/standard/etc/nginx/sites-enabled/https_joinmarket_orderbook.conf @@ -0,0 +1,17 @@ +server { + listen 62602 ssl; + server_name joinmarketorderbook; + + include /etc/nginx/mynode/mynode_ssl_params.conf; + include /etc/nginx/mynode/mynode_ssl_cert_key.conf; + + access_log /var/log/nginx/access_joinmarket_orderbook.log; + error_log /var/log/nginx/error_joinmarket_orderbook.log; + + location / { + proxy_pass http://127.0.0.1:62601; + + include /etc/nginx/mynode/mynode_ssl_proxy_params.conf; + } + +} \ No newline at end of file diff --git a/rootfs/standard/etc/systemd/system/lnbits.service b/rootfs/standard/etc/systemd/system/lnbits.service index d7b51d7a..acb08865 100644 --- a/rootfs/standard/etc/systemd/system/lnbits.service +++ b/rootfs/standard/etc/systemd/system/lnbits.service @@ -20,7 +20,10 @@ ExecStart=/usr/bin/docker run --rm \ --volume /mnt/hdd/mynode/lnbits/:/app/data \ --volume /mnt/hdd/mynode/lnd/tls.cert:/app/tls.cert \ --volume /mnt/hdd/mynode/lnd/data/chain/bitcoin/mainnet/admin.macaroon:/app/admin.macaroon \ +<<<<<<< HEAD --add-host=host.docker.internal:host-gateway \ +======= +>>>>>>> 0da3b0f66577c6f14cd607e1eb88fee9a27a6103 lnbits-legend ExecStop=/usr/bin/docker stop -t 2 lnbits-legend diff --git a/rootfs/standard/etc/systemd/system/ob-watcher.service b/rootfs/standard/etc/systemd/system/ob-watcher.service new file mode 100644 index 00000000..073fbcc5 --- /dev/null +++ b/rootfs/standard/etc/systemd/system/ob-watcher.service @@ -0,0 +1,25 @@ + +[Unit] +Description=ob-watcher + +[Service] +ExecStartPre=/usr/bin/is_not_shutting_down.sh +ExecStartPre=/usr/bin/wait_on_bitcoin.sh + +WorkingDirectory=/home/joinmarket/joinmarket-clientserver/scripts/obwatch +ExecStart=/bin/sh -c '. /home/joinmarket/joinmarket-clientserver/jmvenv/bin/activate && python ob-watcher.py --host=0.0.0.0' +User=joinmarket +Group=joinmarket +Type=simple +TimeoutSec=300 +Restart=always +RestartSec=60 + +# Hardening measures +PrivateTmp=true +ProtectSystem=full +NoNewPrivileges=true +PrivateDevices=true + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/rootfs/standard/etc/tor/torrc b/rootfs/standard/etc/tor/torrc index 4226cb1b..19e934a9 100644 --- a/rootfs/standard/etc/tor/torrc +++ b/rootfs/standard/etc/tor/torrc @@ -301,6 +301,14 @@ HiddenServiceDir /var/lib/tor/mynode_sphinx/ HiddenServiceVersion 3 HiddenServicePort 53001 127.0.0.1:53001 +# Hidden Service for Joinmarket Orderbook +HiddenServiceDir /var/lib/tor/mynode_obwatcher/ +HiddenServiceVersion 3 +HiddenServicePort 80 127.0.0.1:62601 +HiddenServicePort 443 127.0.0.1:62602 +HiddenServicePort 62601 127.0.0.1:62601 +HiddenServicePort 62602 127.0.0.1:62602 + # Include tor settings for other apps %include /etc/torrc.d \ No newline at end of file diff --git a/rootfs/standard/usr/bin/mynode_firewall.sh b/rootfs/standard/usr/bin/mynode_firewall.sh index f5b40ed7..7c4add4d 100755 --- a/rootfs/standard/usr/bin/mynode_firewall.sh +++ b/rootfs/standard/usr/bin/mynode_firewall.sh @@ -73,6 +73,10 @@ ufw allow 49393 comment 'allow BTCPay Server-direct HTTPS' ufw allow 51194 comment 'allow VPN' ufw allow 61208 comment 'allow Glances' ufw allow 61209 comment 'allow Glances HTTPS' +ufw allow 62601 comment 'allow JoinMarket Orderbook' +ufw allow 62602 comment 'allow JoinMarket Orderbook HTTPS' +ufw allow 27183 comment 'allow JoinMarket API' +ufw allow 28183 comment 'allow JoinMarket API' ufw allow from 127.0.0.1 comment 'allow from localhost' #ufw allow from ::1 comment 'allow from localhost' diff --git a/rootfs/standard/usr/bin/mynode_post_upgrade.sh b/rootfs/standard/usr/bin/mynode_post_upgrade.sh index 3852aa7a..07efefed 100755 --- a/rootfs/standard/usr/bin/mynode_post_upgrade.sh +++ b/rootfs/standard/usr/bin/mynode_post_upgrade.sh @@ -45,6 +45,7 @@ if ! skip_base_upgrades ; then # User updates and settings adduser admin bitcoin + adduser joinmarket bitcoin grep "joinmarket" /etc/sudoers || (echo 'joinmarket ALL=(ALL) NOPASSWD:ALL' | EDITOR='tee -a' visudo) passwd -l root @@ -663,6 +664,10 @@ if should_install_app "joininbox" ; then # Install sudo -u joinmarket bash -c "cd /home/joinmarket/; ${JM_ENV_VARS} ./install.joinmarket.sh --install install" || true + sudo -u joinmarket bash -c "cd /home/joinmarket/; ${JM_ENV_VARS} ./install.joinmarket-api.sh on" || true + + # Enable obwatcher service + systemctl enable ob-watcher echo $JOININBOX_VERSION > $JOININBOX_VERSION_FILE fi diff --git a/rootfs/standard/usr/bin/mynode_startup.sh b/rootfs/standard/usr/bin/mynode_startup.sh index 33a90035..61f33728 100755 --- a/rootfs/standard/usr/bin/mynode_startup.sh +++ b/rootfs/standard/usr/bin/mynode_startup.sh @@ -253,6 +253,7 @@ useradd -m -s /bin/bash joinmarket || true # User updates and settings adduser admin bitcoin +adduser joinmarket bitcoin grep "joinmarket" /etc/sudoers || (echo 'joinmarket ALL=(ALL) NOPASSWD:ALL' | EDITOR='tee -a' visudo) # Regen SSH keys (check if force regen or keys are missing / empty) diff --git a/rootfs/standard/usr/bin/service_scripts/pre_lnbits.sh b/rootfs/standard/usr/bin/service_scripts/pre_lnbits.sh index 0ec7edfb..672d72de 100755 --- a/rootfs/standard/usr/bin/service_scripts/pre_lnbits.sh +++ b/rootfs/standard/usr/bin/service_scripts/pre_lnbits.sh @@ -4,9 +4,7 @@ set -x # Generate hex macaroons -macaroonAdminHex=$(xxd -ps -u -c 1000 /mnt/hdd/mynode/lnd/data/chain/bitcoin/mainnet/admin.macaroon) +#macaroonAdminHex=$(xxd -ps -u -c 1000 /mnt/hdd/mynode/lnd/data/chain/bitcoin/mainnet/admin.macaroon) # Update env file -sed -i "s/^LND_REST_MACAROON=.*/LND_REST_MACAROON=${macaroonAdminHex}/g" /opt/mynode/lnbits/.env -#sed -i "s/^LND_REST_INVOICE_MACAROON=.*/LND_REST_INVOICE_MACAROON=${macaroonInvoiceHex}/g" /opt/mynode/lnbits/.env -#sed -i "s/^LND_REST_READ_MACAROON=.*/LND_REST_READ_MACAROON=${macaroonReadHex}/g" /opt/mynode/lnbits/.env +sed -i "s|^LND_REST_MACAROON=.*|LND_REST_MACAROON=\"/app/admin.macaroon\"|g" /opt/mynode/lnbits/.env diff --git a/rootfs/standard/usr/share/mynode/application_info.json b/rootfs/standard/usr/share/mynode/application_info.json index 3772bcd2..510ebd05 100644 --- a/rootfs/standard/usr/share/mynode/application_info.json +++ b/rootfs/standard/usr/share/mynode/application_info.json @@ -241,7 +241,7 @@ "While being specifically designed with a mobile first mindset and is available fully implemented within Samourai Wallet, we have made efforts to bring Whirlpool technology to all platforms. Whirlpool is built in to Samourai Wallet and available as a stand alone desktop app available on all platforms." ], "category": "bitcoin_app", - "short_description": "Mixing Tool", + "short_description": "Mixing Utility", "app_tile_button_text": "Info", "app_tile_button_href": "/whirlpool", "app_tile_running_status_text": "Running", @@ -250,22 +250,22 @@ "homepage_order": 23 }, { - "name": "JoininBox", + "comment": "Keep shortname as joininbox so upgrades work", + "name": "JoinMarket", "short_name": "joininbox", - "author": {"name": "openoms", "link":""}, - "website": {"name": "GitHub", "link": "https://github.com/openoms/joininbox"}, + "author": {"name": "AdamISZ", "link":"https://github.com/AdamISZ"}, + "website": {"name": "GitHub", "link": "https://github.com/JoinMarket-Org/joinmarket-clientserver"}, "description": [ - "A minimalistic, security focused linux environment for JoinMarket with a terminal based graphical menu.", "JoinMarket is software to create a special kind of bitcoin transaction called a CoinJoin transaction. Its aim is to improve the confidentiality and privacy of bitcoin transactions.", "A CoinJoin transaction requires other people to take part. The right resources (coins) have to be in the right place, at the right time, in the right quantity. This isn't a software or tech problem, it's an economic problem. JoinMarket works by creating a new kind of market that would allocate these resources in the best way.", "One group of participants (called market makers) will always be available to take part in CoinJoins at any time. Other participants (called market takers) can create a CoinJoin at any time. The takers pay a fee which incentivizes the makers. A form of smart contract is created, meaning the private keys will never be broadcasted outside of your computer, resulting in virtually zero risk of loss (aside from malware or bugs). As a result of free-market forces the fees will eventually be next to nothing.", "Widespread use of JoinMarket improves bitcoin's fungibility and privacy. This implementation of JoinMarket also implements PayJoin." ], "category": "bitcoin_app", - "short_description": "JoinMarket Mixing", + "short_description": "Mixing Utility", "hide_status_icon": true, "app_tile_button_text": "Info", - "app_tile_button_href": "/joininbox", + "app_tile_button_href": "/joinmarket", "can_uninstall": true, "show_on_homepage": true, "homepage_order": 24, diff --git a/rootfs/standard/usr/share/mynode/mynode_app_versions.sh b/rootfs/standard/usr/share/mynode/mynode_app_versions.sh index 87e919e5..336f6990 100644 --- a/rootfs/standard/usr/share/mynode/mynode_app_versions.sh +++ b/rootfs/standard/usr/share/mynode/mynode_app_versions.sh @@ -77,7 +77,7 @@ CORSPROXY_VERSION=$(get_app_version "$CORSPROXY_VERSION" "corsproxy") CORSPROXY_VERSION_FILE=/home/bitcoin/.mynode/corsproxy_version CORSPROXY_LATEST_VERSION_FILE=/home/bitcoin/.mynode/corsproxy_version_latest -JOININBOX_VERSION="v0.7.3" +JOININBOX_VERSION="v0.7.4" JOININBOX_VERSION=$(get_app_version "$JOININBOX_VERSION" "joininbox") JOININBOX_VERSION_FILE=/home/bitcoin/.mynode/joininbox_version JOININBOX_LATEST_VERSION_FILE=/home/bitcoin/.mynode/joininbox_version_latest @@ -152,7 +152,7 @@ CKBUNKER_VERSION=$(get_app_version "$CKBUNKER_VERSION" "ckbunker") CKBUNKER_VERSION_FILE=/home/bitcoin/.mynode/ckbunker_version CKBUNKER_LATEST_VERSION_FILE=/home/bitcoin/.mynode/ckbunker_version_latest -BOS_VERSION="13.0.2" +BOS_VERSION="13.1.4" BOS_VERSION=$(get_app_version "$BOS_VERSION" "bos") BOS_VERSION_FILE=/home/bitcoin/.mynode/bos_version BOS_LATEST_VERSION_FILE=/home/bitcoin/.mynode/bos_version_latest diff --git a/rootfs/standard/usr/share/mynode_apps/jam/jam.json b/rootfs/standard/usr/share/mynode_apps/jam/jam.json new file mode 100644 index 00000000..513ead86 --- /dev/null +++ b/rootfs/standard/usr/share/mynode_apps/jam/jam.json @@ -0,0 +1,69 @@ +{ + "name": "Jam", + "short_name": "jam", + "author": { + "name": "", + "link": "" + }, + "website": { + "name": "Jam", + "link": "https://jamapp.org/" + }, + "category": "bitcoin_app", + "short_description": "Joinmarket UI", + "description": [ + "Jam is a graphical user interface for JoinMarket, and while obviously related, is a separate project developed by a separate set of people.", + "Jam is a free and open-source project that aims to improve the financial privacy of yourself and others, without relying on a trusted third party. It was started in 2021 by various volunteers and is still developed and maintained on a volunteer basis. As mentioned above, Jam is a front-end for JoinMarket, a privacy-focused bitcoin software that uses a peer-to-peer marketplace to facilitate collaborative transactions.", + "The goal of Jam is to provide an interface that makes JoinMarket easier to use, and thus more easily accessible for more people.", + "JoinMarket is a special kind of software that is aimed at improving the privacy and fungibility of bitcoin transactions. The main way to improve privacy and fungibility on-chain is via collaborative transactions.", + "A collaborative transaction requires the coordination of multiple parties. The right resources (UTXOs) have to be available in the right quantity at the right time.", + "Consequently, the problem that needs to be solved is not a technological problem, but an economic problem. JoinMarket solves this problem not by central coordination, but by creating a market that allows participants to allocate these resources in the best way, according to their individual needs." + ], + "latest_version": "v0.1.1", + "supported_archs": null, + "download_skip": true, + "download_type": "source", + "download_source_url": "not_required", + "download_binary_url": { + "aarch64": "download_url", + "x86_64": "download_url" + }, + "install_env_vars": {"DOCKER_IMAGE_NAME": "jam-ui-only:{VERSION}-clientserver-v0.9.8"}, + "supports_app_page": true, + "supports_testnet": false, + "http_port": 5020, + "https_port": 5021, + "requires_bitcoin": true, + "requires_docker_image_installation": true, + "requires_electrs": false, + "requires_lightning": false, + "show_on_application_page": true, + "show_on_homepage": true, + "show_on_status_page": true, + "hide_status_icon": false, + "app_tile_name": "Jam", + "app_tile_running_status_text": "Running", + "app_tile_button_text": "Info", + "app_tile_button_href": "/app/jam/info", + "app_page_show_open_button": true, + "app_page_content": [ + { + "heading": "Instructions", + "content": [ + "JoinMarket is a mixing wallet for Bitcoin that can be used with a web interface via Jam.", + "First, for the application to run properly, JoinMarket also needs be installed via the myNode Marketplace.", + "To get started, you just need enable Jam and click the open button on the left. Then, follow the instructions within the app!", + "Enjoy mixing your coins!" + ] + } + ], + "can_uninstall": true, + "can_reinstall": true, + "can_enable_disable": true, + "is_beta": true, + "is_premium": true, + "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/jam/jam.png b/rootfs/standard/usr/share/mynode_apps/jam/jam.png new file mode 100644 index 00000000..ac029478 Binary files /dev/null and b/rootfs/standard/usr/share/mynode_apps/jam/jam.png differ diff --git a/rootfs/standard/usr/share/mynode_apps/jam/jam.service b/rootfs/standard/usr/share/mynode_apps/jam/jam.service new file mode 100644 index 00000000..951dfb86 --- /dev/null +++ b/rootfs/standard/usr/share/mynode_apps/jam/jam.service @@ -0,0 +1,42 @@ +# jam service +# /etc/systemd/system/jam.service + +[Unit] +Description=jam +Wants=www.service docker_images.service +After=www.service docker_images.service + +[Service] +WorkingDirectory=/opt/mynode/jam + +EnvironmentFile=/mnt/hdd/mynode/settings/.btcrpc_environment + +ExecStartPre=/usr/bin/is_not_shutting_down.sh +ExecStartPre=/bin/bash -c 'if [ -f /usr/bin/service_scripts/pre_jam.sh ]; then /bin/bash /usr/bin/service_scripts/pre_jam.sh; fi' +ExecStart=/usr/bin/docker run --rm \ + --name jam \ + --env JAM_JMWALLETD_HOST="host.docker.internal" \ + --env JAM_JMWALLETD_API_PORT="28183" \ + --env JAM_JMWALLETD_WEBSOCKET_PORT="27183" \ + --env JAM_JMOBWATCH_PORT="62601" \ + --env APP_USER="admin" \ + --env APP_PASSWORD="bolt" \ + --publish "5020:80" \ + --add-host=host.docker.internal:host-gateway \ + --volume /mnt/hdd/mynode/jam/data:/root/.joinmarket \ + jam:latest +ExecStartPost=/bin/bash -c 'if [ -f /usr/bin/service_scripts/post_jam.sh ]; then /bin/bash /usr/bin/service_scripts/post_jam.sh; fi' +ExecStop=/usr/bin/docker stop -t 2 jam + +User=bitcoin +Group=bitcoin +Type=simple +TimeoutSec=120 +Restart=always +RestartSec=60 +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=jam + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/rootfs/standard/usr/share/mynode_apps/jam/nginx/https_jam.conf b/rootfs/standard/usr/share/mynode_apps/jam/nginx/https_jam.conf new file mode 100644 index 00000000..18aea430 --- /dev/null +++ b/rootfs/standard/usr/share/mynode_apps/jam/nginx/https_jam.conf @@ -0,0 +1,17 @@ +server { + listen 5021 ssl; + server_name jam; + + include /etc/nginx/mynode/mynode_ssl_params.conf; + include /etc/nginx/mynode/mynode_ssl_cert_key.conf; + + access_log /var/log/nginx/access_jam.log; + error_log /var/log/nginx/error_jam.log; + + location / { + proxy_pass http://127.0.0.1:5020; + + include /etc/nginx/mynode/mynode_ssl_proxy_params.conf; + } + +} \ No newline at end of file diff --git a/rootfs/standard/usr/share/mynode_apps/jam/screenshots/._.DS_Store b/rootfs/standard/usr/share/mynode_apps/jam/screenshots/._.DS_Store new file mode 100644 index 00000000..a5b28df1 Binary files /dev/null and b/rootfs/standard/usr/share/mynode_apps/jam/screenshots/._.DS_Store differ diff --git a/rootfs/standard/usr/share/mynode_apps/jam/screenshots/._1.png b/rootfs/standard/usr/share/mynode_apps/jam/screenshots/._1.png new file mode 100644 index 00000000..88730a58 Binary files /dev/null and b/rootfs/standard/usr/share/mynode_apps/jam/screenshots/._1.png differ diff --git a/rootfs/standard/usr/share/mynode_apps/jam/screenshots/._2.png b/rootfs/standard/usr/share/mynode_apps/jam/screenshots/._2.png new file mode 100644 index 00000000..680b0378 Binary files /dev/null and b/rootfs/standard/usr/share/mynode_apps/jam/screenshots/._2.png differ diff --git a/rootfs/standard/usr/share/mynode_apps/jam/screenshots/1.png b/rootfs/standard/usr/share/mynode_apps/jam/screenshots/1.png new file mode 100644 index 00000000..959a15c4 Binary files /dev/null and b/rootfs/standard/usr/share/mynode_apps/jam/screenshots/1.png differ diff --git a/rootfs/standard/usr/share/mynode_apps/jam/screenshots/2.png b/rootfs/standard/usr/share/mynode_apps/jam/screenshots/2.png new file mode 100644 index 00000000..3f0e4179 Binary files /dev/null and b/rootfs/standard/usr/share/mynode_apps/jam/screenshots/2.png differ diff --git a/rootfs/standard/usr/share/mynode_apps/jam/screenshots/3.png b/rootfs/standard/usr/share/mynode_apps/jam/screenshots/3.png new file mode 100644 index 00000000..07a00749 Binary files /dev/null and b/rootfs/standard/usr/share/mynode_apps/jam/screenshots/3.png differ diff --git a/rootfs/standard/usr/share/mynode_apps/jam/screenshots/4.png b/rootfs/standard/usr/share/mynode_apps/jam/screenshots/4.png new file mode 100644 index 00000000..02211d76 Binary files /dev/null and b/rootfs/standard/usr/share/mynode_apps/jam/screenshots/4.png differ diff --git a/rootfs/standard/usr/share/mynode_apps/jam/scripts/install_jam.sh b/rootfs/standard/usr/share/mynode_apps/jam/scripts/install_jam.sh new file mode 100644 index 00000000..74627da5 --- /dev/null +++ b/rootfs/standard/usr/share/mynode_apps/jam/scripts/install_jam.sh @@ -0,0 +1,31 @@ +#!/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. + +#echo "DOCKER NAME: $DOCKER_IMAGE_NAME" +#echo "VERSION: $VERSION" + +# Make dir that will be volume mounted to the container +mkdir -p ${STORAGE_FOLDER}/data + +# Clear any old images +docker rmi $(docker images --format '{{.Repository}}:{{.Tag}}' | grep 'jam-') || true +docker rmi jam:latest || true + +# Pull latest image +docker pull ghcr.io/joinmarket-webui/$DOCKER_IMAGE_NAME + +# Tag latest as "jam:latest" +docker tag ghcr.io/joinmarket-webui/$DOCKER_IMAGE_NAME jam:latest + +echo "================== DONE INSTALLING APP =================" \ No newline at end of file diff --git a/rootfs/standard/usr/share/mynode_apps/jam/scripts/post_jam.sh b/rootfs/standard/usr/share/mynode_apps/jam/scripts/post_jam.sh new file mode 100644 index 00000000..8887ac6e --- /dev/null +++ b/rootfs/standard/usr/share/mynode_apps/jam/scripts/post_jam.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/jam/scripts/pre_jam.sh b/rootfs/standard/usr/share/mynode_apps/jam/scripts/pre_jam.sh new file mode 100644 index 00000000..a151a5e9 --- /dev/null +++ b/rootfs/standard/usr/share/mynode_apps/jam/scripts/pre_jam.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +# This will run prior to launching the application \ No newline at end of file diff --git a/rootfs/standard/usr/share/mynode_apps/jam/scripts/uninstall_jam.sh b/rootfs/standard/usr/share/mynode_apps/jam/scripts/uninstall_jam.sh new file mode 100644 index 00000000..9a812e5f --- /dev/null +++ b/rootfs/standard/usr/share/mynode_apps/jam/scripts/uninstall_jam.sh @@ -0,0 +1,12 @@ +#!/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. + +docker rmi $(docker images --format '{{.Repository}}:{{.Tag}}' | grep 'jam-standalone') || true + +echo "================== DONE UNINSTALLING APP =================" diff --git a/rootfs/standard/usr/share/mynode_apps/jam/www/._.DS_Store b/rootfs/standard/usr/share/mynode_apps/jam/www/._.DS_Store new file mode 100644 index 00000000..a5b28df1 Binary files /dev/null and b/rootfs/standard/usr/share/mynode_apps/jam/www/._.DS_Store differ diff --git a/rootfs/standard/usr/share/mynode_apps/jam/www/python/jam.py b/rootfs/standard/usr/share/mynode_apps/jam/www/python/jam.py new file mode 100644 index 00000000..79f44dee --- /dev/null +++ b/rootfs/standard/usr/share/mynode_apps/jam/www/python/jam.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_jam = Blueprint('mynode_jam',__name__) + + +### Page functions (have prefix /app//xyz.html \ No newline at end of file diff --git a/rootfs/standard/usr/share/mynode_apps/jam/www/templates/jam.html b/rootfs/standard/usr/share/mynode_apps/jam/www/templates/jam.html new file mode 100644 index 00000000..27287fec --- /dev/null +++ b/rootfs/standard/usr/share/mynode_apps/jam/www/templates/jam.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. +
+
+ +
+ + + + + diff --git a/rootfs/standard/var/pynode/application_info.py b/rootfs/standard/var/pynode/application_info.py index c874f432..8e5316b1 100644 --- a/rootfs/standard/var/pynode/application_info.py +++ b/rootfs/standard/var/pynode/application_info.py @@ -362,6 +362,8 @@ def get_application_log(short_name): return get_journalctl_log("usb_extras") elif short_name == "www": return get_journalctl_log("www") + elif short_name == "i2pd": + return get_file_log("/var/log/i2pd/i2pd.log") elif short_name == "linux": return run_linux_cmd("dmesg | tac | head -n 200") else: @@ -398,6 +400,10 @@ def get_application_status_special(short_name): return "Syncing..." elif tracker_status == TrackerStatus.ERROR: return "Tracker Error" + elif short_name == "jam": + if not is_installed("joininbox"): + return "Requires JoinMarket" + return "" def get_application_status(short_name): @@ -452,6 +458,9 @@ def get_application_status_color_special(short_name): return "red" else: return "gray" + elif short_name == "jam": + if not is_installed("joininbox"): + return "yellow" return "" def get_application_status_color(short_name): @@ -848,7 +857,8 @@ def upgrade_dynamic_apps(short_name="all"): if app_data["install_env_vars"]: for key in app_data["install_env_vars"]: my_env[key] = app_data["install_env_vars"][key] - subprocess.check_output("cd {}; sudo -u {} --preserve-env /bin/bash /usr/bin/service_scripts/install_{}.sh 1>&2".format(app_data["install_folder"], app_data["linux_user"], app_name), shell=True, env=my_env) + # Home dir needs to be set to user so it doesn't inhert root home (causes docker issues) + subprocess.check_output("cd {}; sudo -u {} --preserve-env HOME=/home/{} /bin/bash /usr/bin/service_scripts/install_{}.sh 1>&2".format(app_data["install_folder"], app_data["linux_user"], app_data["linux_user"], app_name), shell=True, env=my_env) # Mark update latest version if success log_message(" Upgrade success!") diff --git a/rootfs/standard/var/pynode/bitcoin_info.py b/rootfs/standard/var/pynode/bitcoin_info.py index c87548ed..1ea81a94 100644 --- a/rootfs/standard/var/pynode/bitcoin_info.py +++ b/rootfs/standard/var/pynode/bitcoin_info.py @@ -169,7 +169,7 @@ def update_bitcoin_other_info(): wallet_rpc_connection = AuthServiceProxy("http://%s:%s@127.0.0.1:8332/wallet/%s"%(rpc_user, rpc_pass, wallet_name), timeout=60) wallet_info = wallet_rpc_connection.getwalletinfo() wallet_info["can_delete"] = True - if wallet_name == "wallet.dat" or wallet_name == "joinmarket_wallet.dat": + if wallet_name == "wallet.dat": wallet_info["can_delete"] = False wallet_data.append(wallet_info) bitcoin_wallets = wallet_data @@ -313,7 +313,7 @@ def create_default_wallets(): break if not found: log_message("Creating new default wallet {}".format(new_wallet)) - run_bitcoincli_command("createwallet {}".format(new_wallet)) + run_bitcoincli_command("-named createwallet wallet_name={} descriptors=false".format(new_wallet)) run_bitcoincli_command("loadwallet {}".format(new_wallet)) diff --git a/rootfs/standard/var/www/mynode/joininbox.py b/rootfs/standard/var/www/mynode/joinmarket.py similarity index 59% rename from rootfs/standard/var/www/mynode/joininbox.py rename to rootfs/standard/var/www/mynode/joinmarket.py index 106ca533..a9781a68 100644 --- a/rootfs/standard/var/www/mynode/joininbox.py +++ b/rootfs/standard/var/www/mynode/joinmarket.py @@ -1,6 +1,7 @@ from flask import Blueprint, render_template, redirect, request, flash from user_management import check_logged_in -from device_info import read_ui_settings +from device_info import read_ui_settings, get_onion_url_for_service +from application_info import * from systemctl_info import * from utilities import * import os @@ -8,7 +9,7 @@ import time import subprocess import os -mynode_joininbox = Blueprint('mynode_joininbox',__name__) +mynode_joinmarket = Blueprint('mynode_joinmarket',__name__) def get_jm_wallets(): wallets = [] @@ -17,7 +18,7 @@ def get_jm_wallets(): if os.path.isdir(wallet_folder): for f in os.listdir(wallet_folder): wallet_path = wallet_folder + f - if os.path.isfile( wallet_path ): + if os.path.isfile( wallet_path ) and not f.startswith("."): wallet = {} wallet["name"] = f wallets.append(wallet) @@ -26,32 +27,40 @@ def get_jm_wallets(): return wallets ### Page functions -@mynode_joininbox.route("/joininbox") +@mynode_joinmarket.route("/joinmarket") def joininbox_page(): check_logged_in() # Load page templateData = { - "title": "myNode JoininBox / JoinMarket", + "title": "myNode JoinMarket", + "is_jam_installed": is_installed("jam"), + "is_jam_enabled": is_service_enabled("jam"), + "jam_http_port": 5020, + "jam_https_port": 5021, + "jam_tor_address": get_onion_url_for_service("jam"), + "ob_http_port": 62601, + "ob_https_port": 62602, + "ob_tor_address": get_onion_url_for_service("obwatcher"), "wallets": get_jm_wallets(), "ui_settings": read_ui_settings(), } - return render_template('joininbox.html', **templateData) + return render_template('joinmarket.html', **templateData) -@mynode_joininbox.route("/joininbox/download_wallet", methods=["GET"]) -def joininbox_download_wallet(): +@mynode_joinmarket.route("/joinmarket/download_wallet", methods=["GET"]) +def joinmarket_download_wallet(): check_logged_in() wallet_folder = "/mnt/hdd/mynode/joinmarket/wallets/" wallet_name = request.args.get('wallet') if wallet_name is None: flash("Error finding wallet name!", category="error") - return redirect("/joininbox") + return redirect("/joinmarket") full_file_path = wallet_folder + wallet_name if not os.path.isfile( full_file_path ): time.sleep(3) flash("Error finding wallet to download!", category="error") - return redirect("/joininbox") + return redirect("/joinmarket") return download_file(directory=wallet_folder, filename=wallet_name) diff --git a/rootfs/standard/var/www/mynode/mynode.py b/rootfs/standard/var/www/mynode/mynode.py index 0bfdadf2..a7fb9f53 100644 --- a/rootfs/standard/var/www/mynode/mynode.py +++ b/rootfs/standard/var/www/mynode/mynode.py @@ -6,7 +6,7 @@ from api import mynode_api from bitcoin import mynode_bitcoin from whirlpool import mynode_whirlpool from dojo import mynode_dojo -from joininbox import mynode_joininbox +from joinmarket import mynode_joinmarket from caravan import mynode_caravan from sphinxrelay import mynode_sphinxrelay from pyblock import mynode_pyblock @@ -93,7 +93,7 @@ app.register_blueprint(mynode_lnd) app.register_blueprint(mynode_api) app.register_blueprint(mynode_whirlpool) app.register_blueprint(mynode_dojo) -app.register_blueprint(mynode_joininbox) +app.register_blueprint(mynode_joinmarket) app.register_blueprint(mynode_caravan) app.register_blueprint(mynode_sphinxrelay) app.register_blueprint(mynode_pyblock) diff --git a/rootfs/standard/var/www/mynode/settings.py b/rootfs/standard/var/www/mynode/settings.py index 22267d8b..ef85fc04 100644 --- a/rootfs/standard/var/www/mynode/settings.py +++ b/rootfs/standard/var/www/mynode/settings.py @@ -290,6 +290,9 @@ def page_status(): #"www_status_log": get_journalctl_log("www"), "www_status": get_service_status_basic_text("www"), "www_status_color": get_service_status_color("www"), + #"i2pd_status_log": get_journalctl_log("i2pd"), + "i2pd_status": get_service_status_basic_text("i2pd"), + "i2pd_status_color": get_service_status_color("i2pd"), #"ufw_status_log": get_journalctl_log("ufw"), "ufw_status": get_service_status_basic_text("ufw"), "ufw_status_color": get_service_status_color("ufw"), diff --git a/rootfs/standard/var/www/mynode/templates/joininbox.html b/rootfs/standard/var/www/mynode/templates/joininbox.html deleted file mode 100644 index 15a4522a..00000000 --- a/rootfs/standard/var/www/mynode/templates/joininbox.html +++ /dev/null @@ -1,82 +0,0 @@ - - - {{ title }} - {% include 'includes/head.html' %} - - - {% include 'includes/logo_header.html' %} -
- -
- - {% include 'includes/message_display.html' %} - -
JoininBox / JoinMarket
-
- -
-
-
Status
-
Ready
-
-
- - - {% if wallets is not none and wallets|length > 0 %} -
-
Wallets
- - - - - - - {% for wallet in wallets %} - - - - - {% endfor %} - -
WalletActions
{{ wallet.name }} - download -
-

- *These wallets are not your main lightning wallet. These have been created manually or via other applications.
- **Wallet files may contain private keys and sensitive data. Be very cautious when downloading copies.
- ***Wallet files may be encrypted and require a password to use. -

-
- {% endif %} - - -
-
Instructions to setup JoininBox / JoinMarket
-
    -
  1. JoinMarket is a mixing wallet for Bitcoin that can be used with a terminal interface via JoininBox.
  2. -
  3. To get started, you need access to the Linux terminal of your myNode device.
  4. -
      -
    • This may be advanced for some. Please be careful, myNode is not responsible for lost funds.
    • -
    • A guide to access the Linux terminal is available on mynodebtc.com - guide
    • -
    -
  5. Once you have terminal access, run the following command:
  6. -
      -
    • sudo mynode-joininbox
    • -
    -
  7. Enter your myNode password when prompted.
  8. -
  9. The first time running JoininBox, it may install additional software.
  10. -
  11. Remember to back up your seed phrases.
  12. -
  13. Enjoy mixing your coins!
  14. -
- -

- - -
- - diff --git a/rootfs/standard/var/www/mynode/templates/joinmarket.html b/rootfs/standard/var/www/mynode/templates/joinmarket.html new file mode 100644 index 00000000..cc869a25 --- /dev/null +++ b/rootfs/standard/var/www/mynode/templates/joinmarket.html @@ -0,0 +1,125 @@ + + + {{ title }} + {% include 'includes/head.html' %} + + + {% include 'includes/logo_header.html' %} +
+ +
+ + {% include 'includes/message_display.html' %} + +
JoinMarket
+
+ +
+
+
Status
+
Ready
+
+ +
+
Actions
+
+ + + +
+
+
+ + + {% if wallets is not none and wallets|length > 0 %} +
+
Wallets
+ + + + + + + {% for wallet in wallets %} + + + + + {% endfor %} + +
WalletActions
{{ wallet.name }} + download +
+

+ *These wallets are not your main lightning wallet. These have been created manually or via other applications.
+ **Wallet files may contain private keys and sensitive data. Be very cautious when downloading copies.
+ ***Wallet files may be encrypted and require a password to use. +

+
+ {% endif %} + +
+
Instructions to use Jam
+
    +
  1. JoinMarket is a mixing wallet for Bitcoin that can be used with a web interface via Jam.
  2. +
  3. To get started, you just need to install and enable Jam via the myNode Marketplace.
  4. +
  5. Once installed, click the Open Jam link above or the link on the Jam application page.
  6. +
  7. Enjoy mixing your coins!
  8. +
+
+ + +
+
Instructions to use JoininBox
+
    +
  1. JoinMarket is a mixing wallet for Bitcoin that can be used with a terminal interface via JoininBox.
  2. +
  3. To get started, you need access to the Linux terminal of your myNode device.
  4. +
      +
    • This may be advanced for some. Please be careful, myNode is not responsible for lost funds.
    • +
    • A guide to access the Linux terminal is available on mynodebtc.com - guide
    • +
    +
  5. Once you have terminal access, run the following command:
  6. +
      +
    • sudo mynode-joininbox
    • +
    +
  7. Enter your myNode password when prompted.
  8. +
  9. The first time running JoininBox, it may install additional software.
  10. +
  11. Remember to back up your seed phrases.
  12. +
  13. Enjoy mixing your coins!
  14. +
+
+ +
+
Instructions to use JoinMarket Python Scripts
+
    +
  1. JoinMarket is a mixing wallet for Bitcoin that can be used with a terminal interface using Python scripts.
  2. +
  3. To get started, you need access to the Linux terminal of your myNode device.
  4. +
      +
    • This may be advanced for some. Please be careful, myNode is not responsible for lost funds.
    • +
    • A guide to access the Linux terminal is available on mynodebtc.com - guide
    • +
    +
  5. Once you have terminal access, run the following command:
  6. +
      +
    • sudo mynode-joinmarket
    • +
    +
  7. Enter your myNode password when prompted.
  8. +
  9. This will change your prompt and you will be running as the joinmarket user with access to the JoinMarket python scripts.
  10. +
  11. Remember to back up your seed phrases.
  12. +
  13. Enjoy mixing your coins!
  14. +
+ +
+ +
Tips and Notes
+ +
+ + diff --git a/rootfs/standard/var/www/mynode/templates/status.html b/rootfs/standard/var/www/mynode/templates/status.html index eba4b4a4..a8c6bd16 100644 --- a/rootfs/standard/var/www/mynode/templates/status.html +++ b/rootfs/standard/var/www/mynode/templates/status.html @@ -337,6 +337,15 @@
+
I2PD Status
+
+
+ {{ i2pd_status }} +
+ + +
+
Firewall Status
diff --git a/scripts/check_app_versions.py b/scripts/check_app_versions.py index b1667476..d6796462 100755 --- a/scripts/check_app_versions.py +++ b/scripts/check_app_versions.py @@ -16,6 +16,7 @@ apps = [{"name": "bitcoin/bitcoin", "current_version_var {"name": "BlueWallet/LndHub", "current_version_variable": "LNDHUB_VERSION"}, {"name": "btcpayserver/btcpayserver", "current_version_variable": "BTCPAYSERVER_VERSION"}, {"name": "openoms/joininbox", "current_version_variable": "JOININBOX_VERSION"}, + {"name": "joinmarket-webui/jam", "dynamic_app_name": "jam"}, {"name": "unchained-capital/caravan", "current_version_variable": "CARAVAN_VERSION"}, {"name": "cryptoadvance/specter-desktop", "current_version_variable": "SPECTER_VERSION"}, {"name": "Coldcard/ckbunker", "current_version_variable": "CKBUNKER_VERSION"}, diff --git a/setup/setup_device.sh b/setup/setup_device.sh index 7bcb52db..993229ab 100755 --- a/setup/setup_device.sh +++ b/setup/setup_device.sh @@ -265,6 +265,7 @@ usermod -a -G debian-tor bitcoin # Make admin a member of bitcoin adduser admin bitcoin +adduser joinmarket bitcoin grep "joinmarket" /etc/sudoers || (echo 'joinmarket ALL=(ALL) NOPASSWD:ALL' | EDITOR='tee -a' visudo) @@ -701,6 +702,10 @@ if [ $IS_RASPI = 1 ] || [ $IS_X86 = 1 ]; then # Install sudo -u joinmarket bash -c "cd /home/joinmarket/; ${JM_ENV_VARS} ./install.joinmarket.sh install" || true + sudo -u joinmarket bash -c "cd /home/joinmarket/; ${JM_ENV_VARS} ./install.joinmarket-api.sh on" || true + + # Enable obwatcher service + systemctl enable ob-watcher echo $JOININBOX_VERSION > $JOININBOX_VERSION_FILE fi