move some stuff to frodo, rename user to iank, fixes
[distro-setup] / distro-end
index 285b25cd4e4e834806d428c9e7c0afad2310e106..b044f5c798fe549e0a4c31a07aad5899cebb3844 100755 (executable)
@@ -108,6 +108,7 @@ case $HOSTNAME in
             guvcview
             i3lock
             inetutils-traceroute
+            iperf3
             iproute2-doc
             jq
             kid3-qt
@@ -282,7 +283,8 @@ if isdebian; then
 fi
 
 # we've got a few dependencies later on, so install them now.
-pi "${simple_packages[@]}"
+pi eatmydata
+s eatmydata apt-get -y install --purge --auto-remove "${simple_packages[@]}"
 simple_packages=()
 
 
@@ -437,7 +439,7 @@ EOF
         # https://nodejs.org/en/download/package-manager/
         curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
         pi nodejs
-        cd /home/ian
+        cd /home/iank
         rm -rf pump.io.git
         git clone https://github.com/pump-io/pump.io.git
         cd pump.io
@@ -487,7 +489,7 @@ After=syslog.target network.target
 Type=simple
 User=pumpio
 Group=pumpio
-ExecStart=/home/ian/pump.io/bin/pump
+ExecStart=/home/iank/pump.io/bin/pump
 Environment=NODE_ENV=production
 # failed to find databank-mongodb without this.
 # I just looked at my environment variables took a guess.
@@ -643,7 +645,7 @@ Description=rss2email
 After=multi-user.target
 
 [Service]
-User=ian
+User=iank
 Type=oneshot
 # about 24 hours of failures
 # it copies over its files without respecting symlinks, so
@@ -675,7 +677,7 @@ Description=pump li backup
 After=multi-user.target
 
 [Service]
-User=ian
+User=iank
 Type=oneshot
 ExecStart=/a/bin/log-quiet/sysd-mail-once pump-backup /a/bin/distro-setup/pump-backup
 EOF
@@ -747,8 +749,8 @@ if [[ $HOSTNAME == treetowl ]]; then
             pi syncthing
             ;;
     esac
-    lnf -T /w/syncthing /home/ian/.config/syncthing
-    sgo syncthing@ian # runs as ian
+    lnf -T /w/syncthing /home/iank/.config/syncthing
+    sgo syncthing@iank # runs as iank
 
     # these things persist in ~/.config/syncthing, which I save in
     # /w/syncthing (not in /p, because syncthing should continue to
@@ -920,7 +922,7 @@ if ! getent passwd debian-transmission > /dev/null; then
             ;;
     esac
 fi
-if [[ $HOSTNAME == treetowl ]]; then
+if [[ $HOSTNAME == frodo ]]; then
     sgo transmission-daemon-nn
 fi
 
@@ -1123,7 +1125,7 @@ case $distro in
     # others unknown
 esac
 # allow user to run vms, from debian handbook
-for x in ian traci; do s usermod -a -G libvirt,kvm $x; done
+for x in iank traci; do s usermod -a -G libvirt,kvm $x; done
 # bridge networking as user fails. google lead here, but it doesn\'t work:
 # oh well, I give up.
 # http://wiki.qemu.org/Features-Done/HelperNetworking
@@ -1253,19 +1255,11 @@ if [[ $HOSTNAME == treetowl ]]; then
                 f=$dir/bitcoin.conf
                 s dd of=$f <<EOF
 server=1
+# necessary for joinmarket, not bad in general
 rpcpassword=$(openssl rand -base64 32)
 rpcuser=$(openssl rand -base64 32)
 EOF
 
-
-                f2=$dir/bitcoinjm.conf
-                s cp $f $f2
-                s tee -a $f2 >/dev/null <<EOF
-# Joinmarket
-walletnotify=curl -sI --connect-timeout 1 http://localhost:62602/walletnotify?%s
-alertnotify=curl -sI --connect-timeout 1 http://localhost:62602/alertnotify?%s
-wallet=joinmarket.dat
-EOF
                 # dunno about sharing a wallet between multiple instances
                 # manually did, wallet.dat symlinked in /nocow/.bitcoin
                 sgo bitcoind
@@ -1273,34 +1267,55 @@ EOF
             ;;
         # other distros unknown
     esac
