-
Notifications
You must be signed in to change notification settings - Fork 181
Add Canary wallet monitoring app #984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
schjonhaug
wants to merge
3
commits into
mynodebtc:master
Choose a base branch
from
schjonhaug:add-canary-app
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| { | ||
| "name": "Canary", | ||
| "short_name": "canary", | ||
| "author": { | ||
| "name": "Canary Team", | ||
| "link": "https://github.com/schjonhaug/canary" | ||
| }, | ||
| "website": { | ||
| "name": "Canary", | ||
| "link": "https://github.com/schjonhaug/canary" | ||
| }, | ||
| "category": "bitcoin_app", | ||
| "short_description": "Wallet Monitor", | ||
| "description": [ | ||
| "Canary is a Bitcoin wallet monitoring and early warning system for cold storage.", | ||
| "Get instant notifications when your bitcoins move via ntfy push notifications.", | ||
| "Features include: transaction monitoring, RBF/CPFP detection, balance alerts, and deep wallet scanning." | ||
| ], | ||
| "latest_version": "v1.4.0", | ||
| "supported_archs": ["amd64", "arm64"], | ||
| "download_skip": true, | ||
| "requires_docker_image_installation": true, | ||
| "requires_electrs": true, | ||
| "requires_bitcoin": false, | ||
| "requires_lightning": false, | ||
| "http_port": "3005", | ||
| "show_on_homepage": true, | ||
| "show_on_application_page": true, | ||
| "app_tile_name": "Canary", | ||
| "app_tile_running_status_text": "Monitoring", | ||
| "app_tile_default_status_text": "Wallet Monitor", | ||
| "app_tile_button_text": "Open", | ||
| "app_tile_button_href": "http://mynode.local:3005", | ||
| "can_uninstall": true, | ||
| "can_reinstall": true, | ||
| "can_enable_disable": true, | ||
| "homepage_order": 75, | ||
| "sdk_version": 1 | ||
| } | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions
28
rootfs/standard/usr/share/mynode_apps/canary/canary.service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| [Unit] | ||
| Description=Canary | ||
| Wants=electrs.service docker_images.service | ||
| After=electrs.service docker_images.service | ||
|
|
||
| [Service] | ||
| WorkingDirectory=/opt/mynode/canary | ||
|
|
||
| ExecStartPre=/usr/bin/is_not_shutting_down.sh | ||
| ExecStartPre=/bin/bash -c 'if [ -f /usr/bin/service_scripts/pre_canary.sh ]; then /bin/bash /usr/bin/service_scripts/pre_canary.sh; fi' | ||
| ExecStartPre=-/usr/bin/docker stop canary canary-frontend | ||
| ExecStartPre=-/usr/bin/docker rm canary canary-frontend | ||
| ExecStartPre=/usr/bin/docker run -d --name canary --network host -v /mnt/hdd/mynode/canary:/app/data -e CANARY_DATA_DIR=/app/data -e CANARY_ELECTRUM_URL=tcp://127.0.0.1:50001 -e CANARY_NETWORK=mainnet -e CANARY_MODE=self-hosted -e CANARY_BIND_ADDRESS=127.0.0.1:3004 canary-backend:latest | ||
| ExecStartPre=/bin/sleep 2 | ||
| ExecStart=/usr/bin/docker run --rm --name canary-frontend --network host -e API_URL=http://127.0.0.1:3004 -e PORT=3005 canary-frontend:latest | ||
| ExecStop=/usr/bin/docker stop canary canary-frontend | ||
| ExecStopPost=-/usr/bin/docker rm canary | ||
|
|
||
| User=bitcoin | ||
| Group=bitcoin | ||
| Type=simple | ||
| TimeoutSec=120 | ||
| Restart=always | ||
| RestartSec=60 | ||
| SyslogIdentifier=canary | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target |
Binary file added
BIN
+1.06 MB
rootfs/standard/usr/share/mynode_apps/canary/screenshots/screenshot-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.37 MB
rootfs/standard/usr/share/mynode_apps/canary/screenshots/screenshot-02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+988 KB
rootfs/standard/usr/share/mynode_apps/canary/screenshots/screenshot-03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+891 KB
rootfs/standard/usr/share/mynode_apps/canary/screenshots/screenshot-04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+909 KB
rootfs/standard/usr/share/mynode_apps/canary/screenshots/screenshot-05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions
27
rootfs/standard/usr/share/mynode_apps/canary/scripts/install_canary.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #!/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 ====================" | ||
|
|
||
| mkdir -p /opt/mynode/canary || true | ||
| mkdir -p /mnt/hdd/mynode/canary || true | ||
|
|
||
| docker images --format '{{.Repository}}:{{.Tag}}' | grep 'canary-backend' | xargs --no-run-if-empty docker rmi | ||
| docker images --format '{{.Repository}}:{{.Tag}}' | grep 'schjonhaug/canary-backend' | xargs --no-run-if-empty docker rmi | ||
| docker images --format '{{.Repository}}:{{.Tag}}' | grep 'canary-frontend' | xargs --no-run-if-empty docker rmi | ||
| docker images --format '{{.Repository}}:{{.Tag}}' | grep 'schjonhaug/canary-frontend' | xargs --no-run-if-empty docker rmi | ||
|
|
||
| docker pull schjonhaug/canary-backend:$VERSION | ||
| docker pull schjonhaug/canary-frontend:$VERSION | ||
|
|
||
| docker tag schjonhaug/canary-backend:$VERSION canary-backend:latest | ||
| docker tag schjonhaug/canary-frontend:$VERSION canary-frontend:latest | ||
|
|
||
| chown -R bitcoin:bitcoin /mnt/hdd/mynode/canary | ||
|
|
||
| echo "================== DONE INSTALLING APP =================" |
4 changes: 4 additions & 0 deletions
4
rootfs/standard/usr/share/mynode_apps/canary/scripts/pre_canary.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #!/bin/bash | ||
| # Ensure data directory exists before starting | ||
| mkdir -p /mnt/hdd/mynode/canary | ||
| chown -R bitcoin:bitcoin /mnt/hdd/mynode/canary |
18 changes: 18 additions & 0 deletions
18
rootfs/standard/usr/share/mynode_apps/canary/scripts/uninstall_canary.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #!/bin/bash | ||
|
|
||
| source /usr/share/mynode/mynode_device_info.sh | ||
| source /usr/share/mynode/mynode_app_versions.sh | ||
|
|
||
| echo "==================== UNINSTALLING APP ====================" | ||
|
|
||
| docker stop canary canary-frontend 2>/dev/null || true | ||
| docker rm canary canary-frontend 2>/dev/null || true | ||
|
|
||
| docker images --format '{{.Repository}}:{{.Tag}}' | grep 'canary-backend' | xargs --no-run-if-empty docker rmi | ||
| docker images --format '{{.Repository}}:{{.Tag}}' | grep 'schjonhaug/canary-backend' | xargs --no-run-if-empty docker rmi | ||
| docker images --format '{{.Repository}}:{{.Tag}}' | grep 'canary-frontend' | xargs --no-run-if-empty docker rmi | ||
| docker images --format '{{.Repository}}:{{.Tag}}' | grep 'schjonhaug/canary-frontend' | xargs --no-run-if-empty docker rmi | ||
|
|
||
| rm -rf /mnt/hdd/mynode/canary | ||
|
|
||
| echo "================== DONE UNINSTALLING APP =================" |
25 changes: 25 additions & 0 deletions
25
rootfs/standard/usr/share/mynode_apps/canary/www/python/canary.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| from flask import Blueprint, render_template | ||
| from user_management import check_logged_in | ||
| from application_info import get_application, get_application_status, get_application_status_color | ||
| from device_info import read_ui_settings | ||
|
|
||
|
|
||
| mynode_canary = Blueprint("mynode_canary", __name__) | ||
|
|
||
|
|
||
| @mynode_canary.route("/info") | ||
| def canary_page(): | ||
| check_logged_in() | ||
|
|
||
| app = get_application("canary") | ||
| app_status = get_application_status("canary") | ||
| app_status_color = get_application_status_color("canary") | ||
|
|
||
| template_data = { | ||
| "title": "myNode - " + app["name"], | ||
| "ui_settings": read_ui_settings(), | ||
| "app_status": app_status, | ||
| "app_status_color": app_status_color, | ||
| "app": app, | ||
| } | ||
| return render_template("/app/generic_app.html", **template_data) |
1 change: 1 addition & 0 deletions
1
rootfs/standard/usr/share/mynode_apps/canary/www/templates/README
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Canary uses myNode's shared generic app template. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link won't work on all devices. Some don't support mynode.local or it could refer to a different device if there is more than one on the same network.
I recommend an Info page to display any app-info, like default logins or something. The generic version of that page has an Open button that will auto launch the app in a separate window based on the current URL.
Try