#3429 app bonus scripts all give version information for WebUI (#3518)

* add version to template

* add version to RTL

* fix RTL verison

* add lnbits version

* add version to mempool

* add version to thunderhub

* add version to btc rpc explorer

* add version to BTCpayServer
This commit is contained in:
/rootzoll 2022-12-14 11:54:06 +01:00 committed by GitHub
parent 5a3b3f78d8
commit 7ac2d214f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 30 additions and 11 deletions

View file

@ -4,6 +4,8 @@
# ~/.config/btc-rpc-explorer.env # ~/.config/btc-rpc-explorer.env
# https://github.com/janoside/btc-rpc-explorer/blob/master/.env-sample # https://github.com/janoside/btc-rpc-explorer/blob/master/.env-sample
VERSION="v3.3.0"
# command info # command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "# small config script to switch BTC-RPC-explorer on or off" echo "# small config script to switch BTC-RPC-explorer on or off"
@ -79,6 +81,8 @@ fi
# status # status
if [ "$1" = "status" ]; then if [ "$1" = "status" ]; then
echo "version='${VERSION}'"
if [ "${BTCRPCexplorer}" = "on" ]; then if [ "${BTCRPCexplorer}" = "on" ]; then
echo "configured=1" echo "configured=1"
@ -209,7 +213,7 @@ if [ "$1" = "install" ]; then
cd /home/btcrpcexplorer cd /home/btcrpcexplorer
sudo -u btcrpcexplorer git clone https://github.com/janoside/btc-rpc-explorer.git sudo -u btcrpcexplorer git clone https://github.com/janoside/btc-rpc-explorer.git
cd btc-rpc-explorer cd btc-rpc-explorer
sudo -u btcrpcexplorer git reset --hard v3.3.0 sudo -u btcrpcexplorer git reset --hard ${VERSION}
sudo -u btcrpcexplorer /home/admin/config.scripts/blitz.git-verify.sh "${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" || exit 1 sudo -u btcrpcexplorer /home/admin/config.scripts/blitz.git-verify.sh "${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" || exit 1
sudo -u btcrpcexplorer npm install sudo -u btcrpcexplorer npm install
if ! [ $? -eq 0 ]; then if ! [ $? -eq 0 ]; then

View file

@ -94,6 +94,8 @@ explorer.postgres=User ID=nbxplorer;Host=localhost;Port=5432;Application Name=nb
if [ "$1" = "status" ]; then if [ "$1" = "status" ]; then
echo "version='${BTCPayVersion}'"
isInstalled=$(compgen -u | grep -c btcpay) isInstalled=$(compgen -u | grep -c btcpay)
echo "prepared=${isInstalled}" echo "prepared=${isInstalled}"
isActive=$(sudo ls /etc/systemd/system/btcpayserver.service 2>/dev/null | grep -c 'btcpayserver.service') isActive=$(sudo ls /etc/systemd/system/btcpayserver.service 2>/dev/null | grep -c 'btcpayserver.service')

View file

@ -4,11 +4,12 @@
# https://github.com/lnbits/lnbits-legend/releases # https://github.com/lnbits/lnbits-legend/releases
tag="0.9.4" tag="0.9.4"
VERSION="${tag}"
# command info # command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "Config script to switch LNbits on or off." echo "Config script to switch LNbits on or off."
echo "Installs the version ${tag} by default." echo "Installs the version ${VERSION} by default."
echo "Usage:" echo "Usage:"
echo "bonus.lnbits.sh [install|uninstall] [?GITHUBUSER] [?BRANCH|?TAG]" echo "bonus.lnbits.sh [install|uninstall] [?GITHUBUSER] [?BRANCH|?TAG]"
echo "bonus.lnbits.sh on [lnd|tlnd|slnd|cl|tcl|scl]" echo "bonus.lnbits.sh on [lnd|tlnd|slnd|cl|tcl|scl]"
@ -365,6 +366,8 @@ fi
# status # status
if [ "$1" = "status" ]; then if [ "$1" = "status" ]; then
echo "version='${VERSION}'"
if [ "${LNBits}" = "on" ]; then if [ "${LNBits}" = "on" ]; then
echo "installed=1" echo "installed=1"

View file

@ -66,6 +66,8 @@ fi
# status # status
if [ "$1" = "status" ]; then if [ "$1" = "status" ]; then
echo "version='${pinnedVersion}'"
isInstalled=$(compgen -u | grep -c mempool) isInstalled=$(compgen -u | grep -c mempool)
echo "codebase=${isInstalled}" echo "codebase=${isInstalled}"

View file

@ -66,6 +66,8 @@ if [ "$1" = "status" ] || [ "$1" = "menu" ]; then
RTLHTTPS=$((RTLHTTP+1)) RTLHTTPS=$((RTLHTTP+1))
if [ "$1" = "status" ]; then if [ "$1" = "status" ]; then
echo "version='${RTLVERSION}'"
echo "installed='${isInstalled}'" echo "installed='${isInstalled}'"
echo "localIP='${localip}'" echo "localIP='${localip}'"
echo "httpPort='${RTLHTTP}'" echo "httpPort='${RTLHTTP}'"

