Files
agent0/tunnel-entrypoint.sh
T

15 lines
470 B
Bash

#!/bin/sh
# Establish a persistent SSH reverse tunnel from this machine to the VPS.
# Traffic arriving at VPS:50001 is forwarded to agent0:80 on the Docker network.
set -e
exec autossh -M 0 -N \
-i /run/tunnel/id_ed25519 \
-o "UserKnownHostsFile=/run/tunnel/known_hosts" \
-o "StrictHostKeyChecking=yes" \
-o "ServerAliveInterval=30" \
-o "ServerAliveCountMax=3" \
-o "ExitOnForwardFailure=yes" \
-R 127.0.0.1:50001:agent0:80 \
tunnel@glitch.university