From 28a647d0c2aa0aa78da3eb02307720ba4d7e5ea3 Mon Sep 17 00:00:00 2001 From: Taylor Helsper Date: Mon, 25 Nov 2019 18:13:33 -0600 Subject: [PATCH] Docker system updates --- .../standard/usr/bin/mynode_post_upgrade.sh | 5 ++++ setup/setup_device.sh | 28 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/rootfs/standard/usr/bin/mynode_post_upgrade.sh b/rootfs/standard/usr/bin/mynode_post_upgrade.sh index c496cf98..b14c5bdc 100755 --- a/rootfs/standard/usr/bin/mynode_post_upgrade.sh +++ b/rootfs/standard/usr/bin/mynode_post_upgrade.sh @@ -52,6 +52,11 @@ if [ ! -f /usr/bin/docker ]; then /bin/bash /tmp/docker_install.sh fi +# Use systemd for managing docker +rm -f /etc/init.d/docker +rm -f /etc/systemd/system/multi-user.target.wants/docker.service +systemctl -f enable docker.service + groupadd docker || true usermod -aG docker admin usermod -aG docker bitcoin diff --git a/setup/setup_device.sh b/setup/setup_device.sh index 42197cb2..2756f88f 100755 --- a/setup/setup_device.sh +++ b/setup/setup_device.sh @@ -63,6 +63,7 @@ apt-get -y update apt-get -y upgrade # Install other tools (run section multiple times to make sure success) +export DEBIAN_FRONTEND=noninteractive apt-get -y install htop git curl bash-completion jq dphys-swapfile lsof libzmq3-dev apt-get -y install build-essential python-dev python-pip python3-dev python3-pip apt-get -y install transmission-cli fail2ban ufw tclsh bluez python-bluez redis-server @@ -142,6 +143,12 @@ fi # Install docker curl -sSL https://get.docker.com | sed 's/sleep 20/sleep 1/' | sudo sh + +# Use systemd for managing docker +rm -f /etc/init.d/docker +rm -f /etc/systemd/system/multi-user.target.wants/docker.service +systemctl -f enable docker.service + groupadd docker || true usermod -aG docker admin usermod -aG docker bitcoin @@ -338,6 +345,27 @@ if [ "$CURRENT" != "$LNDCONNECT_UPGRADE_URL" ]; then echo $LNDCONNECT_UPGRADE_URL > $LNDCONNECT_UPGRADE_URL_FILE fi +# Install WebSSH2 +WEBSSH2_UPGRADE_URL=https://github.com/billchurch/webssh2/archive/v0.2.10-0.tar.gz +WEBSSH2_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.webssh2_url +CURRENT="" +if [ -f $WEBSSH2_UPGRADE_URL_FILE ]; then + CURRENT=$(cat $WEBSSH2_UPGRADE_URL_FILE) +fi +if [ "$CURRENT" != "$WEBSSH2_UPGRADE_URL" ]; then + cd /opt/mynode + rm -rf webssh2 + wget $WEBSSH2_UPGRADE_URL -O webssh2.tar.gz + tar -xvf webssh2.tar.gz + rm webssh2.tar.gz + mv webssh2-* webssh2 + cd webssh2 + mv app/config.json.sample app/config.json + docker build -t webssh2 . + + echo $WEBSSH2_UPGRADE_URL > $WEBSSH2_UPGRADE_URL_FILE +fi + # Install ngrok for debugging if [ ! -f /usr/bin/ngrok ]; then