mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-28 16:58:03 +01:00
parent
c5c984f3e5
commit
e4c51fe22e
10 changed files with 48 additions and 24 deletions
|
@ -338,27 +338,31 @@ elif [ "${abcd}" = "b" ]; then
|
||||||
sed -i "s/^rpcpassword=.*/rpcpassword=${newPassword}/g" /mnt/hdd/${network}/${network}.conf 2>/dev/null
|
sed -i "s/^rpcpassword=.*/rpcpassword=${newPassword}/g" /mnt/hdd/${network}/${network}.conf 2>/dev/null
|
||||||
sed -i "s/^rpcpassword=.*/rpcpassword=${newPassword}/g" /home/admin/.${network}/${network}.conf 2>/dev/null
|
sed -i "s/^rpcpassword=.*/rpcpassword=${newPassword}/g" /home/admin/.${network}/${network}.conf 2>/dev/null
|
||||||
|
|
||||||
# NOTE: now other bonus apps configs that need passwordB need to be adapted manually
|
# dont reboot - starting either services manually below or they get restarted thru
|
||||||
# bonus apps that use a "prestart" will adapt themselves on service restart after reboot
|
# systemd dependencies like on bitcoind (Partof=...) after all configs changed
|
||||||
|
reboot=0;
|
||||||
|
|
||||||
# blitzweb
|
echo "# restart bitcoind"
|
||||||
if ! [ -f /etc/nginx/.htpasswd ]; then
|
sudo systemctl restart ${network}d
|
||||||
echo "${newPassword}" | sudo htpasswd -ci /etc/nginx/.htpasswd admin
|
|
||||||
else
|
# NOTE: now other bonus apps configs that need passwordB need to be adapted manually
|
||||||
echo "${newPassword}" | sudo htpasswd -i /etc/nginx/.htpasswd admin
|
# bonus apps that use a "prestart" will adapt themselves on service
|
||||||
fi
|
|
||||||
|
|
||||||
# electrs
|
# electrs
|
||||||
if [ "${ElectRS}" == "on" ]; then
|
if [ "${ElectRS}" == "on" ]; then
|
||||||
echo "# changing the RPC password for ELECTRS"
|
echo "# changing the RPC password for ELECTRS"
|
||||||
RPC_USER=$(cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcuser | cut -c 9-)
|
RPC_USER=$(cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcuser | cut -c 9-)
|
||||||
sudo sed -i "s/^auth = \"$RPC_USER.*\"/auth = \"$RPC_USER:${newPassword}\"/g" /home/electrs/.electrs/config.toml
|
sudo sed -i "s/^auth = \"$RPC_USER.*\"/auth = \"$RPC_USER:${newPassword}\"/g" /home/electrs/.electrs/config.toml
|
||||||
|
echo "# restarting electrs"
|
||||||
|
sudo systemctl restart electrs.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# BTCPayServer
|
# BTCPayServer
|
||||||
if [ "${BTCPayServer}" == "on" ]; then
|
if [ "${BTCPayServer}" == "on" ]; then
|
||||||
echo "# changing the RPC password for BTCPAYSERVER"
|
echo "# changing the RPC password for BTCPAYSERVER"
|
||||||
sudo sed -i "s/^btc.rpc.password=.*/btc.rpc.password=${newPassword}/g" /home/btcpay/.nbxplorer/Main/settings.config
|
sudo sed -i "s/^btc.rpc.password=.*/btc.rpc.password=${newPassword}/g" /home/btcpay/.nbxplorer/Main/settings.config
|
||||||
|
echo "# restarting btcpay server"
|
||||||
|
sudo systemctl restart btcpayserver.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# JoinMarket
|
# JoinMarket
|
||||||
|
@ -367,12 +371,16 @@ elif [ "${abcd}" = "b" ]; then
|
||||||
sudo sed -i "s/^rpc_password =.*/rpc_password = ${newPassword}/g" /home/joinmarket/.joinmarket/joinmarket.cfg
|
sudo sed -i "s/^rpc_password =.*/rpc_password = ${newPassword}/g" /home/joinmarket/.joinmarket/joinmarket.cfg
|
||||||
echo "# changing the password for the 'joinmarket' user"
|
echo "# changing the password for the 'joinmarket' user"
|
||||||
echo "joinmarket:${newPassword}" | sudo chpasswd
|
echo "joinmarket:${newPassword}" | sudo chpasswd
|
||||||
|
echo "# restarting jopinmarket API"
|
||||||
|
sudo systemctl restart joinmarket-api.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ThunderHub
|
# ThunderHub
|
||||||
if [ "${thunderhub}" == "on" ]; then
|
if [ "${thunderhub}" == "on" ]; then
|
||||||
echo "# changing the password for ThunderHub"
|
echo "# changing the password for ThunderHub"
|
||||||
sudo sed -i "s/^masterPassword:.*/masterPassword: '${newPassword}'/g" /mnt/hdd/app-data/thunderhub/thubConfig.yaml
|
sudo sed -i "s/^masterPassword:.*/masterPassword: '${newPassword}'/g" /mnt/hdd/app-data/thunderhub/thubConfig.yaml
|
||||||
|
echo "# restarting thunderhub.service"
|
||||||
|
sudo systemctl restart thunderhub.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# LIT
|
# LIT
|
||||||
|
@ -380,18 +388,26 @@ elif [ "${abcd}" = "b" ]; then
|
||||||
echo "# changing the password for LIT"
|
echo "# changing the password for LIT"
|
||||||
sudo sed -i "s/^uipassword=.*/uipassword=${newPassword}/g" /mnt/hdd/app-data/.lit/lit.conf
|
sudo sed -i "s/^uipassword=.*/uipassword=${newPassword}/g" /mnt/hdd/app-data/.lit/lit.conf
|
||||||
sudo sed -i "s/^faraday.bitcoin.password=.*/faraday.bitcoin.password=${newPassword}/g" /mnt/hdd/app-data/.lit/lit.conf
|
sudo sed -i "s/^faraday.bitcoin.password=.*/faraday.bitcoin.password=${newPassword}/g" /mnt/hdd/app-data/.lit/lit.conf
|
||||||
|
echo "# restarting litd.service"
|
||||||
|
sudo systemctl restart litd.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# i2pd
|
# i2pd
|
||||||
if [ "${i2pd}" == "on" ]; then
|
if [ "${i2pd}" == "on" ]; then
|
||||||
echo "# changing the password for i2pd"
|
echo "# changing the password for i2pd"
|
||||||
sudo sed -i "s/^pass = .*/pass = ${newPassword}/g" /etc/i2pd/i2pd.conf
|
sudo sed -i "s/^pass = .*/pass = ${newPassword}/g" /etc/i2pd/i2pd.conf
|
||||||
|
echo "# restarting i2pd.service"
|
||||||
|
sudo systemctl restart i2pd.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# LNDg
|
# LNDg
|
||||||
if [ "${lndg}" == "on" ]; then
|
if [ "${lndg}" == "on" ]; then
|
||||||
echo "# changing the password for lndg"
|
echo "# changing the password for lndg"
|
||||||
/home/admin/config.scripts/bonus.lndg.sh set-password "${newPassword}"
|
/home/admin/config.scripts/bonus.lndg.sh set-password "${newPassword}"
|
||||||
|
echo "# restarting lndg services"
|
||||||
|
sudo systemctl restart jobs-lndg.service
|
||||||
|
sudo systemctl restart rebalancer-lndg.service
|
||||||
|
sudo systemctl restart htlc-stream-lndg.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# mempool Explorer
|
# mempool Explorer
|
||||||
|
@ -400,6 +416,8 @@ elif [ "${abcd}" = "b" ]; then
|
||||||
sudo jq ".CORE_RPC.PASSWORD=\"${newPassword}\"" /home/mempool/mempool/backend/mempool-config.json > /var/cache/raspiblitz/mempool-config.json
|
sudo jq ".CORE_RPC.PASSWORD=\"${newPassword}\"" /home/mempool/mempool/backend/mempool-config.json > /var/cache/raspiblitz/mempool-config.json
|
||||||
sudo mv /var/cache/raspiblitz/mempool-config.json /home/mempool/mempool/backend/mempool-config.json
|
sudo mv /var/cache/raspiblitz/mempool-config.json /home/mempool/mempool/backend/mempool-config.json
|
||||||
sudo chown mempool:mempool /home/mempool/mempool/backend/mempool-config.json
|
sudo chown mempool:mempool /home/mempool/mempool/backend/mempool-config.json
|
||||||
|
echo "# restarting mempool.service"
|
||||||
|
sudo systemctl restart mempool.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# elements
|
# elements
|
||||||
|
@ -407,11 +425,11 @@ elif [ "${abcd}" = "b" ]; then
|
||||||
echo "# changing the password for elements"
|
echo "# changing the password for elements"
|
||||||
sudo sed -i "s/^rpcpassword=.*/rpcpassword=${newPassword}/g" /home/elements/.elements/elements.conf
|
sudo sed -i "s/^rpcpassword=.*/rpcpassword=${newPassword}/g" /home/elements/.elements/elements.conf
|
||||||
sudo sed -i "s/^mainchainrpcpassword=.*/mainchainrpcpassword=${newPassword}/g" /home/elements/.elements/elements.conf
|
sudo sed -i "s/^mainchainrpcpassword=.*/mainchainrpcpassword=${newPassword}/g" /home/elements/.elements/elements.conf
|
||||||
|
echo "# restarting elementsd.service"
|
||||||
|
sudo systemctl restart elementsd.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "# OK -> RPC Password B changed"
|
echo "# OK -> RPC Password B changed"
|
||||||
echo "# Reboot is needed (will be triggered if interactive menu was called)"
|
|
||||||
echo "error=''"
|
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
############################
|
############################
|
||||||
|
|
|
@ -206,6 +206,7 @@ if [ "${mode}" = "on" ] || [ "${mode}" = "1" ]; then
|
||||||
Description=faraday
|
Description=faraday
|
||||||
Wants=lnd.service
|
Wants=lnd.service
|
||||||
After=lnd.service
|
After=lnd.service
|
||||||
|
PartOf=lnd.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=faraday
|
User=faraday
|
||||||
|
|
|
@ -161,6 +161,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||||
Description=Helipad daemon
|
Description=Helipad daemon
|
||||||
Wants=lnd.service
|
Wants=lnd.service
|
||||||
After=lnd.service
|
After=lnd.service
|
||||||
|
PartOf=lnd.service
|
||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=$HELIPAD_BUILD_DIR/
|
WorkingDirectory=$HELIPAD_BUILD_DIR/
|
||||||
ExecStart=$HELIPAD_BIN $HELIPAD_HTTP_PORT
|
ExecStart=$HELIPAD_BIN $HELIPAD_HTTP_PORT
|
||||||
|
|
|
@ -90,6 +90,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=LightningTipBot Service
|
Description=LightningTipBot Service
|
||||||
After=lnd.service
|
After=lnd.service
|
||||||
|
PartOf=lnd.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=/home/lightningtipbot/LightningTipBot
|
WorkingDirectory=/home/lightningtipbot/LightningTipBot
|
||||||
|
|
|
@ -817,6 +817,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||||
Description=lnbits
|
Description=lnbits
|
||||||
Wants=${systemdDependency}
|
Wants=${systemdDependency}
|
||||||
After=${systemdDependency}
|
After=${systemdDependency}
|
||||||
|
PartOf=${systemdDependency}
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=/home/lnbits/lnbits
|
WorkingDirectory=/home/lnbits/lnbits
|
||||||
|
|
|
@ -46,6 +46,7 @@ protocol.custom-init=39
|
||||||
echo "[Unit]
|
echo "[Unit]
|
||||||
Description=lndk Service
|
Description=lndk Service
|
||||||
After=lnd.service
|
After=lnd.service
|
||||||
|
PartOf=lnd.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/home/bitcoin/lndk/target/debug/lndk --address=https://localhost:10009 --cert=/mnt/hdd/lnd/tls.cert --macaroon=/mnt/hdd/lnd/data/chain/bitcoin/mainnet/admin.macaroon
|
ExecStart=/home/bitcoin/lndk/target/debug/lndk --address=https://localhost:10009 --cert=/mnt/hdd/lnd/tls.cert --macaroon=/mnt/hdd/lnd/data/chain/bitcoin/mainnet/admin.macaroon
|
||||||
|
|
|
@ -114,6 +114,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Loopd Service
|
Description=Loopd Service
|
||||||
After=lnd.service
|
After=lnd.service
|
||||||
|
PartOf=lnd.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=/home/loop/loop
|
WorkingDirectory=/home/loop/loop
|
||||||
|
|
|
@ -48,8 +48,16 @@ echo "# RTLHTTP(${RTLHTTP})"
|
||||||
# construct needed variable elements
|
# construct needed variable elements
|
||||||
configEntry="${netprefix}${typeprefix}rtlWebinterface"
|
configEntry="${netprefix}${typeprefix}rtlWebinterface"
|
||||||
systemdService="${netprefix}${typeprefix}RTL"
|
systemdService="${netprefix}${typeprefix}RTL"
|
||||||
|
dependsOn="bitcoind"
|
||||||
|
if [ "${LNTYPE}" == "cl" ]; then
|
||||||
|
dependsOn="${netprefix}lightningd"
|
||||||
|
elif [ "${LNTYPE}" == "lnd" ]; then
|
||||||
|
dependsOn="${netprefix}lnd"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "# configEntry(${configEntry})"
|
echo "# configEntry(${configEntry})"
|
||||||
echo "# systemdService(${systemdService})"
|
echo "# systemdService(${systemdService})"
|
||||||
|
echo "# dependsOn(${dependsOn})"
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
# MENU
|
# MENU
|
||||||
|
@ -271,8 +279,9 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=${systemdService} Webinterface
|
Description=${systemdService} Webinterface
|
||||||
Wants=
|
Wants=${dependsOn}.service
|
||||||
After=
|
After=${dependsOn}.service
|
||||||
|
PartOf=${dependsOn}.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Environment=\"RTL_CONFIG_PATH=/mnt/hdd/app-data/rtl/${systemdService}/\"
|
Environment=\"RTL_CONFIG_PATH=/mnt/hdd/app-data/rtl/${systemdService}/\"
|
||||||
|
@ -297,19 +306,8 @@ WantedBy=multi-user.target
|
||||||
" | sudo tee /etc/systemd/system/${systemdService}.service
|
" | sudo tee /etc/systemd/system/${systemdService}.service
|
||||||
sudo chown root:root /etc/systemd/system/${systemdService}.service
|
sudo chown root:root /etc/systemd/system/${systemdService}.service
|
||||||
|
|
||||||
# adapt systemd service template for LND
|
# set up Core LightningREST (if needed)
|
||||||
if [ "${LNTYPE}" == "lnd" ]; then
|
|
||||||
echo "# modifying ${systemdService}.service for LND"
|
|
||||||
sudo sed -i "s/^Wants=.*/Wants=${netprefix}lnd.service/g" /etc/systemd/system/${systemdService}.service
|
|
||||||
sudo sed -i "s/^After=.*/After=${netprefix}lnd.service/g" /etc/systemd/system/${systemdService}.service
|
|
||||||
fi
|
|
||||||
# adapt systemd service template for
|
|
||||||
if [ "${LNTYPE}" == "cl" ]; then
|
if [ "${LNTYPE}" == "cl" ]; then
|
||||||
echo "# modifying ${systemdService}.service for CL"
|
|
||||||
sudo sed -i "s/^Wants=.*/Wants=${netprefix}lightningd.service/g" /etc/systemd/system/${systemdService}.service
|
|
||||||
sudo sed -i "s/^After=.*/After=${netprefix}lightningd.service/g" /etc/systemd/system/${systemdService}.service
|
|
||||||
|
|
||||||
# set up Core LightningREST
|
|
||||||
/home/admin/config.scripts/cl.rest.sh on ${CHAIN}
|
/home/admin/config.scripts/cl.rest.sh on ${CHAIN}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@ echo "
|
||||||
Description=c-lightning daemon on $CHAIN
|
Description=c-lightning daemon on $CHAIN
|
||||||
Requires=${netprefix}bitcoind.service
|
Requires=${netprefix}bitcoind.service
|
||||||
After=${netprefix}bitcoind.service
|
After=${netprefix}bitcoind.service
|
||||||
|
PartOf=${netprefix}bitcoind.service
|
||||||
Wants=network-online.target
|
Wants=network-online.target
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
|
|
||||||
|
|
|
@ -344,6 +344,7 @@ Description=Lightning Network Daemon on $CHAIN
|
||||||
# Make sure lnd starts after bitcoind is ready
|
# Make sure lnd starts after bitcoind is ready
|
||||||
Requires=${netprefix}bitcoind.service
|
Requires=${netprefix}bitcoind.service
|
||||||
After=${netprefix}bitcoind.service
|
After=${netprefix}bitcoind.service
|
||||||
|
PartOf=${netprefix}bitcoind.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
EnvironmentFile=/mnt/hdd/raspiblitz.conf
|
EnvironmentFile=/mnt/hdd/raspiblitz.conf
|
||||||
|
|
Loading…
Add table
Reference in a new issue