Merge branch 'v1.7' into dev

This commit is contained in:
rootzoll
2022-03-08 20:43:27 +01:00
8 changed files with 67 additions and 83 deletions

View File

@@ -236,7 +236,7 @@ if [ "${lightning}" != "" ]; then
else
source <(/home/admin/_cache.sh meta ln_${lightning}_${chain}net_fees_total)
ln_totalfees="${value}"
ln_feeReport="Fee Report: ${color_green}${ln_totalfees} ${color_gray}${netprefix}sat"
ln_feeReport="Fee Report: ${color_green}${ln_totalfees} ${color_gray}${netprefix}msat"
fi
# on-chain wallet info

View File

@@ -1,34 +0,0 @@
## joinmarket_webui.conf
server {
listen 7500;
listen [::1]:7500;
server_name _;
access_log /var/log/nginx/access_joinmarket_webui.log;
error_log /var/log/nginx/error_joinmarket_webui.log;
gzip on;
gzip_types application/javascript application/json text/css image/svg+xml;
root /home/joinmarket/webui/build;
index index.html;
location /api/ {
include /etc/nginx/snippets/proxy-params.conf;
proxy_pass https://127.0.0.1:28183;
}
location /ws/ {
include /etc/nginx/snippets/proxy-params.conf;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_pass https://127.0.0.1:28183;
}
location / {
include /etc/nginx/snippets/proxy-params.conf;
try_files $uri $uri/ /index.html;
add_header Cache-Control no-cache;
}
}

View File

