add git-verify to joinmarket-webui install (#3005)

* add git-verify
use git clone instead of wget
small fixes

* add note about the connection details in the menu
This commit is contained in:
openoms 2022-03-02 10:21:00 +00:00 committed by GitHub
parent 99cc8d6b27
commit 16d83a8f7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,22 +31,22 @@ if [ "$1" = "menu" ]; then
fingerprint=$(openssl x509 -in /mnt/hdd/app-data/nginx/tls.cert -fingerprint -noout | cut -d"=" -f2) fingerprint=$(openssl x509 -in /mnt/hdd/app-data/nginx/tls.cert -fingerprint -noout | cut -d"=" -f2)
if [ "${runBehindTor}" = "on" ] && [ ${#toraddress} -gt 0 ]; then if [ "${runBehindTor}" = "on" ] && [ ${#toraddress} -gt 0 ]; then
# Info with TOR # Info with Tor
sudo /home/admin/config.scripts/blitz.display.sh qr "${toraddress}" sudo /home/admin/config.scripts/blitz.display.sh qr "${toraddress}"
whiptail --title " JoinMarket Web UI " --msgbox "Open in your local web browser: whiptail --title " JoinMarket Web UI " --msgbox "Open in your local web browser:
https://${localip}:7501\n https://${localip}:7501\n
with Fingerprint: with Fingerprint:
${fingerprint}\n ${fingerprint}\n
Hidden Service address for TOR Browser (see LCD for QR):\n${toraddress} Hidden Service address for Tor Browser (see LCD for QR):\n${toraddress}
" 16 67 " 16 67
sudo /home/admin/config.scripts/blitz.display.sh hide sudo /home/admin/config.scripts/blitz.display.sh hide
else else
# Info without TOR # Info without Tor
whiptail --title " JoinMarket Web UI " --msgbox "Open in your local web browser & accept self-signed cert: whiptail --title " JoinMarket Web UI " --msgbox "Open in your local web browser & accept self-signed cert:
https://${localip}:7501\n https://${localip}:7501\n
with Fingerprint: with Fingerprint:
${fingerprint}\n ${fingerprint}\n
Activate TOR to access the web interface from outside your local network. Activate Tor to access the web interface from outside your local network.
" 15 57 " 15 57
fi fi
echo "please wait ..." echo "please wait ..."
@ -74,17 +74,24 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
/home/admin/config.scripts/bonus.nodejs.sh on /home/admin/config.scripts/bonus.nodejs.sh on
# install JoinMarket Web UI # install JoinMarket Web UI
cd $HOME_DIR cd $HOME_DIR || exit 1
sudo -u $USERNAME wget https://github.com/$REPO/archive/refs/tags/v$WEBUI_VERSION.tar.gz sudo -u $USERNAME git clone https://github.com/$REPO
sudo -u $USERNAME tar -xzf v$WEBUI_VERSION.tar.gz
sudo -u $USERNAME rm v$WEBUI_VERSION.tar.gz
sudo -u $USERNAME mv joinmarket-webui-$WEBUI_VERSION $APP_DIR
cd $APP_DIR cd joinmarket-webui || exit 1
sudo -u $USERNAME git reset --hard v${WEBUI_VERSION}
GITHUB_SIGN_AUTHOR="web-flow"
GITHUB_SIGN_PUBKEYLINK="https://github.com/web-flow.gpg"
GITHUB_SIGN_FINGERPRINT="4AEE18F83AFDEB23"
sudo -u $USERNAME /home/admin/config.scripts/blitz.git-verify.sh \
"${GITHUB_SIGN_AUTHOR}" "${GITHUB_SIGN_PUBKEYLINK}" "${GITHUB_SIGN_FINGERPRINT}" || exit 1
cd $HOME_DIR || exit 1
sudo -u $USERNAME mv joinmarket-webui $APP_DIR
cd $APP_DIR || exit 1
sudo -u $USERNAME rm -rf docker sudo -u $USERNAME rm -rf docker
sudo -u $USERNAME npm install if ! sudo -u $USERNAME npm install; then
if ! [ $? -eq 0 ]; then
echo "FAIL - npm install did not run correctly, aborting" echo "FAIL - npm install did not run correctly, aborting"
exit 1 exit 1
fi fi
@ -118,7 +125,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo -u $USERNAME mkdir -p $HOME_DIR/.joinmarket/ssl/ \ sudo -u $USERNAME mkdir -p $HOME_DIR/.joinmarket/ssl/ \
&& pushd "$_" \ && pushd "$_" \
&& sudo -u $USERNAME openssl req -newkey rsa:4096 -x509 -sha256 -days 3650 -nodes -out cert.pem -keyout key.pem -subj "$subj" \ && sudo -u $USERNAME openssl req -newkey rsa:4096 -x509 -sha256 -days 3650 -nodes -out cert.pem -keyout key.pem -subj "$subj" \
&& popd && popd || exit 1
################## ##################
# SYSTEMD SERVICE # SYSTEMD SERVICE
@ -171,6 +178,10 @@ WantedBy=multi-user.target
else else
echo "*** JOINMARKET WEB UI ALREADY INSTALLED ***" echo "*** JOINMARKET WEB UI ALREADY INSTALLED ***"
fi fi
echo
echo "# For the connection details run:"
echo "/home/admin/config.scripts/bonus.joinmarket-webui.sh menu"
echo
exit 0 exit 0
fi fi
@ -215,7 +226,7 @@ if [ "$1" = "update" ]; then
sudo -u $USERNAME mv joinmarket-webui-$version $APP_DIR-update sudo -u $USERNAME mv joinmarket-webui-$version $APP_DIR-update
fi fi
cd $APP_DIR-update cd $APP_DIR-update || exit 1
sudo -u $USERNAME rm -rf docker sudo -u $USERNAME rm -rf docker
sudo -u $USERNAME npm install sudo -u $USERNAME npm install
if ! [ $? -eq 0 ]; then if ! [ $? -eq 0 ]; then
@ -244,7 +255,7 @@ fi
# switch off # switch off
if [ "$1" = "0" ] || [ "$1" = "off" ]; then if [ "$1" = "0" ] || [ "$1" = "off" ]; then
isInstalled=$(sudo ls $HOME_DIR 2>/dev/null | grep -c "$APP_DIR") isInstalled=$(sudo ls $HOME_DIR 2>/dev/null | grep -c "$APP_DIR")
if [ ${isInstalled} -eq 1 ]; then if [ "${isInstalled}" -eq 1 ]; then
echo "*** UNINSTALL JOINMARKET WEB UI ***" echo "*** UNINSTALL JOINMARKET WEB UI ***"
# remove systemd service # remove systemd service