Drop socat for iptables

This commit is contained in:
Michael Vines 2019-03-13 09:57:35 -07:00
parent 61db74d98e
commit 5d27f221f7
4 changed files with 11 additions and 13 deletions

View File

@ -478,7 +478,6 @@ $(
install-nodejs.sh \
install-redis.sh \
install-rsync.sh \
install-socat.sh \
network-config.sh \
remove-docker-interface.sh \

View File

@ -409,7 +409,6 @@ stopNode() {
for pattern in solana- remote-; do
pkill -9 \$pattern
done
sudo killall socat
"
) || true
}

View File

@ -116,7 +116,17 @@ local|tar)
if [[ $nodeType = blockstreamer ]]; then
npm install @solana/blockexplorer@1
npx solana-blockexplorer > blockexplorer.log 2>&1 &
sudo socat -lf socat.log TCP-LISTEN:80,reuseaddr,fork,su=nobody TCP:localhost:5000 &
# Confirm the blockexplorer is accessible
curl --head --retry 3 --retry-connrefused http://localhost:5000/
# Redirect port 80 to port 5000
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 5000 -j ACCEPT
sudo iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-port 5000
# Confirm the blockexplorer is now globally accessible
curl --head "$(curl ifconfig.io)"
fi
./multinode-demo/fullnode.sh "${args[@]}" "$entrypointIp":~/solana "$entrypointIp:8001" > fullnode.log 2>&1 &
;;

View File

@ -1,10 +0,0 @@
#!/usr/bin/env bash
#
# socat setup for
#
set -ex
[[ $(uname) = Linux ]] || exit 1
[[ $USER = root ]] || exit 1
apt-get --assume-yes install socat