@@ -19,6 +19,10 @@ server {
location /api/ {
include /etc/nginx/snippets/ssl-proxy-params.conf;
proxy_set_header Authorization $http_x_jm_authorization;
proxy_set_header x-jm-authorization "";
proxy_pass https://127.0.0.1:28183;
}

View File

@@ -16,6 +16,10 @@ server {
location /api/ {
include /etc/nginx/snippets/proxy-params.conf;
proxy_set_header Authorization $http_x_jm_authorization;
proxy_set_header x-jm-authorization "";
proxy_pass https://127.0.0.1:28183;
}

View File

@@ -19,6 +19,10 @@ server {
location /api/ {
include /etc/nginx/snippets/ssl-proxy-params.conf;
proxy_set_header Authorization $http_x_jm_authorization;
proxy_set_header x-jm-authorization "";
proxy_pass https://127.0.0.1:28183;
}

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)
if [ "${runBehindTor}" = "on" ] && [ ${#toraddress} -gt 0 ]; then
# Info with TOR
# Info with Tor
sudo /home/admin/config.scripts/blitz.display.sh qr "${toraddress}"
whiptail --title " JoinMarket Web UI " --msgbox "Open in your local web browser:
https://${localip}:7501\n
with Fingerprint:
${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
sudo /home/admin/config.scripts/blitz.display.sh hide
else
# Info without TOR
# Info without Tor
whiptail --title " JoinMarket Web UI " --msgbox "Open in your local web browser & accept self-signed cert:
https://${localip}:7501\n
with Fingerprint:
${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
fi
echo "please wait ..."
@@ -74,19 +74,26 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
/home/admin/config.scripts/bonus.nodejs.sh on
# 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 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
sudo -u $USERNAME git clone https://github.com/$REPO
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 npm install
if ! [ $? -eq 0 ]; then
echo "FAIL - npm install did not run correctly, aborting"
exit 1
if ! sudo -u $USERNAME npm install; then
echo "FAIL - npm install did not run correctly, aborting"
exit 1
fi
sudo -u $USERNAME npm run build
@@ -95,15 +102,9 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
# NGINX
##################
# setup nginx symlinks
if ! [ -f /etc/nginx/sites-available/joinmarket_webui_ssl.conf ]; then
sudo cp -f /home/admin/assets/nginx/sites-available/joinmarket_webui_ssl.conf /etc/nginx/sites-available/joinmarket_webui_ssl.conf
fi
if ! [ -f /etc/nginx/sites-available/joinmarket_webui_tor.conf ]; then
sudo cp /home/admin/assets/nginx/sites-available/joinmarket_webui_tor.conf /etc/nginx/sites-available/joinmarket_webui_tor.conf
fi
if ! [ -f /etc/nginx/sites-available/joinmarket_webui_tor_ssl.conf ]; then
sudo cp /home/admin/assets/nginx/sites-available/joinmarket_webui_tor_ssl.conf /etc/nginx/sites-available/joinmarket_webui_tor_ssl.conf
fi
sudo cp -f /home/admin/assets/nginx/sites-available/joinmarket_webui_ssl.conf /etc/nginx/sites-available/joinmarket_webui_ssl.conf
sudo cp -f /home/admin/assets/nginx/sites-available/joinmarket_webui_tor.conf /etc/nginx/sites-available/joinmarket_webui_tor.conf
sudo cp -f /home/admin/assets/nginx/sites-available/joinmarket_webui_tor_ssl.conf /etc/nginx/sites-available/joinmarket_webui_tor_ssl.conf
sudo ln -sf /etc/nginx/sites-available/joinmarket_webui_ssl.conf /etc/nginx/sites-enabled/
sudo ln -sf /etc/nginx/sites-available/joinmarket_webui_tor.conf /etc/nginx/sites-enabled/
sudo ln -sf /etc/nginx/sites-available/joinmarket_webui_tor_ssl.conf /etc/nginx/sites-enabled/
@@ -117,17 +118,14 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
echo ""
# SSL
if ! [ -d $HOME_DIR/.joinmarket/ssl ]; then
sudo -u $USERNAME mkdir -p $HOME_DIR/.joinmarket/ssl
fi
if ! [ -f $HOME_DIR/.joinmarket/ssl/cert.pem ]; then
sudo ln -sf /mnt/hdd/app-data/nginx/tls.cert $HOME_DIR/.joinmarket/ssl/cert.pem
sudo chown $USERNAME:$USERNAME $HOME_DIR/.joinmarket/ssl/cert.pem
fi
if ! [ -f $HOME_DIR/.joinmarket/ssl/key.pem ]; then
sudo ln -sf /mnt/hdd/app-data/nginx/tls.key $HOME_DIR/.joinmarket/ssl/key.pem
sudo chown $USERNAME:$USERNAME $HOME_DIR/.joinmarket/ssl/key.pem
if [ -d $HOME_DIR/.joinmarket/ssl ]; then
sudo -u $USERNAME rm -rf $HOME_DIR/.joinmarket/ssl
fi
subj="/C=US/ST=Utah/L=Lehi/O=Your Company, Inc./OU=IT/CN=example.com"
sudo -u $USERNAME mkdir -p $HOME_DIR/.joinmarket/ssl/ \
&& pushd "$_" \
&& sudo -u $USERNAME openssl req -newkey rsa:4096 -x509 -sha256 -days 3650 -nodes -out cert.pem -keyout key.pem -subj "$subj" \
&& popd || exit 1
##################
# SYSTEMD SERVICE
@@ -139,7 +137,6 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
[Unit]
Description=JoinMarket API daemon
# Make sure lnd starts after bitcoind is ready
Requires=bitcoind.service
After=bitcoind.service
@@ -181,6 +178,10 @@ WantedBy=multi-user.target
else
echo "*** JOINMARKET WEB UI ALREADY INSTALLED ***"
fi
echo
echo "# For the connection details run:"
echo "/home/admin/config.scripts/bonus.joinmarket-webui.sh menu"
echo
exit 0
fi
@@ -188,7 +189,7 @@ fi
# precheck
if [ "$1" = "precheck" ]; then
if [ $(/usr/local/bin/bitcoin-cli -conf=/mnt/hdd/bitcoin/bitcoin.conf listwallets | grep -c wallet.dat) -eq 0 ];then
echo "# Create wallet.dat"
echo "# Create wallet.dat"
/usr/local/bin/bitcoin-cli -conf=/mnt/hdd/bitcoin/bitcoin.conf createwallet wallet.dat
else
echo "# The wallet.dat is loaded in bitcoind."
@@ -225,7 +226,7 @@ if [ "$1" = "update" ]; then
sudo -u $USERNAME mv joinmarket-webui-$version $APP_DIR-update
fi
cd $APP_DIR-update
cd $APP_DIR-update || exit 1
sudo -u $USERNAME rm -rf docker
sudo -u $USERNAME npm install
if ! [ $? -eq 0 ]; then
@@ -254,7 +255,7 @@ fi
# switch off
if [ "$1" = "0" ] || [ "$1" = "off" ]; then
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 ***"
# remove systemd service

View File

@@ -658,8 +658,15 @@ if [ "$1" = "switch" ]; then
echo "# allowing lnbits user as part of the bitcoin group to RW RPC hook"
sudo chmod 770 /home/bitcoin/.lightning/bitcoin${clrpcsubdir}
sudo chmod 660 /home/bitcoin/.lightning/bitcoin${clrpcsubdir}/lightning-rpc
echo "# check the lightning-rpc socket"
sudo ls -la /home/bitcoin/.lightning/bitcoin${clrpcsubdir}/lightning-rpc
if [ "${fundingsource}" == "cl" ]; then
CLCONF="/home/bitcoin/.lightning/config"
else
CLCONF="/home/bitcoin/.lightning${clrpcsubdir}/config"
fi
# https://github.com/rootzoll/raspiblitz/issues/3007
if [ "$(sudo cat ${CLCONF} | grep -c "^rpc-file-mode=0660")" -eq 0 ]; then
echo "rpc-file-mode=0660" | sudo tee -a ${CLCONF}
fi
echo "# preparing lnbits config for c-lightning"
sudo bash -c "echo 'LNBITS_BACKEND_WALLET_CLASS=CLightningWallet' >> /home/lnbits/lnbits/.env"
@@ -670,7 +677,7 @@ if [ "$1" = "switch" ]; then
/home/admin/config.scripts/blitz.conf.sh set LNBitsFunding "${fundingsource}"
echo "##############"
echo "# OK new fundig source set - does need restart or call: sudo systemctl restart lnbits"
echo "# OK new funding source set - does need restart or call: sudo systemctl restart lnbits"
echo "##############"
exit 0

View File

@@ -61,11 +61,9 @@ if [ $(grep -c "^feeadjuster" < ${CLCONF}) -gt 0 ];then
fi
fi
if [ ${CHAIN} = "testnet" ]; then
clrpcsubdir="/testnet"
elif [ ${CHAIN} = "signet" ]; then
clrpcsubdir="/signet"
fi
# make the lightning-rpc socket group readable
chmod 770 /home/bitcoin/.lightning/bitcoin${clrpcsubdir}
chmod 660 /home/bitcoin/.lightning/bitcoin${clrpcsubdir}/lightning-rpc
if [ "${LNBitsFunding}" = "${netprefix}cl" ]; then
# https://github.com/rootzoll/raspiblitz/issues/3007
if [ $(grep -c "^rpc-file-mode=0660" < ${CLCONF}) -eq 0 ]; then
echo "rpc-file-mode=0660" | tee -a ${CLCONF}
fi
fi