-    pi libsodium-dev python-pip
-    cd /a/opt/joinmarket
-    # using develop branch, as it seems to be mostly bug fixes,
-    # and this is quite new software.
-    # note: python3 does not work.
-    # has seg fault error due to some bug, but it still works
-    pip install -r requirements.txt || [[ $? == 139 ]]
-    # note, the target must exist ahead of time, or bitcoin
-    # just overwrites the link, and it\'s not happy with an empty file,
-    # so we have to create the wallet, then move and link it.
-    s lnf -T /q/bitcoin/wallet.dat /nocow/.bitcoin/wallet.dat
-    s lnf -T /q/bitcoin/joinmarket.dat /nocow/.bitcoin/joinmarket.dat
-    # not technically needed, but seems cleaner not to have
-    # symlinks be root owned unlike everything else
-    s chown -h bitcoin:bitcoin /nocow/.bitcoin/*
-
-    for var in rpcuser rpcpassword; do
-        u="$(s sed -rn "s/^$var=(.*)/\1/p" /etc/bitcoin/bitcoin.conf)"
-        # escape backslashes
-        u="${u//\\/\\\\\\\\}"
-        # escape commas
-        u="${u//,/\\,}"
-        sed -ri "s,^(rpc_${var#rpc}\s*=).*,\1 $u," joinmarket.cfg
-    done
-    sed -ri "s/^\s*(blockchain_source\s*=).*/\1 bitcoin-rpc/" joinmarket.cfg
 
-fi
+#     ## disabling joinmarket, its too expensive
+#     ### begin joinmarket setup ###
+
+#     case $distro in
+#         debian)
+#             f=$dir/bitcoin.conf
+#             f2=$dir/bitcoinjm.conf
+#             s cp $f $f2
+#             s tee -a $f2 >/dev/null <<EOF
+# # Joinmarket
+# walletnotify=curl -sI --connect-timeout 1 http://localhost:62602/walletnotify?%s
+# alertnotify=curl -sI --connect-timeout 1 http://localhost:62602/alertnotify?%s
+# wallet=joinmarket.dat
+# EOF
 
+#             ;;
+#         # other distros unknown
+#     esac
+
+#     pi libsodium-dev python-pip
+#     cd /a/opt/joinmarket
+#     # using develop branch, as it seems to be mostly bug fixes,
+#     # and this is quite new software.
+#     # note: python3 does not work.
+#     # has seg fault error due to some bug, but it still works
+#     pip install -r requirements.txt || [[ $? == 139 ]]
+#     # note, the target must exist ahead of time, or bitcoin
+#     # just overwrites the link, and it\'s not happy with an empty file,
+#     # so we have to create the wallet, then move and link it.
+#     s lnf -T /q/bitcoin/wallet.dat /nocow/.bitcoin/wallet.dat
+#     s lnf -T /q/bitcoin/joinmarket.dat /nocow/.bitcoin/joinmarket.dat
+#     # not technically needed, but seems cleaner not to have
+#     # symlinks be root owned unlike everything else
+#     s chown -h bitcoin:bitcoin /nocow/.bitcoin/*
+
+#     for var in rpcuser rpcpassword; do
+#         u="$(s sed -rn "s/^$var=(.*)/\1/p" /etc/bitcoin/bitcoin.conf)"
+#         # escape backslashes
+#         u="${u//\\/\\\\\\\\}"
+#         # escape commas
+#         u="${u//,/\\,}"
+#         sed -ri "s,^(rpc_${var#rpc}\s*=).*,\1 $u," joinmarket.cfg
+#     done
+#     sed -ri "s/^\s*(blockchain_source\s*=).*/\1 bitcoin-rpc/" joinmarket.cfg
+#     ### end joinmarket setup ###
+
+
+fi
 
 
 case $distro in
@@ -1418,8 +1433,8 @@ fi
 #         s systemctl daemon-reload
 #         case $HOSTNAME in
 #             x2|treetowl)
-#                 ser enable synergyc@ian
-#                 ser start synergyc@ian ||: # X might not be running yet
+#                 ser enable synergyc@iank
+#                 ser start synergyc@iank ||: # X might not be running yet
 #                 ;;
 #             frodo)
 #                 systemctl --user start synergys ||:
@@ -1566,20 +1581,11 @@ if [[ $HOSTNAME == treetowl ]]; then
     # ser list-timers
 fi
 
-if [[ $HOSTNAME == treetowl ]] && [[ `debian-archive` != testing ]]; then
-    # fail2 ban is broken, with a workaround, per
-    # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=770171
-    # ill wait a while to see if it gets fixed
-    pi fail2ban
-    sgo fail2ban
-fi
-
-
 
 
 
 case $distro in
-    debian|ubuntu|trisquel) s gpasswd -a ian adm ;; #needed for reading logs
+    debian|ubuntu|trisquel) s gpasswd -a iank adm ;; #needed for reading logs
 esac
 
 # tor