diff --git a/home.admin/assets/RTL.service b/home.admin/assets/RTL.service deleted file mode 100644 index 32c72f326..000000000 --- a/home.admin/assets/RTL.service +++ /dev/null @@ -1,19 +0,0 @@ -# Raspibolt RTL: systemd unit for RTL -# /etc/systemd/system/RTL.service - -[Unit] -Description=RTL daemon -Wants=lnd.service -After=lnd.service - -[Service] -ExecStart=/usr/bin/node /home/admin/RTL/rtl --lndir /home/admin/.lnd/data/chain/bitcoin/mainnet -User=root -Restart=always -TimeoutSec=120 -RestartSec=30 -StandardOutput=null -StandardError=journal - -[Install] -WantedBy=multi-user.target \ No newline at end of file diff --git a/home.admin/config.scripts/blitz.setpassword.sh b/home.admin/config.scripts/blitz.setpassword.sh index d5c46598a..1a633c099 100644 --- a/home.admin/config.scripts/blitz.setpassword.sh +++ b/home.admin/config.scripts/blitz.setpassword.sh @@ -208,21 +208,25 @@ elif [ "${abcd}" = "b" ]; then # RTL - keep settings from current RTL-Config.json if [ "${rtlWebinterface}" == "on" ]; then echo "# changing RTL password" - cp /home/admin/RTL/RTL-Config.json /home/admin/RTL/backup-RTL-Config.json + cp /home/rtl/RTL/RTL-Config.json /home/rtl/RTL/backup-RTL-Config.json # remove hashed old password #sed -i "/\b\(multiPassHashed\)\b/d" ./RTL-Config.json # set new password - chmod 600 /home/admin/RTL/RTL-Config.json || exit 1 - node > /home/admin/RTL/RTL-Config.json < /home/admin/RTL-Config.json </dev/null - sed -i "s/^BTCEXP_BITCOIND_PASS=.*/BTCEXP_BITCOIND_PASS=${newPassword}/g" /home/bitcoin/.config/btc-rpc-explorer.env 2>/dev/null - sed -i "s/^BTCEXP_BASIC_AUTH_PASSWORD=.*/BTCEXP_BASIC_AUTH_PASSWORD=${newPassword}/g" /home/bitcoin/.config/btc-rpc-explorer.env 2>/dev/null + sed -i "s/^BTCEXP_BITCOIND_PASS=.*/BTCEXP_BITCOIND_PASS=${newPassword}/g" /home/btcrpcexplorer/.config/btc-rpc-explorer.env 2>/dev/null + sed -i "s/^BTCEXP_BASIC_AUTH_PASSWORD=.*/BTCEXP_BASIC_AUTH_PASSWORD=${newPassword}/g" /home/btcrpcexplorer/.config/btc-rpc-explorer.env 2>/dev/null fi # BTCPayServer diff --git a/home.admin/config.scripts/bonus.btc-rpc-explorer.sh b/home.admin/config.scripts/bonus.btc-rpc-explorer.sh index f3729ad69..1a0479a2a 100644 --- a/home.admin/config.scripts/bonus.btc-rpc-explorer.sh +++ b/home.admin/config.scripts/bonus.btc-rpc-explorer.sh @@ -88,30 +88,6 @@ if [ "$1" = "status" ]; then exit 0 fi -# determine nodeJS DISTRO -isARM=$(uname -m | grep -c 'arm') -isAARCH64=$(uname -m | grep -c 'aarch64') -isX86_64=$(uname -m | grep -c 'x86_64') -isX86_32=$(uname -m | grep -c 'i386\|i486\|i586\|i686\|i786') -# get checksums from -> https://nodejs.org/dist/vx.y.z/SHASUMS256.txt -if [ ${isARM} -eq 1 ] ; then -DISTRO="linux-armv7l" -fi -if [ ${isAARCH64} -eq 1 ] ; then -DISTRO="linux-arm64" -fi -if [ ${isX86_64} -eq 1 ] ; then -DISTRO="linux-x64" -fi -if [ ${isX86_32} -eq 1 ] ; then -echo "FAIL: No X86 32bit build available - will abort setup" -exit 1 -fi -if [ ${#DISTRO} -eq 0 ]; then -echo "FAIL: Was not able to determine architecture" -exit 1 -fi - # stop service echo "making sure services are not running" sudo systemctl stop btc-rpc-explorer 2>/dev/null @@ -128,8 +104,16 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then # make sure that txindex of blockchain is switched on /home/admin/config.scripts/network.txindex.sh on + + # add btcrpcexplorer user + sudo adduser --disabled-password --gecos "" btcrpcexplorer - npm install -g btc-rpc-explorer@1.1.8 + # install btc-rpc-explorer + cd /home/btcrpcexplorer + sudo -u btcrpcexplorer git clone https://github.com/janoside/btc-rpc-explorer.git + cd btc-rpc-explorer + sudo -u btcrpcexplorer git reset --hard v1.1.9 + sudo -u btcrpcexplorer npm install # prepare .env file echo "getting RPC credentials from the ${network}.conf" @@ -137,27 +121,25 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then RPC_USER=$(sudo cat /mnt/hdd/${network}/${network}.conf | grep rpcuser | cut -c 9-) PASSWORD_B=$(sudo cat /mnt/hdd/${network}/${network}.conf | grep rpcpassword | cut -c 13-) - sudo -u bitcoin mkdir /home/bitcoin/.config/ 2>/dev/null touch /home/admin/btc-rpc-explorer.env - chmod 600 /home/admin/btc-rpc-explorer.env || exit 1 + sudo chmod 600 /home/admin/btc-rpc-explorer.env || exit 1 cat > /home/admin/btc-rpc-explorer.env < /home/admin/btc-rpc-explorer.run.sh </dev/null - git clone https://github.com/ShahanaFarooqui/RTL.git /home/admin/RTL - cd /home/admin/RTL - git reset --hard v0.6.7 + rm -rf /home/admin/RTL 2>/dev/null + sudo -u rtl rm -rf /home/rtl/RTL 2>/dev/null + sudo -u rtl git clone https://github.com/ShahanaFarooqui/RTL.git /home/rtl/RTL + cd /home/rtl/RTL + sudo -u rtl git reset --hard v0.6.7 # from https://github.com/Ride-The-Lightning/RTL/commits/master # git checkout 917feebfa4fb583360c140e817c266649307ef72 # git fetch origin # git checkout feature/0.6.5 - if [ -d "/home/admin/RTL" ]; then + if [ -d "/home/rtl/RTL" ]; then echo "OK - RTL code copy looks good" else echo "FAIL - code copy did not run correctly" @@ -97,10 +101,10 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then # install echo "*** Run: npm install ***" export NG_CLI_ANALYTICS=false - npm install --only=production + sudo -u rtl npm install --only=production cd .. # check if node_modules exist now - if [ -d "/home/admin/RTL/node_modules" ]; then + if [ -d "/home/rtl/RTL/node_modules" ]; then echo "OK - RTL install looks good" else echo "FAIL - npm install did not run correctly" @@ -117,23 +121,26 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then # prepare RTL-Config.json file echo "*** RTL.conf ***" # change of config: https://github.com/Ride-The-Lightning/RTL/tree/v0.6.4 - cp /home/admin/RTL/sample-RTL-Config.json /home/admin/RTL/RTL-Config.json - chmod 600 /home/admin/RTL/RTL-Config.json || exit 1 + sudo cp /home/rtl/RTL/sample-RTL-Config.json /home/admin/RTL-Config.json + sudo chown admin:admin /home/admin/RTL-Config.json + sudo chmod 600 /home/admin/RTL-Config.json || exit 1 PASSWORD_B=$(sudo cat /mnt/hdd/${network}/${network}.conf | grep rpcpassword | cut -c 13-) - # modify sample-RTL-Config.json and save in RTL-Config.json - node > /home/admin/RTL/RTL-Config.json < /home/admin/RTL-Config.json < /home/admin/RTL.service <