diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 diff --git a/README b/README old mode 100644 new mode 100755 diff --git a/client/client.go b/client/client.go old mode 100644 new mode 100755 diff --git a/client/list-servers.go b/client/list-servers.go old mode 100644 new mode 100755 diff --git a/dissertation-1.pdf b/dissertation-1.pdf old mode 100644 new mode 100755 diff --git a/docs/Installation.txt b/docs/Installation.txt old mode 100644 new mode 100755 diff --git a/go.mod b/go.mod old mode 100644 new mode 100755 diff --git a/go.sum b/go.sum old mode 100644 new mode 100755 diff --git a/server/container.go b/server/container.go old mode 100644 new mode 100755 diff --git a/server/ipfs-ssh.sh b/server/ipfs-ssh.sh new file mode 100644 index 0000000..74fce0c --- /dev/null +++ b/server/ipfs-ssh.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +#Implementation from (https://gist.github.com/Kubuxu/0cafd6dc71114349875827c2c379fa1f) +REMOTE_HOST=${1-"YOUR REMOTE HOST HERE"} +DEFAULT_API_FILE="$HOME/.ipfs/api" +API_FILE="${IPFS_PATH-$DEFAULT_API_FILE}" + +if [ -e "$API_FILE" ]; then + echo "IPFS API is already running" + exit 1 +fi + +PORT=5001 +ssh -N -L ${PORT}:localhost:5001 $REMOTE_HOST & +SSH_PID=$! + +function cleanupAndExit() { + rm -f "$API_FILE" + echo + echo "Killing ssh." + kill "$SSH_PID" + exit +} +trap cleanupAndExit INT + +printf "/ip4/127.0.0.1/tcp/$PORT" > "$API_FILE" + +echo "Linked local API to $REMOTE_HOST." + +wait $SSH_PID +rm -f "$API_FILE" \ No newline at end of file diff --git a/server/server.go b/server/server.go old mode 100644 new mode 100755