From 3522be4153c4cf6fc3e768a124db293c3a222248 Mon Sep 17 00:00:00 2001 From: Mayank Date: Tue, 7 Jul 2020 00:06:16 +0530 Subject: [PATCH] Cleanup unused code --- stage2/01-sys-tweaks/files/rc.local | 18 +++++------------- stage2/02-net-tweaks/00-packages | 1 - stage2/06-prepare-home-dir/01-run.sh | 7 ------- stage2/07-set-bitcoind-perms/01-run.sh | 10 ---------- stage2/08-configure-tor/01-run.sh | 6 ------ stage2/08-configure-tor/files/torrc | 21 --------------------- 6 files changed, 5 insertions(+), 58 deletions(-) delete mode 100755 stage2/06-prepare-home-dir/01-run.sh delete mode 100755 stage2/07-set-bitcoind-perms/01-run.sh delete mode 100755 stage2/08-configure-tor/01-run.sh delete mode 100644 stage2/08-configure-tor/files/torrc diff --git a/stage2/01-sys-tweaks/files/rc.local b/stage2/01-sys-tweaks/files/rc.local index 4991680..845fe27 100755 --- a/stage2/01-sys-tweaks/files/rc.local +++ b/stage2/01-sys-tweaks/files/rc.local @@ -39,19 +39,11 @@ if [ ! -f /home/umbrel/statuses/disk-partitioned ]; then fi if [ ! -f /home/umbrel/statuses/service-configured ]; then - if [ -f /home/umbrel/bin/rpcauth.py ]; then - echo "Running rpcauth.py, and generating secrets for bitcoind" - cd /home/umbrel/bin/ - ./rpcauth.py lncm | tee /home/umbrel/secrets/generated.txt | head -2 | tail -1 > /home/umbrel/secrets/rpcauth.txt - tail -1 /home/umbrel/secrets/generated.txt > /home/umbrel/secrets/rpcpass.txt - echo "Updating bitcoin.conf" - cat /home/umbrel/secrets/rpcauth.txt >> /home/umbrel/bitcoin/bitcoin.conf - # Update RPC Passwords for both LND and INVOICER - RPCPASS=`cat /home/umbrel/secrets/rpcpass.txt` - sed -i "s/RPCPASS/${RPCPASS}/g;" /home/umbrel/docker-compose.yml - sed -i "s/RPCPASS/${RPCPASS}/g;" /home/umbrel/lnd/lnd.conf - - # Making this as done so we don't go through updates again + if [ -f /home/umbrel/configure-box.sh ]; then + echo "Running configuration script" + cd /home/umbrel + ./configure-box.sh || exit 1 + # Marking this as done so we don't do configuration again touch /home/umbrel/statuses/service-configured chown -R umbrel.umbrel /home/umbrel/statuses/service-configured fi diff --git a/stage2/02-net-tweaks/00-packages b/stage2/02-net-tweaks/00-packages index 96ed6d2..97eafda 100644 --- a/stage2/02-net-tweaks/00-packages +++ b/stage2/02-net-tweaks/00-packages @@ -2,7 +2,6 @@ wpasupplicant wireless-tools firmware-atheros firmware-brcm80211 firmware-libert raspberrypi-net-mods dhcpcd5 net-tools -tor libzbar-dev libzbar0 python3-pip diff --git a/stage2/06-prepare-home-dir/01-run.sh b/stage2/06-prepare-home-dir/01-run.sh deleted file mode 100755 index 1a49868..0000000 --- a/stage2/06-prepare-home-dir/01-run.sh +++ /dev/null @@ -1,7 +0,0 @@ -# Save password (for createwallet script). -# We will remove this later when a more suitable secure system is finalized. -touch $ROOTFS_DIR/home/$FIRST_USER_NAME/.save_password - -echo "Executables directory" -mkdir -p $ROOTFS_DIR/home/$FIRST_USER_NAME/bin - diff --git a/stage2/07-set-bitcoind-perms/01-run.sh b/stage2/07-set-bitcoind-perms/01-run.sh deleted file mode 100755 index 7177570..0000000 --- a/stage2/07-set-bitcoind-perms/01-run.sh +++ /dev/null @@ -1,10 +0,0 @@ -# TODO: configure username and password (internally) - -echo "Downloading password utility" -cd ${ROOTFS_DIR}/home/${FIRST_USER_NAME}/bin -curl "https://raw.githubusercontent.com/bitcoin/bitcoin/master/share/rpcauth/rpcauth.py" 2>/dev/null 1>rpcauth.py -chmod 755 rpcauth.py - -on_chroot << EOF -chown -R ${FIRST_USER_NAME}:${FIRST_USER_NAME} /home/${FIRST_USER_NAME} -EOF diff --git a/stage2/08-configure-tor/01-run.sh b/stage2/08-configure-tor/01-run.sh deleted file mode 100755 index 7997ad2..0000000 --- a/stage2/08-configure-tor/01-run.sh +++ /dev/null @@ -1,6 +0,0 @@ -# TODO: configure username and password (internally) - -chmod 644 files/torrc -mkdir -p ${ROOTFS_DIR}/etc/tor/ -echo "Overriding TORRC" -cp files/torrc ${ROOTFS_DIR}/etc/tor/torrc diff --git a/stage2/08-configure-tor/files/torrc b/stage2/08-configure-tor/files/torrc deleted file mode 100644 index d9ea535..0000000 --- a/stage2/08-configure-tor/files/torrc +++ /dev/null @@ -1,21 +0,0 @@ -SocksPort 9050 # Default: Bind to localhost:9050 for local connections. - -Log notice syslog -Log debug file /var/log/tor/debug.log - -#RunAsDaemon 1 - -DataDirectory /var/lib/tor -ControlPort 9051 -# Default password for umbrel tor -HashedControlPassword 16:50A873DF18C00F4A6048BF1CEF7E7AA66478F0B5134DA4369D80657F26 -# Backwards compatibility -CookieAuthentication 1 - -# Allow this for now -# TOR HOSTNAME -HiddenServiceDir /var/lib/tor/sshd -HiddenServicePort 22 127.0.0.1:22 - -HiddenServiceDir /var/lib/tor/web -HiddenServicePort 80 127.0.0.1:80