mirror of
https://github.com/Retropex/MDG-mynode.git
synced 2025-05-12 03:10:42 +02:00
initial release
This commit is contained in:
commit
d2da3f2425
65
mempooldotguide.json
Normal file
65
mempooldotguide.json
Normal file
@ -0,0 +1,65 @@
|
||||
{
|
||||
"name": "mempool dot guide",
|
||||
"short_name": "mempooldotguide",
|
||||
"author": {
|
||||
"name": "mempooldotguide author",
|
||||
"link": ""
|
||||
},
|
||||
"website": {
|
||||
"name": "GitHub",
|
||||
"link": "https://github.com/FILL_IN_GITHUB_USER/FILL_IN_GITHUB_PROJECT"
|
||||
},
|
||||
"category": "bitcoin_app",
|
||||
"short_description": "Fill in short description",
|
||||
"description": [
|
||||
"Fill in longer description"
|
||||
],
|
||||
"latest_version": "v0.0.1",
|
||||
"supported_archs": null,
|
||||
"download_skip": false,
|
||||
"download_type": "source",
|
||||
"download_source_url": "https://github.com/FILL_IN_GITHUB_USER/FILL_IN_GITHUB_PROJECT/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": 40000,
|
||||
"https_port": 40001,
|
||||
"requires_bitcoin": true,
|
||||
"requires_docker_image_installation": true,
|
||||
"requires_electrs": true,
|
||||
"requires_lightning": false,
|
||||
"show_on_application_page": true,
|
||||
"show_on_homepage": true,
|
||||
"show_on_status_page": true,
|
||||
"hide_status_icon": false,
|
||||
"app_tile_name": "mempool dot guide",
|
||||
"app_tile_running_status_text": "Running",
|
||||
"app_tile_button_text": "Info",
|
||||
"app_tile_button_href": "/app/mempooldotguide/info",
|
||||
"app_page_show_open_button": true,
|
||||
"app_page_content": [
|
||||
{
|
||||
"heading": "Instructions",
|
||||
"content": [
|
||||
"Add general usage instructions here. You can open the app with the Open button on the left (if web based).",
|
||||
"For more custom content, update the template and python files under the 'www' folder.",
|
||||
"Paragraph 3",
|
||||
"Paragraph 4",
|
||||
"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
|
||||
}
|
BIN
mempooldotguide.png
Normal file
BIN
mempooldotguide.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 MiB |
42
mempooldotguide.service
Normal file
42
mempooldotguide.service
Normal file
@ -0,0 +1,42 @@
|
||||
# mempooldotguide service
|
||||
# /etc/systemd/system/mempooldotguide.service
|
||||
|
||||
[Unit]
|
||||
Description=mempooldotguide
|
||||
Wants=www.service docker_images.service
|
||||
After=www.service docker_images.service
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/opt/mynode/mempooldotguide
|
||||
|
||||
ExecStartPre=/usr/bin/is_not_shutting_down.sh
|
||||
ExecStartPre=/bin/bash -c 'if [ -f /usr/bin/service_scripts/pre_mempooldotguide.sh ]; then /bin/bash /usr/bin/service_scripts/pre_mempooldotguide.sh; fi'
|
||||
ExecStart=FILL_IN_EXECSTART
|
||||
ExecStartPost=/bin/bash -c 'if [ -f /usr/bin/service_scripts/post_mempooldotguide.sh ]; then /bin/bash /usr/bin/service_scripts/post_mempooldotguide.sh; fi'
|
||||
#ExecStop=FILL_IN_EXECSTOP_AND_UNCOMMENT_IF_NEEDED
|
||||
|
||||
User=mempooldotguide
|
||||
Group=mempooldotguide
|
||||
Type=simple
|
||||
TimeoutSec=120
|
||||
Restart=always
|
||||
RestartSec=60
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
SyslogIdentifier=mempooldotguide
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
```` # to remove
|
||||
[Service]
|
||||
WorkingDirectory=/mnt/hdd/mynode/mempool
|
||||
EnvironmentFile=/mnt/hdd/mynode/settings/.btcrpc_environment
|
||||
ExecStartPre=/usr/bin/is_not_shutting_down.sh
|
||||
ExecStartPre=/usr/bin/wait_on_bitcoin.sh
|
||||
ExecStartPre=/usr/bin/wait_on_docker_image_install.sh
|
||||
ExecStartPre=+/usr/bin/service_scripts/pre_mempool.sh
|
||||
ExecStart=/usr/local/bin/docker-compose up
|
||||
ExecStartPost=/usr/bin/service_scripts/post_mempool.sh
|
||||
|
||||
ExecStop=/usr/local/bin/docker-compose down
|
17
nginx/https_mempooldotguide.conf
Normal file
17
nginx/https_mempooldotguide.conf
Normal file
@ -0,0 +1,17 @@
|
||||
server {
|
||||
listen 40001 ssl;
|
||||
server_name mempooldotguide;
|
||||
|
||||
include /etc/nginx/mynode/mynode_ssl_params.conf;
|
||||
include /etc/nginx/mynode/mynode_ssl_cert_key.conf;
|
||||
|
||||
access_log /var/log/nginx/access_mempooldotguide.log;
|
||||
error_log /var/log/nginx/error_mempooldotguide.log;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:40000;
|
||||
|
||||
include /etc/nginx/mynode/mynode_ssl_proxy_params.conf;
|
||||
}
|
||||
|
||||
}
|
BIN
screenshots/.DS_Store
vendored
Normal file
BIN
screenshots/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
screenshots/1.png
Normal file
BIN
screenshots/1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1010 KiB |
BIN
screenshots/2.png
Normal file
BIN
screenshots/2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 995 KiB |
BIN
screenshots/3.png
Normal file
BIN
screenshots/3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 MiB |
BIN
screenshots/4.png
Normal file
BIN
screenshots/4.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 MiB |
17
scripts/install_mempooldotguide.sh
Normal file
17
scripts/install_mempooldotguide.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#!/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.
|
||||
|
||||
# TODO: Perform installation steps here
|
||||
|
||||
echo "================== DONE INSTALLING APP ================="
|
40
scripts/post_mempooldotguide.sh
Normal file
40
scripts/post_mempooldotguide.sh
Normal file
@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
|
||||
source /usr/share/mynode/mynode_config.sh
|
||||
|
||||
sleep 10s
|
||||
|
||||
# initalize mysql db (REQUIRED TO START MYSQL)
|
||||
isRunning=""
|
||||
|
||||
# check on loop if mysql db is running. when running initialize
|
||||
while [ 1 ]; do
|
||||
# Check if mempool mysql db is running (check the db container)
|
||||
isRunning=$(docker inspect --format="{{.State.Running}}" mempool_db_1)
|
||||
if [ "$isRunning" == "true" ]; then
|
||||
sleep 5s
|
||||
|
||||
# Initialize database
|
||||
databases=$(docker exec -i mempool_db_1 mysql -uroot -padmin -e "SHOW DATABASES;")
|
||||
if [[ "$databases" == *"information_schema"* ]]; then # Check DB is responding
|
||||
if [[ "$databases" == *"mempool"* ]]; then
|
||||
# DB found, exit 0
|
||||
exit 0
|
||||
else
|
||||
# Setup a database for mempool
|
||||
$(docker exec -i mempool_db_1 mysql -uroot -padmin -e "drop database mempool;")
|
||||
$(docker exec -i mempool_db_1 mysql -uroot -padmin -e "create database mempool;")
|
||||
$(docker exec -i mempool_db_1 mysql -uroot -padmin -e "grant all privileges on mempool.* to 'mempool'@'%' identified by 'mempool';")
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
else
|
||||
echo "Waiting to initialize mempool DB..."
|
||||
sleep 10s
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
22
scripts/pre_mempooldotguide.sh
Normal file
22
scripts/pre_mempooldotguide.sh
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
source /usr/share/mynode/mynode_config.sh
|
||||
source /usr/share/mynode/mynode_app_versions.sh
|
||||
|
||||
set -x
|
||||
|
||||
BTCRPCPW=$(cat /mnt/hdd/mynode/settings/.btcrpcpw)
|
||||
|
||||
cp -f /usr/share/mynode/mempool-docker-compose.yml /mnt/hdd/mynode/mempool/docker-compose.yml
|
||||
|
||||
cp -f /usr/share/mynode/mempool.env /mnt/hdd/mynode/mempool/.env
|
||||
sed -i "s/VERSION=.*/VERSION=$MEMPOOL_VERSION/g" /mnt/hdd/mynode/mempool/.env
|
||||
sed -i "s/BITCOIN_RPC_PASS=.*/BITCOIN_RPC_PASS=$BTCRPCPW/g" /mnt/hdd/mynode/mempool/.env
|
||||
|
||||
if [ $IS_RASPI -eq 1 ] && [ $IS_ARM64 -eq 0 ]; then
|
||||
sed -i "s|MARIA_DB_IMAGE=.*|MARIA_DB_IMAGE=hypriot/rpi-mysql:latest|g" /mnt/hdd/mynode/mempool/.env
|
||||
else
|
||||
sed -i "s|MARIA_DB_IMAGE=.*|MARIA_DB_IMAGE=mariadb:10.9.3|g" /mnt/hdd/mynode/mempool/.env
|
||||
fi
|
||||
|
||||
chown -R mempool:mempool /mnt/hdd/mynode/mempool
|
14
scripts/uninstall_mempooldotguide.sh
Normal file
14
scripts/uninstall_mempooldotguide.sh
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
source /usr/share/mynode/mynode_device_info.sh
|
||||
source /usr/share/mynode/mynode_app_versions.sh
|
||||
|
||||
echo "==================== UNINSTALLING APP ===================="
|
||||
|
||||
cd /mnt/hdd/mynode/mempool
|
||||
docker-compose rm
|
||||
rm -rf data
|
||||
rm -rf mysql/data
|
||||
cd ~
|
||||
|
||||
echo "================== DONE UNINSTALLING APP ================="
|
32
www/python/mempooldotguide.py
Normal file
32
www/python/mempooldotguide.py
Normal file
@ -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_mempooldotguide = Blueprint('mynode_mempooldotguide',__name__)
|
||||
|
||||
|
||||
### Page functions (have prefix /app/<app name/)
|
||||
@mynode_mempooldotguide.route("/info")
|
||||
def mempooldotguide_page():
|
||||
check_logged_in()
|
||||
|
||||
app = get_application("mempooldotguide")
|
||||
app_status = get_application_status("mempooldotguide")
|
||||
app_status_color = get_application_status_color("mempooldotguide")
|
||||
|
||||
# Load page
|
||||
templateData = {
|
||||
"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', **templateData)
|
||||
|
3
www/templates/README
Normal file
3
www/templates/README
Normal file
@ -0,0 +1,3 @@
|
||||
Custom Jinja templates (HTML files) can be added here for unique application pages
|
||||
|
||||
Templates will be available under applications/<short_name>/xyz.html
|
54
www/templates/mempooldotguide.html
Normal file
54
www/templates/mempooldotguide.html
Normal file
@ -0,0 +1,54 @@
|
||||
<!DOCTYPE html lang="en">
|
||||
<head>
|
||||
<title>{{ title }}</title>
|
||||
{% include 'includes/head.html' %}
|
||||
</head>
|
||||
<body>
|
||||
{% include 'includes/logo_header.html' %}
|
||||
<div class="mynode_top_left_div">
|
||||
<a href="/"><img class="mynode_nav_icon" src="{{ url_for('static', filename="images/home.png")}}"/></a>
|
||||
</div>
|
||||
|
||||
<div class="main_header">{{app.name}} (custom page - remove)</div>
|
||||
<br/>
|
||||
|
||||
<div class="app_tile_row">
|
||||
<div class="info_tile">
|
||||
<div class="info_tile_header">Status</div>
|
||||
<div class="info_tile_contents">
|
||||
<table class="info_table">
|
||||
<tr>
|
||||
<th>Status</th>
|
||||
<td>{{app_status}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Actions</th>
|
||||
<td>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button_small" style="width: 100px;" href="#">Open</a>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button_small" style="width: 100px;" href="#">Button A</a>
|
||||
<a class="ui-button ui-widget ui-corner-all mynode_button_small" style="width: 100px;" href="#">Button B</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="instructions">
|
||||
<div class="instructions-header">Instructions</div>
|
||||
<ol class="instructions-steps">
|
||||
<li>Custom instructions?</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div id="confirm-dialog"></div>
|
||||
|
||||
<div id="loading_spinner_overlay" class="loading_spinner_overlay" style="display:none;">
|
||||
<img id="loading_spinner" class="loading_image" src="{{ url_for('static', filename="images/loading.gif")}}"/>
|
||||
<br/>
|
||||
<span id="loading_spinner_message">Loading...</span>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user