View file

@ -10,13 +10,17 @@
# should be same as used in name if script # should be same as used in name if script
APPID="template" # one-word lower-case no-specials APPID="template" # one-word lower-case no-specials
# clean human readable version - will be displayed in UI
# just numbers only seperated by dots (2 or 0.1 or 1.3.4 or 3.4.5.2)
VERSION="0.1"
# the git repo to get the source code from for install # the git repo to get the source code from for install
GITHUB_REPO="https://github.com/rootzoll/webapp-template" GITHUB_REPO="https://github.com/rootzoll/webapp-template"
# the github tag of the version of the source code to install # the github tag of the version of the source code to install
# can also be a commit hash # can also be a commit hash
# if empty it will use the latest source version # if empty it will use the latest source version
GITHUB_VERSION="v0.1" GITHUB_TAG="v0.1"
# the github signature to verify the author # the github signature to verify the author
# leave GITHUB_SIGN_AUTHOR empty to skip verifying # leave GITHUB_SIGN_AUTHOR empty to skip verifying
@ -36,11 +40,11 @@ PORT_TOR_SSL="12348"
# to see how you can deal with an app that installs multiple instances depending on # to see how you can deal with an app that installs multiple instances depending on
# lightning implementation or testnets - but this should be OK for a start: # lightning implementation or testnets - but this should be OK for a start:
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "# bonus.${APPID}.sh status -> status information (key=value)" echo "# bonus.${APPID}.sh status -> status information (key=value)"
echo "# bonus.${APPID}.sh on -> install the app" echo "# bonus.${APPID}.sh on -> install the app"
echo "# bonus.${APPID}.sh off -> uninstall the app" echo "# bonus.${APPID}.sh off -> uninstall the app"
echo "# bonus.${APPID}.sh menu -> SSH menu dialog" echo "# bonus.${APPID}.sh menu -> SSH menu dialog"
echo "# bonus.${APPID}.sh prestart -> will be called by systemd before start" echo "# bonus.${APPID}.sh prestart -> will be called by systemd before start"
exit 1 exit 1
fi fi
@ -76,8 +80,9 @@ fi
# status information as a key=value list # status information as a key=value list
if [ "$1" = "status" ]; then if [ "$1" = "status" ]; then
echo "appID='${APPID}'" echo "appID='${APPID}'"
echo "version='${VERSION}'"
echo "githubRepo='${GITHUB_REPO}'" echo "githubRepo='${GITHUB_REPO}'"
echo "githubVersion='${GITHUB_VERSION}'" echo "githubVersion='${GITHUB_TAG}'"
echo "githubSignature='${GITHUB_SIGNATURE}'" echo "githubSignature='${GITHUB_SIGNATURE}'"
echo "isInstalled=${isInstalled}" echo "isInstalled=${isInstalled}"
echo "isRunning=${isRunning}" echo "isRunning=${isRunning}"
@ -197,10 +202,10 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
echo "# download the source code & verify" echo "# download the source code & verify"
sudo -u ${APPID} git clone ${GITHUB_REPO} /home/${APPID}/${APPID} sudo -u ${APPID} git clone ${GITHUB_REPO} /home/${APPID}/${APPID}
cd /home/${APPID}/${APPID} cd /home/${APPID}/${APPID}
sudo -u ${APPID} git reset --hard $GITHUB_VERSION sudo -u ${APPID} git reset --hard $GITHUB_TAG
if [ "${GITHUB_SIGN_AUTHOR}" != "" ]; then if [ "${GITHUB_SIGN_AUTHOR}" != "" ]; then
sudo -u ${APPID} /home/admin/config.scripts/blitz.git-verify.sh \ sudo -u ${APPID} /home/admin/config.scripts/blitz.git-verify.sh \
"${GITHUB_SIGN_AUTHOR}" "${GITHUB_SIGN_PUBKEYLINK}" "${GITHUB_SIGN_FINGERPRINT}" "${GITHUB_VERSION}" || exit 1 "${GITHUB_SIGN_AUTHOR}" "${GITHUB_SIGN_PUBKEYLINK}" "${GITHUB_SIGN_FINGERPRINT}" "${GITHUB_TAG}" || exit 1
fi fi
# compile/install the app # compile/install the app

View file

@ -32,6 +32,7 @@ if [ "$1" = "status" ] || [ "$1" = "menu" ]; then
httpsPort="3011" httpsPort="3011"
if [ "$1" = "status" ]; then if [ "$1" = "status" ]; then
echo "version='${THUBVERSION}'"
echo "installed='${isInstalled}'" echo "installed='${isInstalled}'"
echo "localIP='${localip}'" echo "localIP='${localip}'"
echo "httpPort='${httpPort}'" echo "httpPort='${httpPort}'"